@woodsportal/hubspot-kit 1.0.41-dev.4 → 1.0.41-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +191 -157
- package/dist/{chunk-S2YJDWZU.js → chunk-NWBK3XBZ.js} +1 -1
- package/dist/chunk-NWBK3XBZ.js.map +1 -0
- package/dist/chunk-WHYTQEZX.js +554 -0
- package/dist/chunk-WHYTQEZX.js.map +1 -0
- package/dist/cli.js +1494 -650
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js +194 -0
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js.map +1 -0
- package/dist/vite/index.js +1 -1
- package/examples/greenfield/module-hybrid-cdn/public/fields.json +73 -28
- package/examples/greenfield/module-hybrid-cdn/public/module.html +21 -5
- package/examples/greenfield/module-hybrid-cdn/src/assets/css/main.dev.css +15 -0
- package/examples/greenfield/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/app.tsx +172 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session.ts +51 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-session-bridge.ts +74 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-portal.ts +45 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/configure-woodsportal-sdk.ts +98 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routeTree.gen.ts +182 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/two-fa.tsx +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/app.tsx +180 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routeTree.gen.ts +155 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/auth-guide-content.ts +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-monolith/public/fields.json +66 -16
- package/examples/greenfield/module-monolith/src/assets/css/main.dev.css +7 -0
- package/examples/greenfield/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-monolith/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-monolith/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-monolith/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/manifest.json +5 -1
- package/examples/smoke/run-matrix.mjs +37 -0
- package/package.json +7 -5
- package/scripts/cli-smoke-helpers.mjs +150 -0
- package/scripts/regenerate-route-tree.mjs +71 -0
- package/scripts/sync-auth-scaffold-from-client.mjs +41 -0
- package/scripts/wp-cli-smoke.test.mjs +263 -0
- package/src/dev/bootstrap-greenfield.tsx +6 -0
- package/templates/module-hybrid-cdn/public/fields.json +47 -7
- package/templates/module-hybrid-cdn/public/module.html +7 -6
- package/templates/module-hybrid-cdn/src/assets/css/main.dev.css +7 -0
- package/templates/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/templates/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/module-monolith/public/fields.json +49 -6
- package/templates/module-monolith/src/assets/css/main.dev.css +7 -0
- package/templates/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-monolith/src/config/starter-nav.ts +9 -0
- package/templates/module-monolith/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-monolith/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/scaffold/auth/_full/src/app.tsx +172 -0
- package/templates/scaffold/auth/_full/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_full/src/features/auth/auth-session.ts +51 -0
- package/templates/scaffold/auth/_full/src/features/auth/login-session-bridge.ts +74 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-portal.ts +45 -0
- package/templates/scaffold/auth/_full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/templates/scaffold/auth/_full/src/routeTree.gen.ts +182 -0
- package/templates/scaffold/auth/_full/src/routes/_auth/two-fa.tsx +91 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/templates/scaffold/auth/_nav-top/src/components/Layouts/MainLayout.tsx +42 -0
- package/templates/scaffold/auth/_shared/src/app.tsx +178 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AuthLayout.tsx +7 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/index.ts +13 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Button.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Form.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Input.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Toaster.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/ui/link.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/components/ui/loader/loader.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/nav-scaffold.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/portal-nav.ts +9 -0
- package/templates/scaffold/auth/_shared/src/config/router.ts +1 -0
- package/templates/scaffold/auth/_shared/src/config/routes.ts +10 -0
- package/templates/scaffold/auth/_shared/src/data/hubSpotContext.ts +57 -0
- package/templates/scaffold/auth/_shared/src/data/sync-sdk-hub-context.ts +44 -0
- package/templates/scaffold/auth/_shared/src/env.ts +59 -0
- package/templates/scaffold/auth/_shared/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-navigation.ts +81 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-route-paths.ts +29 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session-events.ts +2 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session.ts +26 -0
- package/templates/scaffold/auth/_shared/src/features/auth/clear-client-auth-session.ts +62 -0
- package/templates/scaffold/auth/_shared/src/features/auth/components/starter-login.tsx +76 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-email-storage.ts +64 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-session-bridge.ts +72 -0
- package/templates/scaffold/auth/_shared/src/features/auth/post-login-path.ts +17 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-post-login-path.ts +21 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-portal-session.ts +25 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-signed-in-email.ts +55 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/templates/scaffold/auth/_shared/src/features/starter/content/auth-guide-content.ts +91 -0
- package/templates/scaffold/auth/_shared/src/hubspot/is-cms-editor.ts +78 -0
- package/templates/scaffold/auth/_shared/src/integrations/configure-woodsportal-sdk.ts +100 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-router/router.tsx +39 -0
- package/templates/scaffold/auth/_shared/src/integrations/woodsportal-sdk.ts +37 -0
- package/templates/scaffold/auth/_shared/src/portal/mount-portal.tsx +59 -0
- package/templates/scaffold/auth/_shared/src/routeTree.gen.ts +134 -0
- package/templates/scaffold/auth/_shared/src/routes/__root.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/routes/_app/portal.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/_auth/login.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/guide.tsx +9 -0
- package/templates/scaffold/auth/_shared/src/routes/index.tsx +8 -0
- package/templates/scaffold/auth/_shared/src/routes/unauthorized.tsx +50 -0
- package/templates/scaffold/auth/_shared/src/utils/ValidationSchema.ts +1 -0
- package/templates/scaffold/auth/_shared/src/utils/cookie.ts +23 -0
- package/templates/scaffold/auth/_shared/src/utils/normalize-router-path.ts +10 -0
- package/templates/scaffold/auth/_shared/src/utils/private-route.tsx +100 -0
- package/templates/scaffold/auth/_shared/src/utils/public-route.tsx +64 -0
- package/templates/scaffold/auth/_shared/src/utils/resolve-api-base-url.ts +44 -0
- package/templates/scaffold/auth/_shared/src/utils/safe-router-navigation.ts +82 -0
- package/templates/scaffold/auth/_sso/src/app.tsx +180 -0
- package/templates/scaffold/auth/_sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/templates/scaffold/auth/_sso/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_sso/src/features/auth/components/starter-login.tsx +83 -0
- package/templates/scaffold/auth/_sso/src/features/auth/sso-callback.ts +120 -0
- package/templates/scaffold/auth/_sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/templates/scaffold/auth/_sso/src/routeTree.gen.ts +155 -0
- package/templates/scaffold/auth/_sso/src/routes/_auth/login/sso.tsx +27 -0
- package/templates/scaffold/auth/nav-manifest.json +8 -0
- package/templates/scaffold/auth/sync-manifest.json +16 -0
- package/templates/scaffold/auth/tier-manifest.json +18 -0
- package/templates/scaffold/page/page-component-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/page-component-plain.tsx.tpl +11 -0
- package/templates/scaffold/page/route-protected-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/route-public-auth.tsx.tpl +9 -0
- package/templates/scaffold/page/route-public-plain.tsx.tpl +6 -0
- package/dist/chunk-S2YJDWZU.js.map +0 -1
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ExitCode,
|
|
4
|
+
WpHsError,
|
|
5
|
+
runCommand
|
|
6
|
+
} from "./chunk-4GOJPOW3.js";
|
|
7
|
+
|
|
8
|
+
// src/schema/woodsportal-hs.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var CONFIG_VERSION = 1;
|
|
11
|
+
var WPHS_WORKSPACE_DIR = ".wphs";
|
|
12
|
+
var WoodsPortalHsSchema = z.object({
|
|
13
|
+
configVersion: z.number().int().default(CONFIG_VERSION),
|
|
14
|
+
projectType: z.enum(["module-hybrid-cdn", "module-monolith", "theme-starter"]),
|
|
15
|
+
module: z.object({
|
|
16
|
+
name: z.string().min(1),
|
|
17
|
+
uploadPath: z.string().min(1),
|
|
18
|
+
outDir: z.string().default("dist/WoodsPortal.Module")
|
|
19
|
+
}),
|
|
20
|
+
theme: z.object({
|
|
21
|
+
name: z.string().min(1),
|
|
22
|
+
uploadPath: z.string().min(1),
|
|
23
|
+
srcDir: z.string().default("src/theme"),
|
|
24
|
+
themeJson: z.string().default("src/theme/theme.json")
|
|
25
|
+
}).optional(),
|
|
26
|
+
cdn: z.object({
|
|
27
|
+
mode: z.enum(["jsdelivr", "custom", "local", "none"]).default("jsdelivr"),
|
|
28
|
+
buildIdFile: z.string().default(".module-build-id"),
|
|
29
|
+
mirror: z.string().default("portal.cdn.json")
|
|
30
|
+
}).default({}),
|
|
31
|
+
entries: z.object({
|
|
32
|
+
app: z.string().default("src/cdn/app-entry.ts"),
|
|
33
|
+
vendor: z.string().default("src/cdn/vendor-entry.ts"),
|
|
34
|
+
hubspotBootstrap: z.string().default("src/hubspot/bootstrap.ts"),
|
|
35
|
+
/** Monolith production IIFE entry (wp build --hubspot-only) */
|
|
36
|
+
module: z.string().default("src/hubspot/module-entry.tsx"),
|
|
37
|
+
localDev: z.string().default("src/main.tsx")
|
|
38
|
+
}).default({}),
|
|
39
|
+
env: z.object({
|
|
40
|
+
tiers: z.array(z.enum(["dev", "stg", "prod"])).default(["dev", "stg", "prod"])
|
|
41
|
+
}).default({}),
|
|
42
|
+
dev: z.object({
|
|
43
|
+
moduleConfigDir: z.literal(WPHS_WORKSPACE_DIR).default(WPHS_WORKSPACE_DIR),
|
|
44
|
+
adapter: z.string().default("./wphs.adapter.ts"),
|
|
45
|
+
fieldsJson: z.string().default("public/fields.json"),
|
|
46
|
+
themeFieldsJson: z.string().optional()
|
|
47
|
+
}).default({}),
|
|
48
|
+
scaffold: z.object({
|
|
49
|
+
/** hash = woodsportal-client-frontend (HubSpot CMS); browser = local clean URLs; none = single page */
|
|
50
|
+
router: z.enum(["hash", "browser", "none"]).default("hash"),
|
|
51
|
+
/** Portal user auth tier (module templates only) */
|
|
52
|
+
auth: z.enum(["none", "starter", "sso", "full"]).default("none"),
|
|
53
|
+
/** Authenticated shell navigation — only when auth ≠ none */
|
|
54
|
+
nav: z.enum(["top", "sidebar"]).default("top").optional()
|
|
55
|
+
}).optional()
|
|
56
|
+
});
|
|
57
|
+
var DEFAULT_WOODSPORTAL_HS = {
|
|
58
|
+
configVersion: CONFIG_VERSION,
|
|
59
|
+
projectType: "module-hybrid-cdn",
|
|
60
|
+
module: {
|
|
61
|
+
name: "woodsportal-module",
|
|
62
|
+
uploadPath: "dw-modules/woodsportal-module.module",
|
|
63
|
+
outDir: "dist/WoodsPortal.Module"
|
|
64
|
+
},
|
|
65
|
+
cdn: {
|
|
66
|
+
mode: "jsdelivr",
|
|
67
|
+
buildIdFile: ".module-build-id",
|
|
68
|
+
mirror: "portal.cdn.json"
|
|
69
|
+
},
|
|
70
|
+
entries: {
|
|
71
|
+
app: "src/cdn/app-entry.ts",
|
|
72
|
+
vendor: "src/cdn/vendor-entry.ts",
|
|
73
|
+
hubspotBootstrap: "src/hubspot/bootstrap.ts",
|
|
74
|
+
module: "src/hubspot/module-entry.tsx",
|
|
75
|
+
localDev: "src/main.tsx"
|
|
76
|
+
},
|
|
77
|
+
env: {
|
|
78
|
+
tiers: ["dev", "stg", "prod"]
|
|
79
|
+
},
|
|
80
|
+
dev: {
|
|
81
|
+
moduleConfigDir: WPHS_WORKSPACE_DIR,
|
|
82
|
+
adapter: "./wphs.adapter.ts",
|
|
83
|
+
fieldsJson: "public/fields.json"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
function isModuleProject(config) {
|
|
87
|
+
return config.projectType === "module-hybrid-cdn" || config.projectType === "module-monolith";
|
|
88
|
+
}
|
|
89
|
+
function isThemeProject(config) {
|
|
90
|
+
return config.projectType === "theme-starter";
|
|
91
|
+
}
|
|
92
|
+
function usesCdnPipeline(config) {
|
|
93
|
+
return config.projectType === "module-hybrid-cdn" && config.cdn.mode !== "none";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/lib/paths.ts
|
|
97
|
+
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
98
|
+
import { dirname, resolve as resolve2 } from "path";
|
|
99
|
+
import { fileURLToPath } from "url";
|
|
100
|
+
|
|
101
|
+
// src/lib/config-files.ts
|
|
102
|
+
import { existsSync } from "fs";
|
|
103
|
+
import { resolve } from "path";
|
|
104
|
+
var WOODSCLI_CONFIG_FILE = "woodscli.json";
|
|
105
|
+
var LEGACY_WOODSPORTAL_HS_FILE = "woodsportal.hs.json";
|
|
106
|
+
function envConfigPath(projectRoot) {
|
|
107
|
+
const fromEnv = process.env.WOODSCLI_CONFIG?.trim() || process.env.WP_HS_CONFIG?.trim() || null;
|
|
108
|
+
if (!fromEnv) return null;
|
|
109
|
+
return resolve(projectRoot, fromEnv);
|
|
110
|
+
}
|
|
111
|
+
function legacyConfigPath(projectRoot) {
|
|
112
|
+
return resolve(projectRoot, LEGACY_WOODSPORTAL_HS_FILE);
|
|
113
|
+
}
|
|
114
|
+
function woodscliConfigPath(projectRoot) {
|
|
115
|
+
return resolve(projectRoot, WOODSCLI_CONFIG_FILE);
|
|
116
|
+
}
|
|
117
|
+
function legacyConfigConflict(projectRoot) {
|
|
118
|
+
const hasWoodscli = existsSync(woodscliConfigPath(projectRoot));
|
|
119
|
+
const hasLegacy = existsSync(legacyConfigPath(projectRoot));
|
|
120
|
+
if (hasLegacy && hasWoodscli) return "duplicate";
|
|
121
|
+
if (hasLegacy && !hasWoodscli) return "legacy-only";
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
function resolveProjectConfig(projectRoot) {
|
|
125
|
+
const envPath = envConfigPath(projectRoot);
|
|
126
|
+
if (envPath) {
|
|
127
|
+
if (!existsSync(envPath)) return null;
|
|
128
|
+
return { path: envPath, fileName: WOODSCLI_CONFIG_FILE };
|
|
129
|
+
}
|
|
130
|
+
const path = woodscliConfigPath(projectRoot);
|
|
131
|
+
if (existsSync(path)) {
|
|
132
|
+
return { path, fileName: WOODSCLI_CONFIG_FILE };
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
function findProjectRoot(from = process.cwd()) {
|
|
137
|
+
if (process.env.WP_HS_PROJECT_ROOT?.trim()) {
|
|
138
|
+
return resolve(process.env.WP_HS_PROJECT_ROOT.trim());
|
|
139
|
+
}
|
|
140
|
+
let dir = resolve(from);
|
|
141
|
+
while (true) {
|
|
142
|
+
if (resolveProjectConfig(dir)) {
|
|
143
|
+
return dir;
|
|
144
|
+
}
|
|
145
|
+
const parent = resolve(dir, "..");
|
|
146
|
+
if (parent === dir) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
dir = parent;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// src/lib/paths.ts
|
|
154
|
+
var KIT_PACKAGE_NAME = "@woodsportal/hubspot-kit";
|
|
155
|
+
function resolveKitRoot() {
|
|
156
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
157
|
+
while (true) {
|
|
158
|
+
const pkgPath = resolve2(dir, "package.json");
|
|
159
|
+
if (existsSync2(pkgPath)) {
|
|
160
|
+
try {
|
|
161
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
162
|
+
if (pkg.name === KIT_PACKAGE_NAME) {
|
|
163
|
+
return dir;
|
|
164
|
+
}
|
|
165
|
+
} catch {
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const parent = dirname(dir);
|
|
169
|
+
if (parent === dir) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
dir = parent;
|
|
173
|
+
}
|
|
174
|
+
throw new WpHsError("Could not resolve @woodsportal/hubspot-kit package root.", {
|
|
175
|
+
exitCode: ExitCode.INTERNAL
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
var kitRoot = resolveKitRoot();
|
|
179
|
+
function getKitRoot() {
|
|
180
|
+
return kitRoot;
|
|
181
|
+
}
|
|
182
|
+
function findProjectRoot2(from = process.cwd()) {
|
|
183
|
+
const resolved = findProjectRoot(from);
|
|
184
|
+
if (!resolved) {
|
|
185
|
+
throw new WpHsError("Could not find woodscli.json in this directory or any parent.", {
|
|
186
|
+
exitCode: ExitCode.USER_ERROR,
|
|
187
|
+
remediation: "Run wp init, or pass --project <path>. Legacy config: wp migrate --yes."
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return resolved;
|
|
191
|
+
}
|
|
192
|
+
function kitPath(...segments) {
|
|
193
|
+
return resolve2(kitRoot, ...segments);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// src/lib/regenerate-route-tree.ts
|
|
197
|
+
function regenerateRouteTree(projectRoot, options = {}) {
|
|
198
|
+
const { logger, dryRun = false } = options;
|
|
199
|
+
if (dryRun) {
|
|
200
|
+
logger?.info("[dry-run] Would regenerate src/routeTree.gen.ts");
|
|
201
|
+
return { ok: true };
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
const { status, stderr } = runCommand(
|
|
205
|
+
process.execPath,
|
|
206
|
+
[kitPath("scripts/regenerate-route-tree.mjs"), projectRoot],
|
|
207
|
+
{
|
|
208
|
+
cwd: projectRoot,
|
|
209
|
+
logger,
|
|
210
|
+
okCodes: [0, 1]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
if (status === 0) {
|
|
214
|
+
return { ok: true };
|
|
215
|
+
}
|
|
216
|
+
const warning = stderr.trim() || "Could not regenerate routeTree.gen.ts automatically. Restart wp dev to refresh the route tree.";
|
|
217
|
+
return { ok: false, warning };
|
|
218
|
+
} catch (error) {
|
|
219
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
220
|
+
return {
|
|
221
|
+
ok: false,
|
|
222
|
+
warning: `${message} Restart wp dev to refresh the route tree.`
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/lib/project-nav-config.ts
|
|
228
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
229
|
+
import { resolve as resolve3 } from "path";
|
|
230
|
+
function resolveProjectNavConfig(projectRoot) {
|
|
231
|
+
const portalNav = resolve3(projectRoot, "src/config/portal-nav.ts");
|
|
232
|
+
if (existsSync3(portalNav)) {
|
|
233
|
+
return {
|
|
234
|
+
kind: "portal",
|
|
235
|
+
filePath: portalNav,
|
|
236
|
+
relativePath: "src/config/portal-nav.ts",
|
|
237
|
+
arrayName: "portalNavItems",
|
|
238
|
+
supportsRequiresAuth: true
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
const starterNav = resolve3(projectRoot, "src/config/starter-nav.ts");
|
|
242
|
+
if (existsSync3(starterNav)) {
|
|
243
|
+
return {
|
|
244
|
+
kind: "starter",
|
|
245
|
+
filePath: starterNav,
|
|
246
|
+
relativePath: "src/config/starter-nav.ts",
|
|
247
|
+
arrayName: "starterNavItems",
|
|
248
|
+
supportsRequiresAuth: false
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
function navConfigFileExists(projectRoot) {
|
|
254
|
+
return resolveProjectNavConfig(projectRoot) !== null;
|
|
255
|
+
}
|
|
256
|
+
function readRoutesExportName(routesFile) {
|
|
257
|
+
const content = readFileSync2(routesFile, "utf8");
|
|
258
|
+
if (content.includes("export const Routes")) {
|
|
259
|
+
return "Routes";
|
|
260
|
+
}
|
|
261
|
+
if (content.includes("export const ROUTES")) {
|
|
262
|
+
return "ROUTES";
|
|
263
|
+
}
|
|
264
|
+
throw new WpHsError("Could not detect Routes export in src/config/routes.ts", {
|
|
265
|
+
exitCode: ExitCode.USER_ERROR,
|
|
266
|
+
remediation: "Add export const Routes = { ... } or edit routes manually."
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function patchNavItemsFile(navConfig, routesExport, routesKey, label, requiresAuth) {
|
|
270
|
+
const content = readFileSync2(navConfig.filePath, "utf8");
|
|
271
|
+
const escapedLabel = label.replace(/'/g, "\\'");
|
|
272
|
+
const insertLine = navConfig.supportsRequiresAuth ? ` { to: ${routesExport}.${routesKey}, label: '${escapedLabel}', requiresAuth: ${requiresAuth} },` : ` { to: ${routesExport}.${routesKey}, label: '${escapedLabel}' },`;
|
|
273
|
+
const closing = content.lastIndexOf("] as const");
|
|
274
|
+
if (closing === -1) {
|
|
275
|
+
throw new WpHsError(`Could not patch ${navConfig.relativePath} \u2014 expected \`] as const\` closing.`, {
|
|
276
|
+
exitCode: ExitCode.USER_ERROR
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const updated = `${content.slice(0, closing).trimEnd()}
|
|
280
|
+
${insertLine}
|
|
281
|
+
${content.slice(closing)}`;
|
|
282
|
+
writeFileSync(navConfig.filePath, updated);
|
|
283
|
+
}
|
|
284
|
+
function removeNavItemsEntry(navConfig, routesKey) {
|
|
285
|
+
const content = readFileSync2(navConfig.filePath, "utf8");
|
|
286
|
+
const linePattern = new RegExp(
|
|
287
|
+
`^\\s*\\{[^\\n]*${routesExportPattern(routesKey)}[^\\n]*\\},?\\n`,
|
|
288
|
+
"m"
|
|
289
|
+
);
|
|
290
|
+
const updated = content.replace(linePattern, "");
|
|
291
|
+
if (updated === content) {
|
|
292
|
+
throw new WpHsError(`Nav entry for "${routesKey}" not found in ${navConfig.relativePath}.`, {
|
|
293
|
+
exitCode: ExitCode.USER_ERROR
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
writeFileSync(navConfig.filePath, updated);
|
|
297
|
+
}
|
|
298
|
+
function routesExportPattern(routesKey) {
|
|
299
|
+
return `\\.${routesKey}\\b`;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// src/lib/scaffold-page.ts
|
|
303
|
+
import { existsSync as existsSync4, mkdirSync, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
304
|
+
import { resolve as resolve4 } from "path";
|
|
305
|
+
var RESERVED_PATHS = /* @__PURE__ */ new Set([
|
|
306
|
+
"/",
|
|
307
|
+
"/login",
|
|
308
|
+
"/two-fa",
|
|
309
|
+
"/unauthorized",
|
|
310
|
+
"/login/sso",
|
|
311
|
+
"/portal",
|
|
312
|
+
"/guide"
|
|
313
|
+
]);
|
|
314
|
+
var PAGE_TEMPLATE_ROOT = kitPath("templates", "scaffold", "page");
|
|
315
|
+
function readTemplate(name) {
|
|
316
|
+
const filePath = resolve4(PAGE_TEMPLATE_ROOT, name);
|
|
317
|
+
if (!existsSync4(filePath)) {
|
|
318
|
+
throw new WpHsError(`Page scaffold template not found: ${name}`, {
|
|
319
|
+
exitCode: ExitCode.INTERNAL
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
return readFileSync3(filePath, "utf8");
|
|
323
|
+
}
|
|
324
|
+
function renderTemplate(template, values) {
|
|
325
|
+
return Object.entries(values).reduce(
|
|
326
|
+
(content, [key, value]) => content.replaceAll(`{{${key}}}`, value),
|
|
327
|
+
template
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
function normalizePageSlug(raw) {
|
|
331
|
+
return raw.trim().toLowerCase().replace(/^\/+/, "").replace(/\/+$/, "").replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
332
|
+
}
|
|
333
|
+
function slugToCamelCase(slug) {
|
|
334
|
+
return slug.split("-").filter(Boolean).map(
|
|
335
|
+
(part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)
|
|
336
|
+
).join("");
|
|
337
|
+
}
|
|
338
|
+
function slugToPascalCase(slug) {
|
|
339
|
+
const camel = slugToCamelCase(slug);
|
|
340
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
341
|
+
}
|
|
342
|
+
function titleFromSlug(slug) {
|
|
343
|
+
return slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
344
|
+
}
|
|
345
|
+
function normalizePagePath(rawPath, slug) {
|
|
346
|
+
const trimmed = rawPath.trim() || `/${slug}`;
|
|
347
|
+
const withLeading = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
348
|
+
return withLeading.replace(/\/+$/, "") || `/${slug}`;
|
|
349
|
+
}
|
|
350
|
+
function validateScaffoldPageInput(input) {
|
|
351
|
+
const { config, projectRoot } = input;
|
|
352
|
+
if (isThemeProject(config)) {
|
|
353
|
+
throw new WpHsError("wp page add is only supported for module projects.", {
|
|
354
|
+
exitCode: ExitCode.USER_ERROR,
|
|
355
|
+
remediation: "Use module-hybrid-cdn or module-monolith with router \u2260 none."
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
if (!isModuleProject(config)) {
|
|
359
|
+
throw new WpHsError("wp page add requires a module project.", {
|
|
360
|
+
exitCode: ExitCode.USER_ERROR
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const routerMode = config.scaffold?.router ?? "hash";
|
|
364
|
+
if (routerMode === "none") {
|
|
365
|
+
throw new WpHsError("wp page add requires client-side routing.", {
|
|
366
|
+
exitCode: ExitCode.USER_ERROR,
|
|
367
|
+
remediation: "Re-init with --router hash or add routes manually for single-page modules."
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
const slug = normalizePageSlug(input.slug);
|
|
371
|
+
if (!slug || !/^[a-z][a-z0-9-]*$/.test(slug)) {
|
|
372
|
+
throw new WpHsError(`Invalid page slug: "${input.slug}"`, {
|
|
373
|
+
exitCode: ExitCode.USER_ERROR,
|
|
374
|
+
remediation: "Use lowercase letters, numbers, and hyphens (e.g. settings, billing)."
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
const path = normalizePagePath(input.path, slug);
|
|
378
|
+
if (RESERVED_PATHS.has(path)) {
|
|
379
|
+
throw new WpHsError(`Route path "${path}" is reserved.`, {
|
|
380
|
+
exitCode: ExitCode.USER_ERROR,
|
|
381
|
+
remediation: "Choose a different path or edit the existing route manually."
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const auth = config.scaffold?.auth ?? "none";
|
|
385
|
+
if (input.access === "protected" && auth === "none") {
|
|
386
|
+
throw new WpHsError("Protected pages require portal auth scaffold.", {
|
|
387
|
+
exitCode: ExitCode.USER_ERROR,
|
|
388
|
+
remediation: "Re-init with --auth starter|sso|full or scaffold a public page with --public."
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
const routesKey = slugToCamelCase(slug);
|
|
392
|
+
const componentName = `${slugToPascalCase(slug)}Page`;
|
|
393
|
+
const routeId = input.access === "protected" ? `/_app/${slug}` : `/${slug}`;
|
|
394
|
+
const routeFile = input.access === "protected" ? resolve4(projectRoot, "src/routes/_app", `${slug}.tsx`) : resolve4(projectRoot, "src/routes", `${slug}.tsx`);
|
|
395
|
+
if (existsSync4(routeFile)) {
|
|
396
|
+
throw new WpHsError(`Route file already exists: ${routeFile.replace(projectRoot, ".")}`, {
|
|
397
|
+
exitCode: ExitCode.USER_ERROR
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
const routesConfig = resolveRoutesConfigPath(projectRoot);
|
|
401
|
+
if (routesConfig && routesKeyExists(routesConfig, routesKey)) {
|
|
402
|
+
throw new WpHsError(`Routes key "${routesKey}" already exists in ${routesConfig.replace(projectRoot, ".")}`, {
|
|
403
|
+
exitCode: ExitCode.USER_ERROR
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
return {
|
|
407
|
+
slug,
|
|
408
|
+
path,
|
|
409
|
+
routesKey,
|
|
410
|
+
componentName,
|
|
411
|
+
routeId,
|
|
412
|
+
hasAuth: auth !== "none"
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
function resolveRoutesConfigPath(projectRoot) {
|
|
416
|
+
const routesTs = resolve4(projectRoot, "src/config/routes.ts");
|
|
417
|
+
return existsSync4(routesTs) ? routesTs : null;
|
|
418
|
+
}
|
|
419
|
+
function readRoutesExportNameFromProject(routesFile) {
|
|
420
|
+
return readRoutesExportName(routesFile);
|
|
421
|
+
}
|
|
422
|
+
function routesKeyExists(routesFile, key) {
|
|
423
|
+
const content = readFileSync3(routesFile, "utf8");
|
|
424
|
+
const pattern = new RegExp(`\\b${key}\\s*:`);
|
|
425
|
+
return pattern.test(content);
|
|
426
|
+
}
|
|
427
|
+
function patchRoutesFile(routesFile, routesKey, path) {
|
|
428
|
+
const content = readFileSync3(routesFile, "utf8");
|
|
429
|
+
const insertLine = ` ${routesKey}: '${path}',`;
|
|
430
|
+
if (routesKeyExists(routesFile, routesKey)) {
|
|
431
|
+
throw new WpHsError(`Routes key "${routesKey}" already exists.`, { exitCode: ExitCode.USER_ERROR });
|
|
432
|
+
}
|
|
433
|
+
const closing = content.lastIndexOf("} as const");
|
|
434
|
+
if (closing === -1) {
|
|
435
|
+
throw new WpHsError("Could not patch src/config/routes.ts \u2014 expected `} as const` closing.", {
|
|
436
|
+
exitCode: ExitCode.USER_ERROR
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
const updated = `${content.slice(0, closing).trimEnd()}
|
|
440
|
+
${insertLine}
|
|
441
|
+
${content.slice(closing)}`;
|
|
442
|
+
writeFileSync2(routesFile, updated);
|
|
443
|
+
}
|
|
444
|
+
function ensurePagesBarrel(projectRoot, slug, componentName) {
|
|
445
|
+
const pagesDir = resolve4(projectRoot, "src/features/pages");
|
|
446
|
+
const barrelPath = resolve4(pagesDir, "index.ts");
|
|
447
|
+
const exportLine = `export { ${componentName} } from './${slug}-page'
|
|
448
|
+
`;
|
|
449
|
+
if (!existsSync4(barrelPath)) {
|
|
450
|
+
writeFileSync2(barrelPath, exportLine);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
const content = readFileSync3(barrelPath, "utf8");
|
|
454
|
+
if (!content.includes(exportLine.trim())) {
|
|
455
|
+
writeFileSync2(barrelPath, `${content.trimEnd()}
|
|
456
|
+
${exportLine}`);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
async function scaffoldPage(input) {
|
|
460
|
+
const validated = validateScaffoldPageInput(input);
|
|
461
|
+
const { projectRoot, access, addToNav, dryRun, logger } = input;
|
|
462
|
+
const { slug, path, routesKey, componentName, routeId, hasAuth } = validated;
|
|
463
|
+
const routeTemplate = access === "protected" ? "route-protected-auth.tsx.tpl" : hasAuth ? "route-public-auth.tsx.tpl" : "route-public-plain.tsx.tpl";
|
|
464
|
+
const pageTemplate = hasAuth ? "page-component-auth.tsx.tpl" : "page-component-plain.tsx.tpl";
|
|
465
|
+
const templateValues = {
|
|
466
|
+
slug,
|
|
467
|
+
componentName,
|
|
468
|
+
routeId,
|
|
469
|
+
title: input.title
|
|
470
|
+
};
|
|
471
|
+
const routeRelative = access === "protected" ? `src/routes/_app/${slug}.tsx` : `src/routes/${slug}.tsx`;
|
|
472
|
+
const pageRelative = `src/features/pages/${slug}-page.tsx`;
|
|
473
|
+
const routeFile = resolve4(projectRoot, routeRelative);
|
|
474
|
+
const pageFile = resolve4(projectRoot, pageRelative);
|
|
475
|
+
const routeContent = renderTemplate(readTemplate(routeTemplate), templateValues);
|
|
476
|
+
const pageContent = renderTemplate(readTemplate(pageTemplate), templateValues);
|
|
477
|
+
if (dryRun) {
|
|
478
|
+
logger?.info(`[dry-run] Would create ${routeRelative}`);
|
|
479
|
+
logger?.info(`[dry-run] Would create ${pageRelative}`);
|
|
480
|
+
return {
|
|
481
|
+
routeFile: routeRelative,
|
|
482
|
+
pageFile: pageRelative,
|
|
483
|
+
routesKey,
|
|
484
|
+
routeTreeRegenerated: false
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
if (access === "protected") {
|
|
488
|
+
mkdirSync(resolve4(projectRoot, "src/routes/_app"), { recursive: true });
|
|
489
|
+
}
|
|
490
|
+
mkdirSync(resolve4(projectRoot, "src/features/pages"), { recursive: true });
|
|
491
|
+
writeFileSync2(routeFile, routeContent);
|
|
492
|
+
writeFileSync2(pageFile, pageContent);
|
|
493
|
+
ensurePagesBarrel(projectRoot, slug, componentName);
|
|
494
|
+
const routesConfig = resolveRoutesConfigPath(projectRoot);
|
|
495
|
+
if (routesConfig) {
|
|
496
|
+
patchRoutesFile(routesConfig, routesKey, path);
|
|
497
|
+
}
|
|
498
|
+
const navConfig = resolveProjectNavConfig(projectRoot);
|
|
499
|
+
if (addToNav) {
|
|
500
|
+
if (!navConfig) {
|
|
501
|
+
logger?.warn("No portal-nav.ts or starter-nav.ts found \u2014 skipping navigation link.");
|
|
502
|
+
} else if (routesConfig) {
|
|
503
|
+
const routesExport = readRoutesExportNameFromProject(routesConfig);
|
|
504
|
+
patchNavItemsFile(
|
|
505
|
+
navConfig,
|
|
506
|
+
routesExport,
|
|
507
|
+
routesKey,
|
|
508
|
+
input.title,
|
|
509
|
+
access === "protected"
|
|
510
|
+
);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
const regen = regenerateRouteTree(projectRoot, { logger, dryRun });
|
|
514
|
+
const routeTreeRegenerated = regen.ok;
|
|
515
|
+
const routeTreeWarning = regen.warning;
|
|
516
|
+
if (routeTreeWarning) {
|
|
517
|
+
logger?.warn(routeTreeWarning);
|
|
518
|
+
}
|
|
519
|
+
return {
|
|
520
|
+
routeFile: routeRelative,
|
|
521
|
+
pageFile: pageRelative,
|
|
522
|
+
routesKey,
|
|
523
|
+
routeTreeRegenerated,
|
|
524
|
+
routeTreeWarning
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export {
|
|
529
|
+
WOODSCLI_CONFIG_FILE,
|
|
530
|
+
LEGACY_WOODSPORTAL_HS_FILE,
|
|
531
|
+
legacyConfigConflict,
|
|
532
|
+
resolveProjectConfig,
|
|
533
|
+
WPHS_WORKSPACE_DIR,
|
|
534
|
+
WoodsPortalHsSchema,
|
|
535
|
+
DEFAULT_WOODSPORTAL_HS,
|
|
536
|
+
isModuleProject,
|
|
537
|
+
isThemeProject,
|
|
538
|
+
usesCdnPipeline,
|
|
539
|
+
KIT_PACKAGE_NAME,
|
|
540
|
+
getKitRoot,
|
|
541
|
+
findProjectRoot2 as findProjectRoot,
|
|
542
|
+
kitPath,
|
|
543
|
+
regenerateRouteTree,
|
|
544
|
+
resolveProjectNavConfig,
|
|
545
|
+
navConfigFileExists,
|
|
546
|
+
removeNavItemsEntry,
|
|
547
|
+
normalizePageSlug,
|
|
548
|
+
slugToCamelCase,
|
|
549
|
+
slugToPascalCase,
|
|
550
|
+
titleFromSlug,
|
|
551
|
+
normalizePagePath,
|
|
552
|
+
scaffoldPage
|
|
553
|
+
};
|
|
554
|
+
//# sourceMappingURL=chunk-WHYTQEZX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema/woodsportal-hs.ts","../src/lib/paths.ts","../src/lib/config-files.ts","../src/lib/regenerate-route-tree.ts","../src/lib/project-nav-config.ts","../src/lib/scaffold-page.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const CONFIG_VERSION = 1\n\nexport const WPHS_WORKSPACE_DIR = '.wphs' as const\n\nexport const WoodsPortalHsSchema = z.object({\n configVersion: z.number().int().default(CONFIG_VERSION),\n projectType: z.enum(['module-hybrid-cdn', 'module-monolith', 'theme-starter']),\n module: z.object({\n name: z.string().min(1),\n uploadPath: z.string().min(1),\n outDir: z.string().default('dist/WoodsPortal.Module'),\n }),\n theme: z\n .object({\n name: z.string().min(1),\n uploadPath: z.string().min(1),\n srcDir: z.string().default('src/theme'),\n themeJson: z.string().default('src/theme/theme.json'),\n })\n .optional(),\n cdn: z\n .object({\n mode: z.enum(['jsdelivr', 'custom', 'local', 'none']).default('jsdelivr'),\n buildIdFile: z.string().default('.module-build-id'),\n mirror: z.string().default('portal.cdn.json'),\n })\n .default({}),\n entries: z\n .object({\n app: z.string().default('src/cdn/app-entry.ts'),\n vendor: z.string().default('src/cdn/vendor-entry.ts'),\n hubspotBootstrap: z.string().default('src/hubspot/bootstrap.ts'),\n /** Monolith production IIFE entry (wp build --hubspot-only) */\n module: z.string().default('src/hubspot/module-entry.tsx'),\n localDev: z.string().default('src/main.tsx'),\n })\n .default({}),\n env: z\n .object({\n tiers: z.array(z.enum(['dev', 'stg', 'prod'])).default(['dev', 'stg', 'prod']),\n })\n .default({}),\n dev: z\n .object({\n moduleConfigDir: z.literal(WPHS_WORKSPACE_DIR).default(WPHS_WORKSPACE_DIR),\n adapter: z.string().default('./wphs.adapter.ts'),\n fieldsJson: z.string().default('public/fields.json'),\n themeFieldsJson: z.string().optional(),\n })\n .default({}),\n scaffold: z\n .object({\n /** hash = woodsportal-client-frontend (HubSpot CMS); browser = local clean URLs; none = single page */\n router: z.enum(['hash', 'browser', 'none']).default('hash'),\n /** Portal user auth tier (module templates only) */\n auth: z.enum(['none', 'starter', 'sso', 'full']).default('none'),\n /** Authenticated shell navigation — only when auth ≠ none */\n nav: z.enum(['top', 'sidebar']).default('top').optional(),\n })\n .optional(),\n})\n\nexport type WoodsPortalHsConfig = z.infer<typeof WoodsPortalHsSchema>\n\nexport const DEFAULT_WOODSPORTAL_HS: WoodsPortalHsConfig = {\n configVersion: CONFIG_VERSION,\n projectType: 'module-hybrid-cdn',\n module: {\n name: 'woodsportal-module',\n uploadPath: 'dw-modules/woodsportal-module.module',\n outDir: 'dist/WoodsPortal.Module',\n },\n cdn: {\n mode: 'jsdelivr',\n buildIdFile: '.module-build-id',\n mirror: 'portal.cdn.json',\n },\n entries: {\n app: 'src/cdn/app-entry.ts',\n vendor: 'src/cdn/vendor-entry.ts',\n hubspotBootstrap: 'src/hubspot/bootstrap.ts',\n module: 'src/hubspot/module-entry.tsx',\n localDev: 'src/main.tsx',\n },\n env: {\n tiers: ['dev', 'stg', 'prod'],\n },\n dev: {\n moduleConfigDir: WPHS_WORKSPACE_DIR,\n adapter: './wphs.adapter.ts',\n fieldsJson: 'public/fields.json',\n },\n}\n\nexport function isModuleProject(config: WoodsPortalHsConfig): boolean {\n return config.projectType === 'module-hybrid-cdn' || config.projectType === 'module-monolith'\n}\n\nexport function isThemeProject(config: WoodsPortalHsConfig): boolean {\n return config.projectType === 'theme-starter'\n}\n\nexport function usesCdnPipeline(config: WoodsPortalHsConfig): boolean {\n return config.projectType === 'module-hybrid-cdn' && config.cdn.mode !== 'none'\n}\n","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","import { runCommand } from './exec.js'\nimport { kitPath } from './paths.js'\nimport type { Logger } from './logger.js'\n\nexport type RegenerateRouteTreeResult = {\n ok: boolean\n warning?: string\n}\n\nexport function regenerateRouteTree(\n projectRoot: string,\n options: { logger?: Logger; dryRun?: boolean } = {},\n): RegenerateRouteTreeResult {\n const { logger, dryRun = false } = options\n\n if (dryRun) {\n logger?.info('[dry-run] Would regenerate src/routeTree.gen.ts')\n return { ok: true }\n }\n\n try {\n const { status, stderr } = runCommand(\n process.execPath,\n [kitPath('scripts/regenerate-route-tree.mjs'), projectRoot],\n {\n cwd: projectRoot,\n logger,\n okCodes: [0, 1],\n },\n )\n\n if (status === 0) {\n return { ok: true }\n }\n\n const warning =\n stderr.trim() ||\n 'Could not regenerate routeTree.gen.ts automatically. Restart wp dev to refresh the route tree.'\n return { ok: false, warning }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n warning: `${message} Restart wp dev to refresh the route tree.`,\n }\n }\n}\n","import { existsSync, readFileSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nimport { ExitCode, WpHsError } from './errors.js'\n\nexport type ProjectNavKind = 'portal' | 'starter'\n\nexport type ProjectNavConfig = {\n kind: ProjectNavKind\n filePath: string\n relativePath: string\n arrayName: 'portalNavItems' | 'starterNavItems'\n supportsRequiresAuth: boolean\n}\n\nexport function resolveProjectNavConfig(projectRoot: string): ProjectNavConfig | null {\n const portalNav = resolve(projectRoot, 'src/config/portal-nav.ts')\n if (existsSync(portalNav)) {\n return {\n kind: 'portal',\n filePath: portalNav,\n relativePath: 'src/config/portal-nav.ts',\n arrayName: 'portalNavItems',\n supportsRequiresAuth: true,\n }\n }\n\n const starterNav = resolve(projectRoot, 'src/config/starter-nav.ts')\n if (existsSync(starterNav)) {\n return {\n kind: 'starter',\n filePath: starterNav,\n relativePath: 'src/config/starter-nav.ts',\n arrayName: 'starterNavItems',\n supportsRequiresAuth: false,\n }\n }\n\n return null\n}\n\nexport function navConfigFileExists(projectRoot: string): boolean {\n return resolveProjectNavConfig(projectRoot) !== null\n}\n\nexport function readRoutesExportName(routesFile: string): string {\n const content = readFileSync(routesFile, 'utf8')\n if (content.includes('export const Routes')) {\n return 'Routes'\n }\n if (content.includes('export const ROUTES')) {\n return 'ROUTES'\n }\n throw new WpHsError('Could not detect Routes export in src/config/routes.ts', {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Add export const Routes = { ... } or edit routes manually.',\n })\n}\n\nexport function patchNavItemsFile(\n navConfig: ProjectNavConfig,\n routesExport: string,\n routesKey: string,\n label: string,\n requiresAuth: boolean,\n): void {\n const content = readFileSync(navConfig.filePath, 'utf8')\n const escapedLabel = label.replace(/'/g, \"\\\\'\")\n const insertLine = navConfig.supportsRequiresAuth\n ? ` { to: ${routesExport}.${routesKey}, label: '${escapedLabel}', requiresAuth: ${requiresAuth} },`\n : ` { to: ${routesExport}.${routesKey}, label: '${escapedLabel}' },`\n\n const closing = content.lastIndexOf('] as const')\n if (closing === -1) {\n throw new WpHsError(`Could not patch ${navConfig.relativePath} — expected \\`] as const\\` closing.`, {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n\n const updated = `${content.slice(0, closing).trimEnd()}\\n${insertLine}\\n${content.slice(closing)}`\n writeFileSync(navConfig.filePath, updated)\n}\n\nexport function removeNavItemsEntry(navConfig: ProjectNavConfig, routesKey: string): void {\n const content = readFileSync(navConfig.filePath, 'utf8')\n const linePattern = new RegExp(\n `^\\\\s*\\\\{[^\\\\n]*${routesExportPattern(routesKey)}[^\\\\n]*\\\\},?\\\\n`,\n 'm',\n )\n const updated = content.replace(linePattern, '')\n if (updated === content) {\n throw new WpHsError(`Nav entry for \"${routesKey}\" not found in ${navConfig.relativePath}.`, {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n writeFileSync(navConfig.filePath, updated)\n}\n\nfunction routesExportPattern(routesKey: string): string {\n return `\\\\.${routesKey}\\\\b`\n}\n","import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\nimport type { WoodsPortalHsConfig } from '../schema/woodsportal-hs.js'\nimport { isModuleProject, isThemeProject } from '../schema/woodsportal-hs.js'\nimport { ExitCode, WpHsError } from './errors.js'\nimport { kitPath } from './paths.js'\nimport type { Logger } from './logger.js'\nimport { regenerateRouteTree } from './regenerate-route-tree.js'\nimport {\n patchNavItemsFile,\n readRoutesExportName,\n resolveProjectNavConfig,\n} from './project-nav-config.js'\n\nexport type PageAccess = 'public' | 'protected'\n\nexport type ScaffoldPageInput = {\n projectRoot: string\n config: WoodsPortalHsConfig\n slug: string\n path: string\n title: string\n access: PageAccess\n addToNav: boolean\n dryRun?: boolean\n logger?: Logger\n}\n\nexport type ScaffoldPageResult = {\n routeFile: string\n pageFile: string\n routesKey: string\n routeTreeRegenerated: boolean\n routeTreeWarning?: string\n}\n\nconst RESERVED_PATHS = new Set([\n '/',\n '/login',\n '/two-fa',\n '/unauthorized',\n '/login/sso',\n '/portal',\n '/guide',\n])\n\nconst PAGE_TEMPLATE_ROOT = kitPath('templates', 'scaffold', 'page')\n\nfunction readTemplate(name: string): string {\n const filePath = resolve(PAGE_TEMPLATE_ROOT, name)\n if (!existsSync(filePath)) {\n throw new WpHsError(`Page scaffold template not found: ${name}`, {\n exitCode: ExitCode.INTERNAL,\n })\n }\n return readFileSync(filePath, 'utf8')\n}\n\nfunction renderTemplate(template: string, values: Record<string, string>): string {\n return Object.entries(values).reduce(\n (content, [key, value]) => content.replaceAll(`{{${key}}}`, value),\n template,\n )\n}\n\nexport function normalizePageSlug(raw: string): string {\n return raw\n .trim()\n .toLowerCase()\n .replace(/^\\/+/, '')\n .replace(/\\/+$/, '')\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n}\n\nexport function slugToCamelCase(slug: string): string {\n return slug\n .split('-')\n .filter(Boolean)\n .map((part, index) =>\n index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1),\n )\n .join('')\n}\n\nexport function slugToPascalCase(slug: string): string {\n const camel = slugToCamelCase(slug)\n return camel.charAt(0).toUpperCase() + camel.slice(1)\n}\n\nexport function titleFromSlug(slug: string): string {\n return slug\n .split('-')\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ')\n}\n\nexport function normalizePagePath(rawPath: string, slug: string): string {\n const trimmed = rawPath.trim() || `/${slug}`\n const withLeading = trimmed.startsWith('/') ? trimmed : `/${trimmed}`\n return withLeading.replace(/\\/+$/, '') || `/${slug}`\n}\n\nfunction validateScaffoldPageInput(input: ScaffoldPageInput): {\n slug: string\n path: string\n routesKey: string\n componentName: string\n routeId: string\n hasAuth: boolean\n} {\n const { config, projectRoot } = input\n\n if (isThemeProject(config)) {\n throw new WpHsError('wp page add is only supported for module projects.', {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Use module-hybrid-cdn or module-monolith with router ≠ none.',\n })\n }\n\n if (!isModuleProject(config)) {\n throw new WpHsError('wp page add requires a module project.', {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n\n const routerMode = config.scaffold?.router ?? 'hash'\n if (routerMode === 'none') {\n throw new WpHsError('wp page add requires client-side routing.', {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Re-init with --router hash or add routes manually for single-page modules.',\n })\n }\n\n const slug = normalizePageSlug(input.slug)\n if (!slug || !/^[a-z][a-z0-9-]*$/.test(slug)) {\n throw new WpHsError(`Invalid page slug: \"${input.slug}\"`, {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Use lowercase letters, numbers, and hyphens (e.g. settings, billing).',\n })\n }\n\n const path = normalizePagePath(input.path, slug)\n if (RESERVED_PATHS.has(path)) {\n throw new WpHsError(`Route path \"${path}\" is reserved.`, {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Choose a different path or edit the existing route manually.',\n })\n }\n\n const auth = config.scaffold?.auth ?? 'none'\n if (input.access === 'protected' && auth === 'none') {\n throw new WpHsError('Protected pages require portal auth scaffold.', {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Re-init with --auth starter|sso|full or scaffold a public page with --public.',\n })\n }\n\n const routesKey = slugToCamelCase(slug)\n const componentName = `${slugToPascalCase(slug)}Page`\n const routeId = input.access === 'protected' ? `/_app/${slug}` : `/${slug}`\n\n const routeFile =\n input.access === 'protected'\n ? resolve(projectRoot, 'src/routes/_app', `${slug}.tsx`)\n : resolve(projectRoot, 'src/routes', `${slug}.tsx`)\n\n if (existsSync(routeFile)) {\n throw new WpHsError(`Route file already exists: ${routeFile.replace(projectRoot, '.')}`, {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n\n const routesConfig = resolveRoutesConfigPath(projectRoot)\n if (routesConfig && routesKeyExists(routesConfig, routesKey)) {\n throw new WpHsError(`Routes key \"${routesKey}\" already exists in ${routesConfig.replace(projectRoot, '.')}`, {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n\n return {\n slug,\n path,\n routesKey,\n componentName,\n routeId,\n hasAuth: auth !== 'none',\n }\n}\n\nfunction resolveRoutesConfigPath(projectRoot: string): string | null {\n const routesTs = resolve(projectRoot, 'src/config/routes.ts')\n return existsSync(routesTs) ? routesTs : null\n}\n\nfunction readRoutesExportNameFromProject(routesFile: string): string {\n return readRoutesExportName(routesFile)\n}\n\nfunction routesKeyExists(routesFile: string, key: string): boolean {\n const content = readFileSync(routesFile, 'utf8')\n const pattern = new RegExp(`\\\\b${key}\\\\s*:`)\n return pattern.test(content)\n}\n\nfunction patchRoutesFile(routesFile: string, routesKey: string, path: string): void {\n const content = readFileSync(routesFile, 'utf8')\n const insertLine = ` ${routesKey}: '${path}',`\n if (routesKeyExists(routesFile, routesKey)) {\n throw new WpHsError(`Routes key \"${routesKey}\" already exists.`, { exitCode: ExitCode.USER_ERROR })\n }\n\n const closing = content.lastIndexOf('} as const')\n if (closing === -1) {\n throw new WpHsError('Could not patch src/config/routes.ts — expected `} as const` closing.', {\n exitCode: ExitCode.USER_ERROR,\n })\n }\n\n const updated = `${content.slice(0, closing).trimEnd()}\\n${insertLine}\\n${content.slice(closing)}`\n writeFileSync(routesFile, updated)\n}\n\nfunction ensurePagesBarrel(projectRoot: string, slug: string, componentName: string): void {\n const pagesDir = resolve(projectRoot, 'src/features/pages')\n const barrelPath = resolve(pagesDir, 'index.ts')\n const exportLine = `export { ${componentName} } from './${slug}-page'\\n`\n\n if (!existsSync(barrelPath)) {\n writeFileSync(barrelPath, exportLine)\n return\n }\n\n const content = readFileSync(barrelPath, 'utf8')\n if (!content.includes(exportLine.trim())) {\n writeFileSync(barrelPath, `${content.trimEnd()}\\n${exportLine}`)\n }\n}\n\nexport async function scaffoldPage(input: ScaffoldPageInput): Promise<ScaffoldPageResult> {\n const validated = validateScaffoldPageInput(input)\n const { projectRoot, access, addToNav, dryRun, logger } = input\n const { slug, path, routesKey, componentName, routeId, hasAuth } = validated\n\n const routeTemplate =\n access === 'protected'\n ? 'route-protected-auth.tsx.tpl'\n : hasAuth\n ? 'route-public-auth.tsx.tpl'\n : 'route-public-plain.tsx.tpl'\n\n const pageTemplate = hasAuth ? 'page-component-auth.tsx.tpl' : 'page-component-plain.tsx.tpl'\n\n const templateValues = {\n slug,\n componentName,\n routeId,\n title: input.title,\n }\n\n const routeRelative =\n access === 'protected' ? `src/routes/_app/${slug}.tsx` : `src/routes/${slug}.tsx`\n const pageRelative = `src/features/pages/${slug}-page.tsx`\n const routeFile = resolve(projectRoot, routeRelative)\n const pageFile = resolve(projectRoot, pageRelative)\n\n const routeContent = renderTemplate(readTemplate(routeTemplate), templateValues)\n const pageContent = renderTemplate(readTemplate(pageTemplate), templateValues)\n\n if (dryRun) {\n logger?.info(`[dry-run] Would create ${routeRelative}`)\n logger?.info(`[dry-run] Would create ${pageRelative}`)\n return {\n routeFile: routeRelative,\n pageFile: pageRelative,\n routesKey,\n routeTreeRegenerated: false,\n }\n }\n\n if (access === 'protected') {\n mkdirSync(resolve(projectRoot, 'src/routes/_app'), { recursive: true })\n }\n\n mkdirSync(resolve(projectRoot, 'src/features/pages'), { recursive: true })\n writeFileSync(routeFile, routeContent)\n writeFileSync(pageFile, pageContent)\n ensurePagesBarrel(projectRoot, slug, componentName)\n\n const routesConfig = resolveRoutesConfigPath(projectRoot)\n if (routesConfig) {\n patchRoutesFile(routesConfig, routesKey, path)\n }\n\n const navConfig = resolveProjectNavConfig(projectRoot)\n if (addToNav) {\n if (!navConfig) {\n logger?.warn('No portal-nav.ts or starter-nav.ts found — skipping navigation link.')\n } else if (routesConfig) {\n const routesExport = readRoutesExportNameFromProject(routesConfig)\n patchNavItemsFile(\n navConfig,\n routesExport,\n routesKey,\n input.title,\n access === 'protected',\n )\n }\n }\n\n const regen = regenerateRouteTree(projectRoot, { logger, dryRun })\n const routeTreeRegenerated = regen.ok\n const routeTreeWarning = regen.warning\n\n if (routeTreeWarning) {\n logger?.warn(routeTreeWarning)\n }\n\n return {\n routeFile: routeRelative,\n pageFile: pageRelative,\n routesKey,\n routeTreeRegenerated,\n routeTreeWarning,\n }\n}\n\nexport { navConfigFileExists } from './project-nav-config.js'\n\n/** @deprecated Use navConfigFileExists — true when portal-nav.ts or starter-nav.ts exists. */\nexport { navConfigFileExists as portalNavFileExists } from './project-nav-config.js'\n"],"mappings":";;;;;;;;AAAA,SAAS,SAAS;AAEX,IAAM,iBAAiB;AAEvB,IAAM,qBAAqB;AAE3B,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,cAAc;AAAA,EACtD,aAAa,EAAE,KAAK,CAAC,qBAAqB,mBAAmB,eAAe,CAAC;AAAA,EAC7E,QAAQ,EAAE,OAAO;AAAA,IACf,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IACtB,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IAC5B,QAAQ,EAAE,OAAO,EAAE,QAAQ,yBAAyB;AAAA,EACtD,CAAC;AAAA,EACD,OAAO,EACJ,OAAO;AAAA,IACN,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IACtB,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,IAC5B,QAAQ,EAAE,OAAO,EAAE,QAAQ,WAAW;AAAA,IACtC,WAAW,EAAE,OAAO,EAAE,QAAQ,sBAAsB;AAAA,EACtD,CAAC,EACA,SAAS;AAAA,EACZ,KAAK,EACF,OAAO;AAAA,IACN,MAAM,EAAE,KAAK,CAAC,YAAY,UAAU,SAAS,MAAM,CAAC,EAAE,QAAQ,UAAU;AAAA,IACxE,aAAa,EAAE,OAAO,EAAE,QAAQ,kBAAkB;AAAA,IAClD,QAAQ,EAAE,OAAO,EAAE,QAAQ,iBAAiB;AAAA,EAC9C,CAAC,EACA,QAAQ,CAAC,CAAC;AAAA,EACb,SAAS,EACN,OAAO;AAAA,IACN,KAAK,EAAE,OAAO,EAAE,QAAQ,sBAAsB;AAAA,IAC9C,QAAQ,EAAE,OAAO,EAAE,QAAQ,yB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CAAC;AAAA,EACxE;AAEA,YAAUA,SAAQ,aAAa,oBAAoB,GAAG,EAAE,WAAW,KAAK,CAAC;AACzE,EAAAG,eAAc,WAAW,YAAY;AACrC,EAAAA,eAAc,UAAU,WAAW;AACnC,oBAAkB,aAAa,MAAM,aAAa;AAElD,QAAM,eAAe,wBAAwB,WAAW;AACxD,MAAI,cAAc;AAChB,oBAAgB,cAAc,WAAW,IAAI;AAAA,EAC/C;AAEA,QAAM,YAAY,wBAAwB,WAAW;AACrD,MAAI,UAAU;AACZ,QAAI,CAAC,WAAW;AACd,cAAQ,KAAK,2EAAsE;AAAA,IACrF,WAAW,cAAc;AACvB,YAAM,eAAe,gCAAgC,YAAY;AACjE;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AAEA,QAAM,QAAQ,oBAAoB,aAAa,EAAE,QAAQ,OAAO,CAAC;AACjE,QAAM,uBAAuB,MAAM;AACnC,QAAM,mBAAmB,MAAM;AAE/B,MAAI,kBAAkB;AACpB,YAAQ,KAAK,gBAAgB;AAAA,EAC/B;AAEA,SAAO;AAAA,IACL,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["existsSync","resolve","resolve","existsSync","findProjectRoot","existsSync","readFileSync","resolve","resolve","existsSync","readFileSync","existsSync","readFileSync","writeFileSync","resolve","resolve","existsSync","readFileSync","writeFileSync"]}
|