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