@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.
Files changed (580) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +191 -157
  3. package/dist/{chunk-S2YJDWZU.js → chunk-NWBK3XBZ.js} +1 -1
  4. package/dist/chunk-NWBK3XBZ.js.map +1 -0
  5. package/dist/chunk-WHYTQEZX.js +554 -0
  6. package/dist/chunk-WHYTQEZX.js.map +1 -0
  7. package/dist/cli.js +1494 -650
  8. package/dist/cli.js.map +1 -1
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.js +6 -2
  11. package/dist/index.js.map +1 -1
  12. package/dist/scaffold-page-lifecycle-EHMPWPPE.js +194 -0
  13. package/dist/scaffold-page-lifecycle-EHMPWPPE.js.map +1 -0
  14. package/dist/vite/index.js +1 -1
  15. package/examples/greenfield/module-hybrid-cdn/public/fields.json +73 -28
  16. package/examples/greenfield/module-hybrid-cdn/public/module.html +21 -5
  17. package/examples/greenfield/module-hybrid-cdn/src/assets/css/main.dev.css +15 -0
  18. package/examples/greenfield/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
  19. package/examples/greenfield/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
  20. package/examples/greenfield/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -29
  21. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +60 -0
  22. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  23. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.ts +20 -37
  24. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.dev.example +3 -0
  25. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.local.example +6 -0
  26. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.prod.example +5 -0
  27. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.stg.example +3 -0
  28. package/examples/greenfield/module-hybrid-cdn-auth-full/.wphs/README.md +17 -0
  29. package/examples/greenfield/module-hybrid-cdn-auth-full/README.md +59 -0
  30. package/examples/greenfield/module-hybrid-cdn-auth-full/hubspot.config.yml.example +10 -0
  31. package/examples/greenfield/module-hybrid-cdn-auth-full/index.html +12 -0
  32. package/examples/greenfield/module-hybrid-cdn-auth-full/package.json +34 -0
  33. package/examples/greenfield/module-hybrid-cdn-auth-full/portal.cdn.json.example +8 -0
  34. package/examples/greenfield/module-hybrid-cdn-auth-full/public/fields.json +100 -0
  35. package/examples/greenfield/module-hybrid-cdn-auth-full/public/meta.json +9 -0
  36. package/examples/greenfield/module-hybrid-cdn-auth-full/public/module.html +38 -0
  37. package/examples/greenfield/module-hybrid-cdn-auth-full/src/app.tsx +172 -0
  38. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.dev.css +23 -0
  39. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.prod.css +12 -0
  40. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/tailwind.css.config.css +7 -0
  41. package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/app-entry.ts +48 -0
  42. package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/vendor-entry.ts +28 -0
  43. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  44. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AuthLayout.tsx +7 -0
  45. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/DefaultLayout.tsx +5 -0
  46. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/MainLayout.tsx +42 -0
  47. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  48. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/index.ts +13 -0
  49. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/section-card.tsx +20 -0
  50. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-nav.tsx +28 -0
  51. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-shell.tsx +18 -0
  52. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Button.tsx +22 -0
  53. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Form.tsx +22 -0
  54. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Input.tsx +12 -0
  55. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Toaster.tsx +5 -0
  56. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  57. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/link.tsx +10 -0
  58. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/loader/loader.tsx +18 -0
  59. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/auth-tier.ts +4 -0
  60. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/nav-scaffold.ts +4 -0
  61. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/portal-nav.ts +9 -0
  62. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/router.ts +1 -0
  63. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/routes.ts +10 -0
  64. package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/hubSpotContext.ts +57 -0
  65. package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/sync-sdk-hub-context.ts +44 -0
  66. package/examples/greenfield/module-hybrid-cdn-auth-full/src/defaultData.ts +2 -0
  67. package/examples/greenfield/module-hybrid-cdn-auth-full/src/env.ts +59 -0
  68. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/app-bootstrap-guards.ts +14 -0
  69. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-navigation.ts +81 -0
  70. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-route-paths.ts +29 -0
  71. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session-events.ts +2 -0
  72. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session.ts +51 -0
  73. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/clear-client-auth-session.ts +62 -0
  74. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/components/starter-login.tsx +83 -0
  75. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-email-storage.ts +64 -0
  76. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-session-bridge.ts +74 -0
  77. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-otp-utils.ts +24 -0
  78. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-pending-storage.ts +108 -0
  79. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-portal.ts +45 -0
  80. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/post-login-path.ts +17 -0
  81. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  82. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-post-login-path.ts +21 -0
  83. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/sso-callback.ts +120 -0
  84. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
  85. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-portal-session.ts +25 -0
  86. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-signed-in-email.ts +55 -0
  87. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-sso-callback-handler.ts +92 -0
  88. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-guide-page.tsx +210 -0
  89. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home-page.tsx +21 -0
  90. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home.tsx +48 -0
  91. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-page-frame.tsx +25 -0
  92. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-protected-page.tsx +54 -0
  93. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-single-page.tsx +17 -0
  94. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/auth-guide-content.ts +85 -0
  95. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/woodscli-guide-content.ts +86 -0
  96. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/starter-preview-values.ts +60 -0
  97. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  98. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.ts +30 -0
  99. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/index.ts +6 -0
  100. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/bootstrap.ts +16 -0
  101. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/default-data.ts +7 -0
  102. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/is-cms-editor.ts +78 -0
  103. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/module-entry.tsx +9 -0
  104. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/types.ts +17 -0
  105. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/configure-woodsportal-sdk.ts +98 -0
  106. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-query/root-provider.tsx +18 -0
  107. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-router/router.tsx +39 -0
  108. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/woodsportal-sdk.ts +37 -0
  109. package/examples/greenfield/module-hybrid-cdn-auth-full/src/main.tsx +5 -0
  110. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/api-endpoint.ts +11 -0
  111. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  112. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-dev-preview.tsx +12 -0
  113. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-portal.tsx +57 -0
  114. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routeTree.gen.ts +182 -0
  115. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/__root.tsx +12 -0
  116. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_app/portal.tsx +10 -0
  117. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login/sso.tsx +27 -0
  118. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login.tsx +10 -0
  119. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/two-fa.tsx +91 -0
  120. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/guide.tsx +9 -0
  121. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/index.tsx +8 -0
  122. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/unauthorized.tsx +50 -0
  123. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/ValidationSchema.ts +1 -0
  124. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/cookie.ts +23 -0
  125. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/normalize-router-path.ts +10 -0
  126. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/private-route.tsx +100 -0
  127. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/public-route.tsx +64 -0
  128. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/resolve-api-base-url.ts +44 -0
  129. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/safe-router-navigation.ts +82 -0
  130. package/examples/greenfield/module-hybrid-cdn-auth-full/tsconfig.json +20 -0
  131. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-app.mjs +1 -0
  132. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-esm.mjs +1 -0
  133. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-vendor.mjs +1 -0
  134. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.dev.mjs +1 -0
  135. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.hubspot.mjs +1 -0
  136. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.monolith.mjs +8 -0
  137. package/examples/greenfield/module-hybrid-cdn-auth-full/woodscli.json +38 -0
  138. package/examples/greenfield/module-hybrid-cdn-auth-full/wphs.adapter.ts +7 -0
  139. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.dev.example +3 -0
  140. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.local.example +6 -0
  141. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.prod.example +5 -0
  142. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.stg.example +3 -0
  143. package/examples/greenfield/module-hybrid-cdn-auth-sso/.wphs/README.md +17 -0
  144. package/examples/greenfield/module-hybrid-cdn-auth-sso/README.md +59 -0
  145. package/examples/greenfield/module-hybrid-cdn-auth-sso/hubspot.config.yml.example +10 -0
  146. package/examples/greenfield/module-hybrid-cdn-auth-sso/index.html +12 -0
  147. package/examples/greenfield/module-hybrid-cdn-auth-sso/package.json +34 -0
  148. package/examples/greenfield/module-hybrid-cdn-auth-sso/portal.cdn.json.example +8 -0
  149. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/fields.json +100 -0
  150. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/meta.json +9 -0
  151. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/module.html +38 -0
  152. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/app.tsx +180 -0
  153. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.dev.css +23 -0
  154. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.prod.css +12 -0
  155. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/tailwind.css.config.css +7 -0
  156. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/app-entry.ts +48 -0
  157. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/vendor-entry.ts +28 -0
  158. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  159. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AuthLayout.tsx +7 -0
  160. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/DefaultLayout.tsx +5 -0
  161. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/MainLayout.tsx +42 -0
  162. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  163. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/index.ts +13 -0
  164. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/section-card.tsx +20 -0
  165. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-nav.tsx +28 -0
  166. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-shell.tsx +18 -0
  167. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Button.tsx +22 -0
  168. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Form.tsx +22 -0
  169. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Input.tsx +12 -0
  170. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Toaster.tsx +5 -0
  171. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  172. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/link.tsx +10 -0
  173. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/loader/loader.tsx +18 -0
  174. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/auth-tier.ts +4 -0
  175. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/nav-scaffold.ts +4 -0
  176. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/portal-nav.ts +9 -0
  177. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/router.ts +1 -0
  178. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/routes.ts +10 -0
  179. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/hubSpotContext.ts +57 -0
  180. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/sync-sdk-hub-context.ts +44 -0
  181. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/defaultData.ts +2 -0
  182. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/env.ts +59 -0
  183. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/app-bootstrap-guards.ts +14 -0
  184. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-navigation.ts +81 -0
  185. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-route-paths.ts +29 -0
  186. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session-events.ts +2 -0
  187. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session.ts +26 -0
  188. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/clear-client-auth-session.ts +62 -0
  189. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/components/starter-login.tsx +83 -0
  190. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-email-storage.ts +64 -0
  191. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-session-bridge.ts +72 -0
  192. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/post-login-path.ts +17 -0
  193. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  194. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-post-login-path.ts +21 -0
  195. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/sso-callback.ts +120 -0
  196. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-portal-session.ts +25 -0
  197. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-signed-in-email.ts +55 -0
  198. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-sso-callback-handler.ts +92 -0
  199. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-guide-page.tsx +210 -0
  200. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home-page.tsx +21 -0
  201. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home.tsx +48 -0
  202. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-page-frame.tsx +25 -0
  203. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-protected-page.tsx +54 -0
  204. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-single-page.tsx +17 -0
  205. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/auth-guide-content.ts +85 -0
  206. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/woodscli-guide-content.ts +86 -0
  207. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/starter-preview-values.ts +60 -0
  208. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  209. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.ts +30 -0
  210. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/index.ts +6 -0
  211. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/bootstrap.ts +16 -0
  212. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/default-data.ts +7 -0
  213. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/is-cms-editor.ts +78 -0
  214. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/module-entry.tsx +9 -0
  215. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/types.ts +17 -0
  216. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/configure-woodsportal-sdk.ts +94 -0
  217. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-query/root-provider.tsx +18 -0
  218. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-router/router.tsx +39 -0
  219. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/woodsportal-sdk.ts +37 -0
  220. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/main.tsx +5 -0
  221. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/api-endpoint.ts +11 -0
  222. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  223. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-dev-preview.tsx +12 -0
  224. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-portal.tsx +57 -0
  225. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routeTree.gen.ts +155 -0
  226. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/__root.tsx +12 -0
  227. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_app/portal.tsx +10 -0
  228. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login/sso.tsx +27 -0
  229. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login.tsx +10 -0
  230. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/guide.tsx +9 -0
  231. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/index.tsx +8 -0
  232. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/unauthorized.tsx +50 -0
  233. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/ValidationSchema.ts +1 -0
  234. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/cookie.ts +23 -0
  235. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/normalize-router-path.ts +10 -0
  236. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/private-route.tsx +100 -0
  237. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/public-route.tsx +64 -0
  238. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/resolve-api-base-url.ts +44 -0
  239. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/safe-router-navigation.ts +82 -0
  240. package/examples/greenfield/module-hybrid-cdn-auth-sso/tsconfig.json +20 -0
  241. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-app.mjs +1 -0
  242. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-esm.mjs +1 -0
  243. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-vendor.mjs +1 -0
  244. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.dev.mjs +1 -0
  245. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.hubspot.mjs +1 -0
  246. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.monolith.mjs +8 -0
  247. package/examples/greenfield/module-hybrid-cdn-auth-sso/woodscli.json +38 -0
  248. package/examples/greenfield/module-hybrid-cdn-auth-sso/wphs.adapter.ts +7 -0
  249. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.dev.example +3 -0
  250. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.local.example +6 -0
  251. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.prod.example +5 -0
  252. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.stg.example +3 -0
  253. package/examples/greenfield/module-hybrid-cdn-auth-starter/.wphs/README.md +17 -0
  254. package/examples/greenfield/module-hybrid-cdn-auth-starter/README.md +59 -0
  255. package/examples/greenfield/module-hybrid-cdn-auth-starter/hubspot.config.yml.example +10 -0
  256. package/examples/greenfield/module-hybrid-cdn-auth-starter/index.html +12 -0
  257. package/examples/greenfield/module-hybrid-cdn-auth-starter/package.json +34 -0
  258. package/examples/greenfield/module-hybrid-cdn-auth-starter/portal.cdn.json.example +8 -0
  259. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/fields.json +100 -0
  260. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/meta.json +9 -0
  261. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/module.html +38 -0
  262. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/app.tsx +173 -0
  263. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.dev.css +23 -0
  264. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.prod.css +12 -0
  265. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/tailwind.css.config.css +7 -0
  266. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/app-entry.ts +48 -0
  267. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/vendor-entry.ts +28 -0
  268. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  269. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AuthLayout.tsx +7 -0
  270. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/DefaultLayout.tsx +5 -0
  271. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/MainLayout.tsx +42 -0
  272. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  273. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/index.ts +13 -0
  274. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/section-card.tsx +20 -0
  275. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-nav.tsx +28 -0
  276. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-shell.tsx +18 -0
  277. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Button.tsx +22 -0
  278. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Form.tsx +22 -0
  279. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Input.tsx +12 -0
  280. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Toaster.tsx +5 -0
  281. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/link.tsx +10 -0
  282. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/loader/loader.tsx +18 -0
  283. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/auth-tier.ts +4 -0
  284. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/nav-scaffold.ts +4 -0
  285. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/portal-nav.ts +9 -0
  286. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/router.ts +1 -0
  287. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/routes.ts +10 -0
  288. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/hubSpotContext.ts +57 -0
  289. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/sync-sdk-hub-context.ts +44 -0
  290. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/defaultData.ts +2 -0
  291. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/env.ts +59 -0
  292. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/app-bootstrap-guards.ts +14 -0
  293. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-navigation.ts +81 -0
  294. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-route-paths.ts +29 -0
  295. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session-events.ts +2 -0
  296. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session.ts +26 -0
  297. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/clear-client-auth-session.ts +62 -0
  298. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/components/starter-login.tsx +76 -0
  299. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-email-storage.ts +64 -0
  300. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-session-bridge.ts +72 -0
  301. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/post-login-path.ts +17 -0
  302. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  303. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-post-login-path.ts +21 -0
  304. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-portal-session.ts +25 -0
  305. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-signed-in-email.ts +55 -0
  306. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-guide-page.tsx +218 -0
  307. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home-page.tsx +21 -0
  308. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home.tsx +48 -0
  309. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-page-frame.tsx +25 -0
  310. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-protected-page.tsx +54 -0
  311. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-single-page.tsx +17 -0
  312. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/auth-guide-content.ts +91 -0
  313. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/woodscli-guide-content.ts +86 -0
  314. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/starter-preview-values.ts +60 -0
  315. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  316. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.ts +30 -0
  317. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/index.ts +6 -0
  318. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/bootstrap.ts +16 -0
  319. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/default-data.ts +7 -0
  320. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/is-cms-editor.ts +78 -0
  321. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/module-entry.tsx +9 -0
  322. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/types.ts +17 -0
  323. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/configure-woodsportal-sdk.ts +94 -0
  324. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-query/root-provider.tsx +18 -0
  325. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-router/router.tsx +39 -0
  326. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/woodsportal-sdk.ts +37 -0
  327. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/main.tsx +5 -0
  328. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/api-endpoint.ts +11 -0
  329. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  330. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-dev-preview.tsx +12 -0
  331. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-portal.tsx +52 -0
  332. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routeTree.gen.ts +134 -0
  333. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/__root.tsx +12 -0
  334. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_app/portal.tsx +10 -0
  335. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_auth/login.tsx +10 -0
  336. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/guide.tsx +9 -0
  337. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/index.tsx +8 -0
  338. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/unauthorized.tsx +50 -0
  339. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/ValidationSchema.ts +1 -0
  340. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/cookie.ts +23 -0
  341. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/normalize-router-path.ts +10 -0
  342. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/private-route.tsx +100 -0
  343. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/public-route.tsx +64 -0
  344. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/resolve-api-base-url.ts +44 -0
  345. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/safe-router-navigation.ts +82 -0
  346. package/examples/greenfield/module-hybrid-cdn-auth-starter/tsconfig.json +20 -0
  347. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-app.mjs +1 -0
  348. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-esm.mjs +1 -0
  349. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-vendor.mjs +1 -0
  350. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.dev.mjs +1 -0
  351. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.hubspot.mjs +1 -0
  352. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.monolith.mjs +8 -0
  353. package/examples/greenfield/module-hybrid-cdn-auth-starter/woodscli.json +38 -0
  354. package/examples/greenfield/module-hybrid-cdn-auth-starter/wphs.adapter.ts +7 -0
  355. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.dev.example +3 -0
  356. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.local.example +6 -0
  357. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.prod.example +5 -0
  358. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.stg.example +3 -0
  359. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.wphs/README.md +17 -0
  360. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/README.md +59 -0
  361. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/hubspot.config.yml.example +10 -0
  362. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/index.html +12 -0
  363. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/package.json +34 -0
  364. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/portal.cdn.json.example +8 -0
  365. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/fields.json +100 -0
  366. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/meta.json +9 -0
  367. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/module.html +38 -0
  368. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/app.tsx +173 -0
  369. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.dev.css +23 -0
  370. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.prod.css +12 -0
  371. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/tailwind.css.config.css +7 -0
  372. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/app-entry.ts +48 -0
  373. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/vendor-entry.ts +28 -0
  374. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  375. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AuthLayout.tsx +7 -0
  376. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/DefaultLayout.tsx +5 -0
  377. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
  378. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  379. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/index.ts +13 -0
  380. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
  381. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
  382. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/section-card.tsx +20 -0
  383. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-nav.tsx +28 -0
  384. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-shell.tsx +18 -0
  385. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Button.tsx +22 -0
  386. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Form.tsx +22 -0
  387. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Input.tsx +12 -0
  388. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Toaster.tsx +5 -0
  389. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/link.tsx +10 -0
  390. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/loader/loader.tsx +18 -0
  391. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/auth-tier.ts +4 -0
  392. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/nav-scaffold.ts +4 -0
  393. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/portal-nav.ts +9 -0
  394. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/router.ts +1 -0
  395. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/routes.ts +10 -0
  396. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/hubSpotContext.ts +57 -0
  397. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/sync-sdk-hub-context.ts +44 -0
  398. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/defaultData.ts +2 -0
  399. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/env.ts +59 -0
  400. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/app-bootstrap-guards.ts +14 -0
  401. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-navigation.ts +81 -0
  402. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-route-paths.ts +29 -0
  403. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session-events.ts +2 -0
  404. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session.ts +26 -0
  405. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/clear-client-auth-session.ts +62 -0
  406. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/components/starter-login.tsx +76 -0
  407. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-email-storage.ts +64 -0
  408. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-session-bridge.ts +72 -0
  409. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/post-login-path.ts +17 -0
  410. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  411. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-post-login-path.ts +21 -0
  412. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-portal-session.ts +25 -0
  413. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-signed-in-email.ts +55 -0
  414. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-guide-page.tsx +210 -0
  415. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home-page.tsx +21 -0
  416. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home.tsx +48 -0
  417. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-page-frame.tsx +25 -0
  418. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-protected-page.tsx +54 -0
  419. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-single-page.tsx +17 -0
  420. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/auth-guide-content.ts +85 -0
  421. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/woodscli-guide-content.ts +86 -0
  422. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/starter-preview-values.ts +60 -0
  423. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  424. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.ts +30 -0
  425. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/index.ts +6 -0
  426. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/bootstrap.ts +16 -0
  427. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/default-data.ts +7 -0
  428. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/is-cms-editor.ts +78 -0
  429. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/module-entry.tsx +9 -0
  430. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/types.ts +17 -0
  431. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/configure-woodsportal-sdk.ts +94 -0
  432. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-query/root-provider.tsx +18 -0
  433. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-router/router.tsx +39 -0
  434. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/woodsportal-sdk.ts +37 -0
  435. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/main.tsx +5 -0
  436. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/api-endpoint.ts +11 -0
  437. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  438. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-dev-preview.tsx +12 -0
  439. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-portal.tsx +52 -0
  440. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routeTree.gen.ts +134 -0
  441. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/__root.tsx +12 -0
  442. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_app/portal.tsx +10 -0
  443. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_auth/login.tsx +10 -0
  444. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/guide.tsx +9 -0
  445. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/index.tsx +8 -0
  446. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/unauthorized.tsx +50 -0
  447. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/ValidationSchema.ts +1 -0
  448. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/cookie.ts +23 -0
  449. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/normalize-router-path.ts +10 -0
  450. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/private-route.tsx +100 -0
  451. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/public-route.tsx +64 -0
  452. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/resolve-api-base-url.ts +44 -0
  453. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/safe-router-navigation.ts +82 -0
  454. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/tsconfig.json +20 -0
  455. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-app.mjs +1 -0
  456. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-esm.mjs +1 -0
  457. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-vendor.mjs +1 -0
  458. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.dev.mjs +1 -0
  459. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.hubspot.mjs +1 -0
  460. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.monolith.mjs +8 -0
  461. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/woodscli.json +38 -0
  462. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/wphs.adapter.ts +7 -0
  463. package/examples/greenfield/module-monolith/public/fields.json +66 -16
  464. package/examples/greenfield/module-monolith/src/assets/css/main.dev.css +7 -0
  465. package/examples/greenfield/module-monolith/src/components/layout/starter-nav.tsx +12 -15
  466. package/examples/greenfield/module-monolith/src/config/starter-nav.ts +9 -0
  467. package/examples/greenfield/module-monolith/src/features/starter/components/starter-home.tsx +25 -29
  468. package/examples/greenfield/module-monolith/src/features/starter/hooks/starter-preview-values.ts +60 -0
  469. package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  470. package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.ts +20 -37
  471. package/examples/manifest.json +5 -1
  472. package/examples/smoke/run-matrix.mjs +37 -0
  473. package/package.json +7 -5
  474. package/scripts/cli-smoke-helpers.mjs +150 -0
  475. package/scripts/regenerate-route-tree.mjs +71 -0
  476. package/scripts/sync-auth-scaffold-from-client.mjs +41 -0
  477. package/scripts/wp-cli-smoke.test.mjs +263 -0
  478. package/src/dev/bootstrap-greenfield.tsx +6 -0
  479. package/templates/module-hybrid-cdn/public/fields.json +47 -7
  480. package/templates/module-hybrid-cdn/public/module.html +7 -6
  481. package/templates/module-hybrid-cdn/src/assets/css/main.dev.css +7 -0
  482. package/templates/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
  483. package/templates/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
  484. package/templates/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -27
  485. package/templates/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +5 -5
  486. package/templates/module-monolith/public/fields.json +49 -6
  487. package/templates/module-monolith/src/assets/css/main.dev.css +7 -0
  488. package/templates/module-monolith/src/components/layout/starter-nav.tsx +12 -15
  489. package/templates/module-monolith/src/config/starter-nav.ts +9 -0
  490. package/templates/module-monolith/src/features/starter/components/starter-home.tsx +25 -27
  491. package/templates/module-monolith/src/features/starter/hooks/starter-preview-values.ts +5 -5
  492. package/templates/scaffold/auth/_full/src/app.tsx +172 -0
  493. package/templates/scaffold/auth/_full/src/config/auth-tier.ts +4 -0
  494. package/templates/scaffold/auth/_full/src/features/auth/auth-session.ts +51 -0
  495. package/templates/scaffold/auth/_full/src/features/auth/login-session-bridge.ts +74 -0
  496. package/templates/scaffold/auth/_full/src/features/auth/mfa-otp-utils.ts +24 -0
  497. package/templates/scaffold/auth/_full/src/features/auth/mfa-pending-storage.ts +108 -0
  498. package/templates/scaffold/auth/_full/src/features/auth/mfa-portal.ts +45 -0
  499. package/templates/scaffold/auth/_full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
  500. package/templates/scaffold/auth/_full/src/routeTree.gen.ts +182 -0
  501. package/templates/scaffold/auth/_full/src/routes/_auth/two-fa.tsx +91 -0
  502. package/templates/scaffold/auth/_nav-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
  503. package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
  504. package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
  505. package/templates/scaffold/auth/_nav-top/src/components/Layouts/MainLayout.tsx +42 -0
  506. package/templates/scaffold/auth/_shared/src/app.tsx +178 -0
  507. package/templates/scaffold/auth/_shared/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  508. package/templates/scaffold/auth/_shared/src/components/Layouts/AuthLayout.tsx +7 -0
  509. package/templates/scaffold/auth/_shared/src/components/Layouts/DefaultLayout.tsx +5 -0
  510. package/templates/scaffold/auth/_shared/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  511. package/templates/scaffold/auth/_shared/src/components/Layouts/index.ts +13 -0
  512. package/templates/scaffold/auth/_shared/src/components/ui/Button.tsx +22 -0
  513. package/templates/scaffold/auth/_shared/src/components/ui/Form.tsx +22 -0
  514. package/templates/scaffold/auth/_shared/src/components/ui/Input.tsx +12 -0
  515. package/templates/scaffold/auth/_shared/src/components/ui/Toaster.tsx +5 -0
  516. package/templates/scaffold/auth/_shared/src/components/ui/link.tsx +10 -0
  517. package/templates/scaffold/auth/_shared/src/components/ui/loader/loader.tsx +18 -0
  518. package/templates/scaffold/auth/_shared/src/config/auth-tier.ts +4 -0
  519. package/templates/scaffold/auth/_shared/src/config/nav-scaffold.ts +4 -0
  520. package/templates/scaffold/auth/_shared/src/config/portal-nav.ts +9 -0
  521. package/templates/scaffold/auth/_shared/src/config/router.ts +1 -0
  522. package/templates/scaffold/auth/_shared/src/config/routes.ts +10 -0
  523. package/templates/scaffold/auth/_shared/src/data/hubSpotContext.ts +57 -0
  524. package/templates/scaffold/auth/_shared/src/data/sync-sdk-hub-context.ts +44 -0
  525. package/templates/scaffold/auth/_shared/src/env.ts +59 -0
  526. package/templates/scaffold/auth/_shared/src/features/auth/app-bootstrap-guards.ts +14 -0
  527. package/templates/scaffold/auth/_shared/src/features/auth/auth-navigation.ts +81 -0
  528. package/templates/scaffold/auth/_shared/src/features/auth/auth-route-paths.ts +29 -0
  529. package/templates/scaffold/auth/_shared/src/features/auth/auth-session-events.ts +2 -0
  530. package/templates/scaffold/auth/_shared/src/features/auth/auth-session.ts +26 -0
  531. package/templates/scaffold/auth/_shared/src/features/auth/clear-client-auth-session.ts +62 -0
  532. package/templates/scaffold/auth/_shared/src/features/auth/components/starter-login.tsx +76 -0
  533. package/templates/scaffold/auth/_shared/src/features/auth/login-email-storage.ts +64 -0
  534. package/templates/scaffold/auth/_shared/src/features/auth/login-session-bridge.ts +72 -0
  535. package/templates/scaffold/auth/_shared/src/features/auth/post-login-path.ts +17 -0
  536. package/templates/scaffold/auth/_shared/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  537. package/templates/scaffold/auth/_shared/src/features/auth/resolve-post-login-path.ts +21 -0
  538. package/templates/scaffold/auth/_shared/src/features/auth/use-portal-session.ts +25 -0
  539. package/templates/scaffold/auth/_shared/src/features/auth/use-signed-in-email.ts +55 -0
  540. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-guide-page.tsx +218 -0
  541. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-page-frame.tsx +25 -0
  542. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-protected-page.tsx +54 -0
  543. package/templates/scaffold/auth/_shared/src/features/starter/content/auth-guide-content.ts +91 -0
  544. package/templates/scaffold/auth/_shared/src/hubspot/is-cms-editor.ts +78 -0
  545. package/templates/scaffold/auth/_shared/src/integrations/configure-woodsportal-sdk.ts +100 -0
  546. package/templates/scaffold/auth/_shared/src/integrations/tanstack-query/root-provider.tsx +18 -0
  547. package/templates/scaffold/auth/_shared/src/integrations/tanstack-router/router.tsx +39 -0
  548. package/templates/scaffold/auth/_shared/src/integrations/woodsportal-sdk.ts +37 -0
  549. package/templates/scaffold/auth/_shared/src/portal/mount-portal.tsx +59 -0
  550. package/templates/scaffold/auth/_shared/src/routeTree.gen.ts +134 -0
  551. package/templates/scaffold/auth/_shared/src/routes/__root.tsx +12 -0
  552. package/templates/scaffold/auth/_shared/src/routes/_app/portal.tsx +10 -0
  553. package/templates/scaffold/auth/_shared/src/routes/_auth/login.tsx +10 -0
  554. package/templates/scaffold/auth/_shared/src/routes/guide.tsx +9 -0
  555. package/templates/scaffold/auth/_shared/src/routes/index.tsx +8 -0
  556. package/templates/scaffold/auth/_shared/src/routes/unauthorized.tsx +50 -0
  557. package/templates/scaffold/auth/_shared/src/utils/ValidationSchema.ts +1 -0
  558. package/templates/scaffold/auth/_shared/src/utils/cookie.ts +23 -0
  559. package/templates/scaffold/auth/_shared/src/utils/normalize-router-path.ts +10 -0
  560. package/templates/scaffold/auth/_shared/src/utils/private-route.tsx +100 -0
  561. package/templates/scaffold/auth/_shared/src/utils/public-route.tsx +64 -0
  562. package/templates/scaffold/auth/_shared/src/utils/resolve-api-base-url.ts +44 -0
  563. package/templates/scaffold/auth/_shared/src/utils/safe-router-navigation.ts +82 -0
  564. package/templates/scaffold/auth/_sso/src/app.tsx +180 -0
  565. package/templates/scaffold/auth/_sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  566. package/templates/scaffold/auth/_sso/src/config/auth-tier.ts +4 -0
  567. package/templates/scaffold/auth/_sso/src/features/auth/components/starter-login.tsx +83 -0
  568. package/templates/scaffold/auth/_sso/src/features/auth/sso-callback.ts +120 -0
  569. package/templates/scaffold/auth/_sso/src/features/auth/use-sso-callback-handler.ts +92 -0
  570. package/templates/scaffold/auth/_sso/src/routeTree.gen.ts +155 -0
  571. package/templates/scaffold/auth/_sso/src/routes/_auth/login/sso.tsx +27 -0
  572. package/templates/scaffold/auth/nav-manifest.json +8 -0
  573. package/templates/scaffold/auth/sync-manifest.json +16 -0
  574. package/templates/scaffold/auth/tier-manifest.json +18 -0
  575. package/templates/scaffold/page/page-component-auth.tsx.tpl +10 -0
  576. package/templates/scaffold/page/page-component-plain.tsx.tpl +11 -0
  577. package/templates/scaffold/page/route-protected-auth.tsx.tpl +10 -0
  578. package/templates/scaffold/page/route-public-auth.tsx.tpl +9 -0
  579. package/templates/scaffold/page/route-public-plain.tsx.tpl +6 -0
  580. package/dist/chunk-S2YJDWZU.js.map +0 -1
@@ -0,0 +1,218 @@
1
+ import { SectionCard } from '@/components/layout/section-card'
2
+ import { Link } from '@/components/ui/link'
3
+ import { AUTH_SCAFFOLD_TIER } from '@/config/auth-tier'
4
+ import { NAV_SCAFFOLD_MODE } from '@/config/nav-scaffold'
5
+ import { Routes } from '@/config/routes'
6
+ import {
7
+ AUTH_BOOT_STEPS,
8
+ AUTH_ENV_VARS,
9
+ AUTH_INIT_EXAMPLES,
10
+ AUTH_NAV_EXAMPLES,
11
+ PAGE_SCAFFOLD_EXAMPLES,
12
+ AUTH_PROJECT_PATHS,
13
+ AUTH_TIER_DESCRIPTION,
14
+ PORTAL_AUTH_VS_HUBSPOT,
15
+ authRoutesForTier,
16
+ } from '@/features/starter/content/auth-guide-content'
17
+ import {
18
+ DEV_WORKFLOW,
19
+ PROJECT_LAYOUT,
20
+ WOODSCLI_ABOUT,
21
+ WOODSCLI_COMMANDS,
22
+ } from '@/features/starter/content/woodscli-guide-content'
23
+ import { StarterPageFrame } from '@/features/starter/components/starter-page-frame'
24
+
25
+ export function StarterGuidePage() {
26
+ const tier = AUTH_SCAFFOLD_TIER
27
+ const routes = authRoutesForTier(tier)
28
+
29
+ return (
30
+ <StarterPageFrame
31
+ className="max-w-4xl"
32
+ title="Developer guide"
33
+ description={
34
+ <>
35
+ WoodsCLI module with portal auth (<strong>{tier}</strong> tier). Use this page for
36
+ commands, project layout, and auth wiring — then replace the starter features with your CRM
37
+ UI under <code className="rounded bg-gray-100 px-1 text-xs">src/features/</code>.
38
+ </>
39
+ }
40
+ >
41
+ <div className="space-y-6">
42
+ <SectionCard title={`Portal auth — ${tier} tier`}>
43
+ <p className="text-sm leading-relaxed text-[#516f90]">{AUTH_TIER_DESCRIPTION[tier]}</p>
44
+ <ul className="mt-4 list-disc space-y-2 pl-5 text-sm text-[#516f90]">
45
+ <li>
46
+ <Link to={Routes.login}>Sign in</Link> at <code className="font-mono text-xs">/#/login</code>{' '}
47
+ (posts <code className="font-mono text-xs">username</code> + password to{' '}
48
+ <code className="font-mono text-xs">/api/auth/login</code>).
49
+ </li>
50
+ <li>
51
+ After login, visit the protected sample at{' '}
52
+ <Link to={Routes.portal}>/portal</Link> — session + profile via{' '}
53
+ <code className="font-mono text-xs">GET /api/auth/me</code>.
54
+ </li>
55
+ <li>
56
+ Set <code className="font-mono text-xs">VITE_PUBLIC_REST_API_ENDPOINT</code> in{' '}
57
+ <code className="font-mono text-xs">.env.local</code> after{' '}
58
+ <code className="font-mono text-xs">wp setup</code>.
59
+ </li>
60
+ </ul>
61
+ <p className="mt-4 text-xs text-[#516f90]">
62
+ Re-scaffold:{' '}
63
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono">{AUTH_INIT_EXAMPLES[tier]}</code>
64
+ </p>
65
+ </SectionCard>
66
+
67
+ <SectionCard title={`Navigation — ${NAV_SCAFFOLD_MODE} shell`}>
68
+ <p className="text-sm leading-relaxed text-[#516f90]">
69
+ Menu links come from{' '}
70
+ <code className="rounded bg-gray-100 px-1 text-xs">src/config/portal-nav.ts</code> — edit
71
+ once for both top nav and sidebar layouts.
72
+ </p>
73
+ <p className="mt-4 text-xs text-[#516f90]">
74
+ Sidebar init:{' '}
75
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono">
76
+ {AUTH_NAV_EXAMPLES.sidebar}
77
+ </code>
78
+ </p>
79
+ <ul className="mt-4 space-y-2 text-xs text-[#516f90]">
80
+ {PAGE_SCAFFOLD_EXAMPLES.map((cmd) => (
81
+ <li key={cmd}>
82
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono">{cmd}</code>
83
+ </li>
84
+ ))}
85
+ </ul>
86
+ </SectionCard>
87
+
88
+ <SectionCard title="Auth routes (this tier)">
89
+ <ul className="divide-y divide-[#eaf0f6]">
90
+ {routes.map(({ path, access }) => (
91
+ <li key={path} className="flex flex-col gap-1 py-3 first:pt-0 last:pb-0 sm:flex-row sm:gap-4">
92
+ <code className="shrink-0 rounded bg-[#eaf0f6] px-2 py-1 font-mono text-xs text-[#0091ae]">
93
+ {path}
94
+ </code>
95
+ <span className="text-sm leading-relaxed text-[#516f90]">{access}</span>
96
+ </li>
97
+ ))}
98
+ </ul>
99
+ </SectionCard>
100
+
101
+ <SectionCard title="Two auth concepts">
102
+ <ul className="space-y-4">
103
+ {PORTAL_AUTH_VS_HUBSPOT.map(({ label, cmds, purpose }) => (
104
+ <li key={label}>
105
+ <h3 className="text-sm font-medium text-[#33475b]">{label}</h3>
106
+ <p className="mt-1 font-mono text-xs text-[#0091ae]">{cmds}</p>
107
+ <p className="mt-1 text-sm leading-relaxed text-[#516f90]">{purpose}</p>
108
+ </li>
109
+ ))}
110
+ </ul>
111
+ </SectionCard>
112
+
113
+ <SectionCard title="Environment (.env.local)">
114
+ <ul className="space-y-3">
115
+ {AUTH_ENV_VARS.map(({ name, note }) => (
116
+ <li key={name} className="text-sm leading-relaxed">
117
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono text-xs text-[#33475b]">
118
+ {name}
119
+ </code>
120
+ <span className="mt-1 block text-[#516f90] sm:mt-0 sm:inline sm:before:content-['—_']">
121
+ {note}
122
+ </span>
123
+ </li>
124
+ ))}
125
+ </ul>
126
+ </SectionCard>
127
+
128
+ <SectionCard title="Session boot order">
129
+ <ol className="list-decimal space-y-2 pl-5 text-sm leading-relaxed text-[#516f90]">
130
+ {AUTH_BOOT_STEPS.map((step) => (
131
+ <li key={step}>{step}</li>
132
+ ))}
133
+ </ol>
134
+ </SectionCard>
135
+
136
+ <SectionCard title="About WoodsCLI">
137
+ <p className="text-sm leading-relaxed text-[#516f90]">{WOODSCLI_ABOUT.tagline}</p>
138
+ <p className="mt-3 text-sm leading-relaxed text-[#516f90]">{WOODSCLI_ABOUT.docsHint}</p>
139
+ </SectionCard>
140
+
141
+ <SectionCard title="Essential commands">
142
+ <ul className="divide-y divide-[#eaf0f6]">
143
+ {WOODSCLI_COMMANDS.map(({ cmd, desc }) => (
144
+ <li key={cmd} className="flex flex-col gap-1 py-3 first:pt-0 last:pb-0 sm:flex-row sm:gap-4">
145
+ <code className="shrink-0 rounded bg-[#eaf0f6] px-2 py-1 font-mono text-xs text-[#0091ae]">
146
+ {cmd}
147
+ </code>
148
+ <span className="text-sm leading-relaxed text-[#516f90]">{desc}</span>
149
+ </li>
150
+ ))}
151
+ </ul>
152
+ </SectionCard>
153
+
154
+ <SectionCard title="Auth-related paths">
155
+ <ul className="space-y-3">
156
+ {AUTH_PROJECT_PATHS.map(({ path, note }) => (
157
+ <li key={path} className="text-sm leading-relaxed">
158
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono text-xs text-[#33475b]">
159
+ {path}
160
+ </code>
161
+ <span className="mt-1 block text-[#516f90] sm:mt-0 sm:inline sm:before:content-['—_']">
162
+ {note}
163
+ </span>
164
+ </li>
165
+ ))}
166
+ </ul>
167
+ </SectionCard>
168
+
169
+ <SectionCard title="Project layout">
170
+ <ul className="space-y-3">
171
+ {PROJECT_LAYOUT.map(({ path, note }) => (
172
+ <li key={path} className="text-sm leading-relaxed">
173
+ <code className="rounded bg-[#eaf0f6] px-1.5 py-0.5 font-mono text-xs text-[#33475b]">
174
+ {path}
175
+ </code>
176
+ <span className="mt-1 block text-[#516f90] sm:mt-0 sm:inline sm:before:content-['—_']">
177
+ {note}
178
+ </span>
179
+ </li>
180
+ ))}
181
+ </ul>
182
+ </SectionCard>
183
+
184
+ <SectionCard title="Developer workflow">
185
+ <ol className="space-y-4">
186
+ <li>
187
+ <h3 className="text-sm font-medium text-[#33475b]">0 · Verify portal login</h3>
188
+ <p className="mt-1 text-sm leading-relaxed text-[#516f90]">
189
+ Run <code className="font-mono text-xs">wp dev</code>, open{' '}
190
+ <Link to={Routes.login}>/#/login</Link>, and confirm you reach{' '}
191
+ <Link to={Routes.portal}>/portal</Link> with an active session before building CRM
192
+ features.
193
+ </p>
194
+ </li>
195
+ {DEV_WORKFLOW.map(({ title: stepTitle, body }) => (
196
+ <li key={stepTitle}>
197
+ <h3 className="text-sm font-medium text-[#33475b]">{stepTitle}</h3>
198
+ <p className="mt-1 text-sm leading-relaxed text-[#516f90]">{body}</p>
199
+ </li>
200
+ ))}
201
+ </ol>
202
+ </SectionCard>
203
+
204
+ <SectionCard title="Routing & customization">
205
+ <p className="text-sm leading-relaxed text-[#516f90]">
206
+ File routes live under <code className="font-mono text-xs">src/routes/</code> and delegate
207
+ to <code className="font-mono text-xs">src/features/</code>. Hash history is the default
208
+ for HubSpot CMS embeds. Add protected routes with{' '}
209
+ <code className="font-mono text-xs">beforeLoad: {'() => ({ requiresAuth: true })'}</code>.
210
+ Replace <code className="font-mono text-xs">src/features/starter/</code> when you outgrow
211
+ the demo. Kit docs:{' '}
212
+ <code className="font-mono text-xs">node_modules/@woodsportal/hubspot-kit/docs/AUTH-SCAFFOLD.md</code>.
213
+ </p>
214
+ </SectionCard>
215
+ </div>
216
+ </StarterPageFrame>
217
+ )
218
+ }
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ type StarterPageFrameProps = {
4
+ title: string
5
+ description?: ReactNode
6
+ children?: ReactNode
7
+ className?: string
8
+ }
9
+
10
+ export function StarterPageFrame({
11
+ title,
12
+ description,
13
+ children,
14
+ className = 'max-w-2xl',
15
+ }: StarterPageFrameProps) {
16
+ return (
17
+ <div className={`mx-auto space-y-4 ${className}`}>
18
+ <div>
19
+ <h1 className="text-2xl font-semibold text-gray-900">{title}</h1>
20
+ {description ? <p className="mt-2 text-gray-600">{description}</p> : null}
21
+ </div>
22
+ {children}
23
+ </div>
24
+ )
25
+ }
@@ -0,0 +1,54 @@
1
+ import { useRouter } from '@tanstack/react-router'
2
+
3
+ import { Button } from '@/components/ui/Button'
4
+ import { Routes } from '@/config/routes'
5
+ import { clearClientAuthSession } from '@/features/auth/clear-client-auth-session'
6
+ import { useSignedInEmail } from '@/features/auth/use-signed-in-email'
7
+ import { usePortalSession } from '@/features/auth/use-portal-session'
8
+ import { StarterPageFrame } from '@/features/starter/components/starter-page-frame'
9
+ import { api } from '@/integrations/woodsportal-sdk'
10
+
11
+ export function StarterProtectedPage() {
12
+ const isAuthenticated = usePortalSession()
13
+ const { email, isLoading } = useSignedInEmail()
14
+ const router = useRouter()
15
+
16
+ const signedInLabel = isLoading ? 'Loading…' : (email ?? 'Signed in')
17
+
18
+ const handleLogout = async () => {
19
+ clearClientAuthSession()
20
+ try {
21
+ const { logout } = api.auth.logout({})
22
+ await logout()
23
+ } catch {
24
+ // local state already cleared
25
+ }
26
+ router.navigate({ to: Routes.login })
27
+ }
28
+
29
+ return (
30
+ <StarterPageFrame
31
+ title="Protected portal"
32
+ description={
33
+ <>
34
+ You reached <code className="rounded bg-gray-100 px-1">/portal</code> — sample authenticated
35
+ page for the auth scaffold.
36
+ </>
37
+ }
38
+ >
39
+ <dl className="rounded-lg border border-gray-200 bg-gray-50 p-4 text-sm">
40
+ <div className="flex justify-between gap-4">
41
+ <dt className="text-gray-500">Session</dt>
42
+ <dd className="font-medium text-gray-900">{isAuthenticated ? 'Active' : 'None'}</dd>
43
+ </div>
44
+ <div className="mt-2 flex justify-between gap-4">
45
+ <dt className="text-gray-500">Signed in as</dt>
46
+ <dd className="font-medium text-gray-900">{signedInLabel}</dd>
47
+ </div>
48
+ </dl>
49
+ <Button variant="outline" onClick={() => void handleLogout()}>
50
+ Sign out
51
+ </Button>
52
+ </StarterPageFrame>
53
+ )
54
+ }
@@ -0,0 +1,91 @@
1
+ export type AuthTierName = 'starter' | 'sso' | 'full'
2
+
3
+ export const AUTH_TIER_DESCRIPTION: Record<AuthTierName, string> = {
4
+ starter: 'Email + password login with a protected /portal sample page.',
5
+ sso: 'Starter login plus SSO OAuth callback handling at /login/sso.',
6
+ full: 'SSO plus MFA gate at /two-fa — recommended when the hub enforces 2FA.',
7
+ }
8
+
9
+ export const AUTH_ENV_VARS = [
10
+ {
11
+ name: 'VITE_PUBLIC_REST_API_ENDPOINT',
12
+ note: 'woodsportal-api base URL (required for login). Example: https://api.dev.woodsportal.com',
13
+ },
14
+ {
15
+ name: 'VITE_DEV_PORTAL_ID',
16
+ note: 'Optional local dev portal id — sent as X-Dev-Portal-Id when logging in.',
17
+ },
18
+ {
19
+ name: 'VITE_REFRESH_TOKEN',
20
+ note: 'Cookie name for the refresh token (not the token value). Default: wp.c.auth.refresh',
21
+ },
22
+ ] as const
23
+
24
+ export const AUTH_BOOT_STEPS = [
25
+ 'mountPortal → syncSdkHubContextFromRuntime',
26
+ 'configureWoodsPortalSdk (woodsportal-client-sdk HTTP client)',
27
+ 'SSO URL normalization (sso / full tiers)',
28
+ 'App bootstrap refresh (existing refresh cookie)',
29
+ 'TanStack Router + PublicRoute / PrivateRoute guards',
30
+ 'MainLayout → api.auth.me() (GET /api/auth/me) when authenticated',
31
+ ] as const
32
+
33
+ export const AUTH_PROJECT_PATHS = [
34
+ { path: 'src/config/auth-tier.ts', note: 'Scaffold tier patched by wp init (starter | sso | full)' },
35
+ { path: 'src/config/portal-nav.ts', note: 'Shared nav links for top nav and sidebar layouts' },
36
+ { path: 'src/config/nav-scaffold.ts', note: 'Nav shell mode patched by wp init (top | sidebar)' },
37
+ { path: 'src/features/auth/', note: 'Login UI, session bridge, route guards, email storage' },
38
+ { path: 'src/integrations/configure-woodsportal-sdk.ts', note: 'SDK HTTP init — API URL, cookies, routes' },
39
+ { path: 'src/integrations/woodsportal-sdk.ts', note: 'Single import surface for api.auth.* and api.crm.*' },
40
+ { path: 'src/app.tsx', note: 'Session bootstrap before RouterProvider mounts' },
41
+ { path: 'src/utils/public-route.tsx', note: 'Redirects authenticated users away from /login' },
42
+ { path: 'src/utils/private-route.tsx', note: 'Protects routes with requiresAuth: true' },
43
+ ] as const
44
+
45
+ export const AUTH_INIT_EXAMPLES: Record<AuthTierName, string> = {
46
+ starter:
47
+ 'npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth starter -y',
48
+ sso: 'npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth sso -y',
49
+ full: 'npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth full -y',
50
+ }
51
+
52
+ export const AUTH_NAV_EXAMPLES = {
53
+ top: 'npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth starter -y',
54
+ sidebar:
55
+ 'npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth starter --nav sidebar -y',
56
+ } as const
57
+
58
+ export const PAGE_SCAFFOLD_EXAMPLES = [
59
+ 'wp page add settings --protected --nav',
60
+ 'wp page add about --public',
61
+ 'wp page add billing --protected --title "Billing" --no-nav',
62
+ ] as const
63
+
64
+ export function authRoutesForTier(tier: AuthTierName): Array<{ path: string; access: string }> {
65
+ const routes = [
66
+ { path: '/guide', access: 'Public — this page' },
67
+ { path: '/login', access: 'Public — email + password' },
68
+ { path: '/portal', access: 'Protected — sample page after login' },
69
+ { path: '/unauthorized', access: 'Public' },
70
+ ]
71
+ if (tier === 'sso' || tier === 'full') {
72
+ routes.splice(2, 0, { path: '/login/sso', access: 'Public — SSO OAuth callback' })
73
+ }
74
+ if (tier === 'full') {
75
+ routes.splice(3, 0, { path: '/two-fa', access: 'Public — MFA OTP gate' })
76
+ }
77
+ return routes
78
+ }
79
+
80
+ export const PORTAL_AUTH_VS_HUBSPOT = [
81
+ {
82
+ label: 'HubSpot CLI auth',
83
+ cmds: 'wp auth · wp portal use',
84
+ purpose: 'Upload/watch module files to Design Manager',
85
+ },
86
+ {
87
+ label: 'Portal user auth',
88
+ cmds: 'wp init --auth starter|sso|full',
89
+ purpose: 'End users sign in via woodsportal-api + woodsportal-client-sdk',
90
+ },
91
+ ] as const
@@ -0,0 +1,78 @@
1
+ declare global {
2
+ interface Window {
3
+ hsInEditor?: boolean
4
+ hsVars?: {
5
+ isEditor?: boolean
6
+ is_edit_mode?: boolean
7
+ [key: string]: unknown
8
+ }
9
+ }
10
+ }
11
+
12
+ function isInNestedIframe(): boolean {
13
+ if (typeof window === 'undefined') {
14
+ return false
15
+ }
16
+ return window.self !== window.top
17
+ }
18
+
19
+ function readHubSpotEditorFlag(): boolean {
20
+ if (typeof window === 'undefined') {
21
+ return false
22
+ }
23
+ if (window.hubSpotData?.isInEditor === true) {
24
+ return true
25
+ }
26
+ if (window.hsInEditor === true) {
27
+ return true
28
+ }
29
+ if (window.hsVars?.isEditor === true || window.hsVars?.is_edit_mode === true) {
30
+ return true
31
+ }
32
+ return false
33
+ }
34
+
35
+ function detectEditorFromUrlOrReferrer(): boolean {
36
+ if (typeof window === 'undefined') {
37
+ return false
38
+ }
39
+ try {
40
+ const href = window.location.href
41
+ if (/inpageeditor|page-editor|hs_editor|content-editor/i.test(href)) {
42
+ return true
43
+ }
44
+ if (isInNestedIframe() && /hs_preview|hsCacheBuster/i.test(href)) {
45
+ return true
46
+ }
47
+ const referrer = document.referrer ?? ''
48
+ if (
49
+ referrer &&
50
+ /hubspot\.(com|net)/i.test(referrer) &&
51
+ /editor|preview|content\/(page|site)/i.test(referrer)
52
+ ) {
53
+ return true
54
+ }
55
+ } catch {
56
+ // ignore
57
+ }
58
+ return false
59
+ }
60
+
61
+ export function isHubSpotCmsEditor(): boolean {
62
+ if (readHubSpotEditorFlag()) {
63
+ return true
64
+ }
65
+ if (detectEditorFromUrlOrReferrer()) {
66
+ return true
67
+ }
68
+ if (isInNestedIframe() && window.hubSpotData?.isInPreviewer === true) {
69
+ return true
70
+ }
71
+ return false
72
+ }
73
+
74
+ export function isEditorPreviewMode(): boolean {
75
+ return isHubSpotCmsEditor() && isInNestedIframe()
76
+ }
77
+
78
+ export {}
@@ -0,0 +1,100 @@
1
+ import type { LogLevel } from 'woodsportal-client-sdk'
2
+ import {
3
+ initializeHttpClient,
4
+ isServiceUnavailableError,
5
+ setSessionLifecycleListener,
6
+ } from '@/integrations/woodsportal-sdk'
7
+ import { AUTH_SCAFFOLD_TIER } from '@/config/auth-tier'
8
+ import { Routes } from '@/config/routes'
9
+ import { syncSdkHubContextFromRuntime } from '@/data/sync-sdk-hub-context'
10
+ import { resolveHubId } from '@/data/hubSpotContext'
11
+ import { env } from '@/env'
12
+ import { isMfaPendingSession } from '@/features/auth/auth-session'
13
+ import { clearClientAuthSession } from '@/features/auth/clear-client-auth-session'
14
+ import { AUTH_SESSION_CHANGED } from '@/features/auth/auth-session-events'
15
+ import { skipCurrentPublicPath } from '@/utils/ValidationSchema'
16
+ import { resolveWoodsPortalApiBaseUrl } from '@/utils/resolve-api-base-url'
17
+ import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
18
+
19
+ function resolveSdkLogLevel(): LogLevel {
20
+ const configured = import.meta.env.VITE_SDK_LOG_LEVEL as LogLevel | undefined
21
+ if (
22
+ configured === 'debug' ||
23
+ configured === 'info' ||
24
+ configured === 'warn' ||
25
+ configured === 'error' ||
26
+ configured === 'silent'
27
+ ) {
28
+ return configured
29
+ }
30
+ return import.meta.env.DEV ? 'debug' : 'info'
31
+ }
32
+
33
+ /**
34
+ * Configure woodsportal-client-sdk HTTP before any api.* call.
35
+ * Tier: {@link AUTH_SCAFFOLD_TIER} (patched by init-auth-scaffold).
36
+ */
37
+ export function configureWoodsPortalSdk(): void {
38
+ syncSdkHubContextFromRuntime()
39
+ const resolvedHubId = resolveHubId()
40
+ const devPortalId =
41
+ import.meta.env.DEV && env.VITE_DEV_PORTAL_ID != null && env.VITE_DEV_PORTAL_ID !== ''
42
+ ? String(env.VITE_DEV_PORTAL_ID)
43
+ : undefined
44
+
45
+ setSessionLifecycleListener(() => {
46
+ if (typeof window !== 'undefined') {
47
+ window.dispatchEvent(new CustomEvent(AUTH_SESSION_CHANGED))
48
+ }
49
+ })
50
+
51
+ initializeHttpClient({
52
+ baseURL: resolveWoodsPortalApiBaseUrl(),
53
+ timeout: 50_000,
54
+ hubId: resolvedHubId != null ? String(resolvedHubId) : undefined,
55
+ devPortalId,
56
+ storageMode: isHubSpotCmsEditor() ? 'iframe' : 'cookie',
57
+ skipCurrentPublicPath,
58
+ shouldHandleUnauthorized: () => {
59
+ if (isHubSpotCmsEditor()) {
60
+ return false
61
+ }
62
+ // WPHS_AUTH_FULL
63
+ if (isMfaPendingSession()) {
64
+ return false
65
+ }
66
+ // /WPHS_AUTH_FULL
67
+ return true
68
+ },
69
+ routes: {
70
+ unauthorized: Routes.unauthorized,
71
+ login: Routes.login,
72
+ twoFa: Routes.twoFa,
73
+ resendEmail: '/resend-email',
74
+ },
75
+ onLogout: () => {
76
+ clearClientAuthSession()
77
+ },
78
+ logger: {
79
+ level: resolveSdkLogLevel(),
80
+ httpTracing: true,
81
+ },
82
+ storageKeys: {
83
+ loginDetails: env.VITE_LOGIN_DETAILS,
84
+ refreshToken: env.VITE_REFRESH_TOKEN,
85
+ portal: env.VITE_PORTAL,
86
+ subscriptionType: env.VITE_SUBSCRIPTION_TYPE,
87
+ authUser: env.VITE_AUTH_USER_KEY,
88
+ pagination: env.VITE_PAGINATION_DATA,
89
+ routeMenu: env.VITE_ROUTE_MENU_CONFIG_KEY,
90
+ associationView: env.VITE_ASSOCIATION_VIEW_URL_KEY,
91
+ },
92
+ onServiceUnavailable: (error) => {
93
+ if (isServiceUnavailableError(error)) {
94
+ console.warn('[WoodsPortal] API unavailable', error)
95
+ }
96
+ },
97
+ })
98
+
99
+ void AUTH_SCAFFOLD_TIER
100
+ }
@@ -0,0 +1,18 @@
1
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2
+
3
+ const queryClient = new QueryClient({
4
+ defaultOptions: {
5
+ queries: {
6
+ refetchOnWindowFocus: false,
7
+ retry: false,
8
+ },
9
+ },
10
+ })
11
+
12
+ export function getContext() {
13
+ return { queryClient }
14
+ }
15
+
16
+ export function Provider({ children }: { children: React.ReactNode }) {
17
+ return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
18
+ }
@@ -0,0 +1,39 @@
1
+ import {
2
+ createBrowserHistory,
3
+ createHashHistory,
4
+ createRouter,
5
+ type AnyRouter,
6
+ } from '@tanstack/react-router'
7
+
8
+ import { ROUTER_HISTORY } from '@/config/router'
9
+ import * as TanStackQueryProvider from '@/integrations/tanstack-query/root-provider'
10
+ import { routeTree } from '@/routeTree.gen'
11
+
12
+ let routerInstance: AnyRouter | null = null
13
+
14
+ export function getRouter(): AnyRouter {
15
+ if (!routerInstance) {
16
+ const history = ROUTER_HISTORY === 'hash' ? createHashHistory() : createBrowserHistory()
17
+ routerInstance = createRouter({
18
+ routeTree,
19
+ context: {
20
+ ...TanStackQueryProvider.getContext(),
21
+ },
22
+ history,
23
+ defaultPreload: 'intent',
24
+ scrollRestoration: true,
25
+ defaultStructuralSharing: true,
26
+ defaultPreloadStaleTime: 0,
27
+ })
28
+ }
29
+ return routerInstance
30
+ }
31
+
32
+ /** Eager router export for dev tooling. */
33
+ export const router = getRouter()
34
+
35
+ declare module '@tanstack/react-router' {
36
+ interface Register {
37
+ router: ReturnType<typeof getRouter>
38
+ }
39
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * SDK facade — single import surface for app code.
3
+ * Dependency: woodsportal-client-sdk ^4.0.7-dev.11 (added by template-auth-deps.ts)
4
+ */
5
+ export {
6
+ getHttpErrorMessage,
7
+ isServiceUnavailableError,
8
+ initializeHttpClient,
9
+ setSessionLifecycleListener,
10
+ recoverMfaGateOnBoot,
11
+ resolveAuthRouteAction,
12
+ AuthErrorCode,
13
+ resolveAuthErrorAction,
14
+ storeMfaPendingAccessToken,
15
+ readMfaPendingAccessToken,
16
+ clearMfaPendingAccessToken,
17
+ hydrateMfaPendingAccessToken,
18
+ } from 'woodsportal-client-sdk/auth'
19
+ export type {
20
+ HttpClientConfig,
21
+ LoginBootstrapResponse,
22
+ MfaMethod,
23
+ MfaMethodOption,
24
+ AuthRouteAction,
25
+ MfaBootRecoveryResult,
26
+ } from 'woodsportal-client-sdk/auth'
27
+
28
+ import { api as authApi } from 'woodsportal-client-sdk/auth'
29
+ import { api as crmApi, store } from 'woodsportal-client-sdk/crm'
30
+
31
+ export const api = {
32
+ auth: authApi.auth,
33
+ crm: crmApi.crm,
34
+ navigation: crmApi.navigation,
35
+ }
36
+
37
+ export { store }