@woodsportal/hubspot-kit 1.0.41 → 1.0.42-dev.1

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 (613) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +191 -157
  3. package/dist/chunk-4UFWXPQG.js +554 -0
  4. package/dist/chunk-4UFWXPQG.js.map +1 -0
  5. package/dist/{chunk-4GOJPOW3.js → chunk-GXYUGXF5.js} +82 -23
  6. package/dist/chunk-GXYUGXF5.js.map +1 -0
  7. package/dist/{chunk-S2YJDWZU.js → chunk-NWBK3XBZ.js} +1 -1
  8. package/dist/chunk-NWBK3XBZ.js.map +1 -0
  9. package/dist/cli.js +1826 -877
  10. package/dist/cli.js.map +1 -1
  11. package/dist/{exec-VY6BGWF3.js → exec-NS4GKXZS.js} +2 -2
  12. package/dist/index.d.ts +12 -0
  13. package/dist/index.js +6 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/scaffold-page-lifecycle-53AWWGFR.js +194 -0
  16. package/dist/scaffold-page-lifecycle-53AWWGFR.js.map +1 -0
  17. package/dist/vite/index.js +1 -1
  18. package/examples/greenfield/module-hybrid-cdn/README.md +2 -1
  19. package/examples/greenfield/module-hybrid-cdn/public/fields.json +73 -28
  20. package/examples/greenfield/module-hybrid-cdn/public/module.html +21 -5
  21. package/examples/greenfield/module-hybrid-cdn/src/assets/css/main.dev.css +15 -0
  22. package/examples/greenfield/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
  23. package/examples/greenfield/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
  24. package/examples/greenfield/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -29
  25. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +60 -0
  26. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  27. package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.ts +20 -37
  28. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.dev.example +3 -0
  29. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.local.example +6 -0
  30. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.prod.example +5 -0
  31. package/examples/greenfield/module-hybrid-cdn-auth-full/.env.stg.example +3 -0
  32. package/examples/greenfield/module-hybrid-cdn-auth-full/.wphs/README.md +17 -0
  33. package/examples/greenfield/module-hybrid-cdn-auth-full/README.md +60 -0
  34. package/examples/greenfield/module-hybrid-cdn-auth-full/hubspot.config.yml.example +10 -0
  35. package/examples/greenfield/module-hybrid-cdn-auth-full/index.html +12 -0
  36. package/examples/greenfield/module-hybrid-cdn-auth-full/package.json +34 -0
  37. package/examples/greenfield/module-hybrid-cdn-auth-full/portal.cdn.json.example +8 -0
  38. package/examples/greenfield/module-hybrid-cdn-auth-full/public/fields.json +100 -0
  39. package/examples/greenfield/module-hybrid-cdn-auth-full/public/meta.json +9 -0
  40. package/examples/greenfield/module-hybrid-cdn-auth-full/public/module.html +38 -0
  41. package/examples/greenfield/module-hybrid-cdn-auth-full/src/app.tsx +172 -0
  42. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.dev.css +23 -0
  43. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.prod.css +12 -0
  44. package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/tailwind.css.config.css +7 -0
  45. package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/app-entry.ts +48 -0
  46. package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/vendor-entry.ts +28 -0
  47. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  48. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AuthLayout.tsx +7 -0
  49. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/DefaultLayout.tsx +5 -0
  50. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/MainLayout.tsx +42 -0
  51. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  52. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/index.ts +13 -0
  53. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/section-card.tsx +20 -0
  54. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-nav.tsx +28 -0
  55. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-shell.tsx +18 -0
  56. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Button.tsx +22 -0
  57. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Form.tsx +22 -0
  58. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Input.tsx +12 -0
  59. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Toaster.tsx +5 -0
  60. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  61. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/link.tsx +10 -0
  62. package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/loader/loader.tsx +18 -0
  63. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/auth-tier.ts +4 -0
  64. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/nav-scaffold.ts +4 -0
  65. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/portal-nav.ts +9 -0
  66. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/router.ts +1 -0
  67. package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/routes.ts +10 -0
  68. package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/hubSpotContext.ts +57 -0
  69. package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/sync-sdk-hub-context.ts +44 -0
  70. package/examples/greenfield/module-hybrid-cdn-auth-full/src/defaultData.ts +2 -0
  71. package/examples/greenfield/module-hybrid-cdn-auth-full/src/env.ts +59 -0
  72. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/app-bootstrap-guards.ts +14 -0
  73. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-navigation.ts +81 -0
  74. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-route-paths.ts +29 -0
  75. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session-events.ts +2 -0
  76. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session.ts +51 -0
  77. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/clear-client-auth-session.ts +62 -0
  78. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/components/starter-login.tsx +79 -0
  79. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-email-storage.ts +64 -0
  80. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-session-bridge.ts +74 -0
  81. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-otp-utils.ts +24 -0
  82. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-pending-storage.ts +108 -0
  83. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-portal.ts +45 -0
  84. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/post-login-path.ts +17 -0
  85. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  86. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-post-login-path.ts +21 -0
  87. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/sso-callback.ts +126 -0
  88. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
  89. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-portal-session.ts +25 -0
  90. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-signed-in-email.ts +55 -0
  91. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-sso-callback-handler.ts +92 -0
  92. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-guide-page.tsx +210 -0
  93. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home-page.tsx +21 -0
  94. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home.tsx +48 -0
  95. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-page-frame.tsx +25 -0
  96. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-protected-page.tsx +54 -0
  97. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-single-page.tsx +17 -0
  98. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/auth-guide-content.ts +85 -0
  99. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/woodscli-guide-content.ts +86 -0
  100. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/starter-preview-values.ts +60 -0
  101. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  102. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.ts +30 -0
  103. package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/index.ts +6 -0
  104. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/bootstrap.ts +16 -0
  105. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/default-data.ts +7 -0
  106. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/is-cms-editor.ts +78 -0
  107. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/module-entry.tsx +9 -0
  108. package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/types.ts +17 -0
  109. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/configure-woodsportal-sdk.ts +98 -0
  110. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-query/root-provider.tsx +18 -0
  111. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-router/router.tsx +39 -0
  112. package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/woodsportal-sdk.ts +37 -0
  113. package/examples/greenfield/module-hybrid-cdn-auth-full/src/main.tsx +5 -0
  114. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/api-endpoint.ts +11 -0
  115. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  116. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-dev-preview.tsx +12 -0
  117. package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-portal.tsx +57 -0
  118. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routeTree.gen.ts +182 -0
  119. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/__root.tsx +12 -0
  120. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_app/portal.tsx +10 -0
  121. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login/sso.tsx +27 -0
  122. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login.tsx +10 -0
  123. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/two-fa.tsx +91 -0
  124. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/guide.tsx +9 -0
  125. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/index.tsx +8 -0
  126. package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/unauthorized.tsx +50 -0
  127. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/ValidationSchema.ts +1 -0
  128. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/cookie.ts +23 -0
  129. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/normalize-router-path.ts +10 -0
  130. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/private-route.tsx +100 -0
  131. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/public-route.tsx +64 -0
  132. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/resolve-api-base-url.ts +44 -0
  133. package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/safe-router-navigation.ts +82 -0
  134. package/examples/greenfield/module-hybrid-cdn-auth-full/tsconfig.json +20 -0
  135. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-app.mjs +1 -0
  136. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-esm.mjs +1 -0
  137. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-vendor.mjs +1 -0
  138. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.dev.mjs +1 -0
  139. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.hubspot.mjs +1 -0
  140. package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.monolith.mjs +8 -0
  141. package/examples/greenfield/module-hybrid-cdn-auth-full/woodscli.json +38 -0
  142. package/examples/greenfield/module-hybrid-cdn-auth-full/wphs.adapter.ts +7 -0
  143. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.dev.example +3 -0
  144. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.local.example +6 -0
  145. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.prod.example +5 -0
  146. package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.stg.example +3 -0
  147. package/examples/greenfield/module-hybrid-cdn-auth-sso/.wphs/README.md +17 -0
  148. package/examples/greenfield/module-hybrid-cdn-auth-sso/README.md +60 -0
  149. package/examples/greenfield/module-hybrid-cdn-auth-sso/hubspot.config.yml.example +10 -0
  150. package/examples/greenfield/module-hybrid-cdn-auth-sso/index.html +12 -0
  151. package/examples/greenfield/module-hybrid-cdn-auth-sso/package.json +34 -0
  152. package/examples/greenfield/module-hybrid-cdn-auth-sso/portal.cdn.json.example +8 -0
  153. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/fields.json +100 -0
  154. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/meta.json +9 -0
  155. package/examples/greenfield/module-hybrid-cdn-auth-sso/public/module.html +38 -0
  156. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/app.tsx +180 -0
  157. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.dev.css +23 -0
  158. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.prod.css +12 -0
  159. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/tailwind.css.config.css +7 -0
  160. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/app-entry.ts +48 -0
  161. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/vendor-entry.ts +28 -0
  162. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  163. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AuthLayout.tsx +7 -0
  164. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/DefaultLayout.tsx +5 -0
  165. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/MainLayout.tsx +42 -0
  166. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  167. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/index.ts +13 -0
  168. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/section-card.tsx +20 -0
  169. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-nav.tsx +28 -0
  170. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-shell.tsx +18 -0
  171. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Button.tsx +22 -0
  172. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Form.tsx +22 -0
  173. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Input.tsx +12 -0
  174. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Toaster.tsx +5 -0
  175. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  176. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/link.tsx +10 -0
  177. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/loader/loader.tsx +18 -0
  178. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/auth-tier.ts +4 -0
  179. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/nav-scaffold.ts +4 -0
  180. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/portal-nav.ts +9 -0
  181. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/router.ts +1 -0
  182. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/routes.ts +10 -0
  183. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/hubSpotContext.ts +57 -0
  184. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/sync-sdk-hub-context.ts +44 -0
  185. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/defaultData.ts +2 -0
  186. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/env.ts +59 -0
  187. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/app-bootstrap-guards.ts +14 -0
  188. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-navigation.ts +81 -0
  189. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-route-paths.ts +29 -0
  190. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session-events.ts +2 -0
  191. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session.ts +26 -0
  192. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/clear-client-auth-session.ts +62 -0
  193. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/components/starter-login.tsx +83 -0
  194. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-email-storage.ts +64 -0
  195. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-session-bridge.ts +72 -0
  196. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/post-login-path.ts +17 -0
  197. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  198. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-post-login-path.ts +21 -0
  199. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/sso-callback.ts +126 -0
  200. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-portal-session.ts +25 -0
  201. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-signed-in-email.ts +55 -0
  202. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-sso-callback-handler.ts +92 -0
  203. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-guide-page.tsx +210 -0
  204. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home-page.tsx +21 -0
  205. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home.tsx +48 -0
  206. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-page-frame.tsx +25 -0
  207. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-protected-page.tsx +54 -0
  208. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-single-page.tsx +17 -0
  209. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/auth-guide-content.ts +85 -0
  210. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/woodscli-guide-content.ts +86 -0
  211. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/starter-preview-values.ts +60 -0
  212. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  213. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.ts +30 -0
  214. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/index.ts +6 -0
  215. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/bootstrap.ts +16 -0
  216. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/default-data.ts +7 -0
  217. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/is-cms-editor.ts +78 -0
  218. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/module-entry.tsx +9 -0
  219. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/types.ts +17 -0
  220. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/configure-woodsportal-sdk.ts +94 -0
  221. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-query/root-provider.tsx +18 -0
  222. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-router/router.tsx +39 -0
  223. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/woodsportal-sdk.ts +37 -0
  224. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/main.tsx +5 -0
  225. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/api-endpoint.ts +11 -0
  226. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  227. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-dev-preview.tsx +12 -0
  228. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-portal.tsx +57 -0
  229. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routeTree.gen.ts +155 -0
  230. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/__root.tsx +12 -0
  231. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_app/portal.tsx +10 -0
  232. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login/sso.tsx +27 -0
  233. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login.tsx +10 -0
  234. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/guide.tsx +9 -0
  235. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/index.tsx +8 -0
  236. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/unauthorized.tsx +50 -0
  237. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/ValidationSchema.ts +1 -0
  238. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/cookie.ts +23 -0
  239. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/normalize-router-path.ts +10 -0
  240. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/private-route.tsx +100 -0
  241. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/public-route.tsx +64 -0
  242. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/resolve-api-base-url.ts +44 -0
  243. package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/safe-router-navigation.ts +82 -0
  244. package/examples/greenfield/module-hybrid-cdn-auth-sso/tsconfig.json +20 -0
  245. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-app.mjs +1 -0
  246. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-esm.mjs +1 -0
  247. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-vendor.mjs +1 -0
  248. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.dev.mjs +1 -0
  249. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.hubspot.mjs +1 -0
  250. package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.monolith.mjs +8 -0
  251. package/examples/greenfield/module-hybrid-cdn-auth-sso/woodscli.json +38 -0
  252. package/examples/greenfield/module-hybrid-cdn-auth-sso/wphs.adapter.ts +7 -0
  253. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.dev.example +3 -0
  254. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.local.example +6 -0
  255. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.prod.example +5 -0
  256. package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.stg.example +3 -0
  257. package/examples/greenfield/module-hybrid-cdn-auth-starter/.wphs/README.md +17 -0
  258. package/examples/greenfield/module-hybrid-cdn-auth-starter/README.md +60 -0
  259. package/examples/greenfield/module-hybrid-cdn-auth-starter/hubspot.config.yml.example +10 -0
  260. package/examples/greenfield/module-hybrid-cdn-auth-starter/index.html +12 -0
  261. package/examples/greenfield/module-hybrid-cdn-auth-starter/package.json +34 -0
  262. package/examples/greenfield/module-hybrid-cdn-auth-starter/portal.cdn.json.example +8 -0
  263. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/fields.json +100 -0
  264. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/meta.json +9 -0
  265. package/examples/greenfield/module-hybrid-cdn-auth-starter/public/module.html +38 -0
  266. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/app.tsx +173 -0
  267. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.dev.css +23 -0
  268. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.prod.css +12 -0
  269. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/tailwind.css.config.css +7 -0
  270. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/app-entry.ts +48 -0
  271. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/vendor-entry.ts +28 -0
  272. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  273. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AuthLayout.tsx +7 -0
  274. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/DefaultLayout.tsx +5 -0
  275. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/MainLayout.tsx +42 -0
  276. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  277. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/index.ts +13 -0
  278. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/section-card.tsx +20 -0
  279. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-nav.tsx +28 -0
  280. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-shell.tsx +18 -0
  281. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Button.tsx +22 -0
  282. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Form.tsx +22 -0
  283. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Input.tsx +12 -0
  284. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Toaster.tsx +5 -0
  285. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/link.tsx +10 -0
  286. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/loader/loader.tsx +18 -0
  287. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/auth-tier.ts +4 -0
  288. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/nav-scaffold.ts +4 -0
  289. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/portal-nav.ts +9 -0
  290. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/router.ts +1 -0
  291. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/routes.ts +10 -0
  292. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/hubSpotContext.ts +57 -0
  293. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/sync-sdk-hub-context.ts +44 -0
  294. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/defaultData.ts +2 -0
  295. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/env.ts +59 -0
  296. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/app-bootstrap-guards.ts +14 -0
  297. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-navigation.ts +81 -0
  298. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-route-paths.ts +29 -0
  299. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session-events.ts +2 -0
  300. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session.ts +26 -0
  301. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/clear-client-auth-session.ts +62 -0
  302. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/components/starter-login.tsx +76 -0
  303. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-email-storage.ts +64 -0
  304. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-session-bridge.ts +72 -0
  305. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/post-login-path.ts +17 -0
  306. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  307. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-post-login-path.ts +21 -0
  308. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-portal-session.ts +25 -0
  309. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-signed-in-email.ts +55 -0
  310. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-guide-page.tsx +218 -0
  311. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home-page.tsx +21 -0
  312. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home.tsx +48 -0
  313. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-page-frame.tsx +25 -0
  314. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-protected-page.tsx +54 -0
  315. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-single-page.tsx +17 -0
  316. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/auth-guide-content.ts +91 -0
  317. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/woodscli-guide-content.ts +86 -0
  318. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/starter-preview-values.ts +60 -0
  319. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  320. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.ts +30 -0
  321. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/index.ts +6 -0
  322. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/bootstrap.ts +16 -0
  323. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/default-data.ts +7 -0
  324. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/is-cms-editor.ts +78 -0
  325. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/module-entry.tsx +9 -0
  326. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/types.ts +17 -0
  327. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/configure-woodsportal-sdk.ts +94 -0
  328. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-query/root-provider.tsx +18 -0
  329. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-router/router.tsx +39 -0
  330. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/woodsportal-sdk.ts +37 -0
  331. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/main.tsx +5 -0
  332. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/api-endpoint.ts +11 -0
  333. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  334. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-dev-preview.tsx +12 -0
  335. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-portal.tsx +52 -0
  336. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routeTree.gen.ts +134 -0
  337. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/__root.tsx +12 -0
  338. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_app/portal.tsx +10 -0
  339. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_auth/login.tsx +10 -0
  340. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/guide.tsx +9 -0
  341. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/index.tsx +8 -0
  342. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/unauthorized.tsx +50 -0
  343. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/ValidationSchema.ts +1 -0
  344. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/cookie.ts +23 -0
  345. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/normalize-router-path.ts +10 -0
  346. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/private-route.tsx +100 -0
  347. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/public-route.tsx +64 -0
  348. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/resolve-api-base-url.ts +44 -0
  349. package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/safe-router-navigation.ts +82 -0
  350. package/examples/greenfield/module-hybrid-cdn-auth-starter/tsconfig.json +20 -0
  351. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-app.mjs +1 -0
  352. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-esm.mjs +1 -0
  353. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-vendor.mjs +1 -0
  354. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.dev.mjs +1 -0
  355. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.hubspot.mjs +1 -0
  356. package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.monolith.mjs +8 -0
  357. package/examples/greenfield/module-hybrid-cdn-auth-starter/woodscli.json +38 -0
  358. package/examples/greenfield/module-hybrid-cdn-auth-starter/wphs.adapter.ts +7 -0
  359. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.dev.example +3 -0
  360. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.local.example +6 -0
  361. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.prod.example +5 -0
  362. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.stg.example +3 -0
  363. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.wphs/README.md +17 -0
  364. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/README.md +60 -0
  365. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/hubspot.config.yml.example +10 -0
  366. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/index.html +12 -0
  367. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/package.json +34 -0
  368. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/portal.cdn.json.example +8 -0
  369. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/fields.json +100 -0
  370. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/meta.json +9 -0
  371. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/module.html +38 -0
  372. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/app.tsx +173 -0
  373. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.dev.css +23 -0
  374. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.prod.css +12 -0
  375. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/tailwind.css.config.css +7 -0
  376. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/app-entry.ts +48 -0
  377. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/vendor-entry.ts +28 -0
  378. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  379. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AuthLayout.tsx +7 -0
  380. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/DefaultLayout.tsx +5 -0
  381. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
  382. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  383. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/index.ts +13 -0
  384. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
  385. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
  386. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/section-card.tsx +20 -0
  387. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-nav.tsx +28 -0
  388. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-shell.tsx +18 -0
  389. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Button.tsx +22 -0
  390. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Form.tsx +22 -0
  391. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Input.tsx +12 -0
  392. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Toaster.tsx +5 -0
  393. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/link.tsx +10 -0
  394. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/loader/loader.tsx +18 -0
  395. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/auth-tier.ts +4 -0
  396. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/nav-scaffold.ts +4 -0
  397. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/portal-nav.ts +9 -0
  398. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/router.ts +1 -0
  399. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/routes.ts +10 -0
  400. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/hubSpotContext.ts +57 -0
  401. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/sync-sdk-hub-context.ts +44 -0
  402. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/defaultData.ts +2 -0
  403. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/env.ts +59 -0
  404. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/app-bootstrap-guards.ts +14 -0
  405. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-navigation.ts +81 -0
  406. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-route-paths.ts +29 -0
  407. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session-events.ts +2 -0
  408. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session.ts +26 -0
  409. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/clear-client-auth-session.ts +62 -0
  410. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/components/starter-login.tsx +76 -0
  411. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-email-storage.ts +64 -0
  412. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-session-bridge.ts +72 -0
  413. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/post-login-path.ts +17 -0
  414. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  415. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-post-login-path.ts +21 -0
  416. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-portal-session.ts +25 -0
  417. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-signed-in-email.ts +55 -0
  418. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-guide-page.tsx +210 -0
  419. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home-page.tsx +21 -0
  420. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home.tsx +48 -0
  421. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-page-frame.tsx +25 -0
  422. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-protected-page.tsx +54 -0
  423. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-single-page.tsx +17 -0
  424. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/auth-guide-content.ts +85 -0
  425. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/woodscli-guide-content.ts +86 -0
  426. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/starter-preview-values.ts +60 -0
  427. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  428. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.ts +30 -0
  429. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/index.ts +6 -0
  430. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/bootstrap.ts +16 -0
  431. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/default-data.ts +7 -0
  432. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/is-cms-editor.ts +78 -0
  433. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/module-entry.tsx +9 -0
  434. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/types.ts +17 -0
  435. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/configure-woodsportal-sdk.ts +94 -0
  436. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-query/root-provider.tsx +18 -0
  437. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-router/router.tsx +39 -0
  438. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/woodsportal-sdk.ts +37 -0
  439. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/main.tsx +5 -0
  440. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/api-endpoint.ts +11 -0
  441. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
  442. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-dev-preview.tsx +12 -0
  443. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-portal.tsx +52 -0
  444. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routeTree.gen.ts +134 -0
  445. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/__root.tsx +12 -0
  446. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_app/portal.tsx +10 -0
  447. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_auth/login.tsx +10 -0
  448. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/guide.tsx +9 -0
  449. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/index.tsx +8 -0
  450. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/unauthorized.tsx +50 -0
  451. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/ValidationSchema.ts +1 -0
  452. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/cookie.ts +23 -0
  453. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/normalize-router-path.ts +10 -0
  454. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/private-route.tsx +100 -0
  455. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/public-route.tsx +64 -0
  456. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/resolve-api-base-url.ts +44 -0
  457. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/safe-router-navigation.ts +82 -0
  458. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/tsconfig.json +20 -0
  459. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-app.mjs +1 -0
  460. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-esm.mjs +1 -0
  461. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-vendor.mjs +1 -0
  462. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.dev.mjs +1 -0
  463. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.hubspot.mjs +1 -0
  464. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.monolith.mjs +8 -0
  465. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/woodscli.json +38 -0
  466. package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/wphs.adapter.ts +7 -0
  467. package/examples/greenfield/module-monolith/public/fields.json +66 -16
  468. package/examples/greenfield/module-monolith/src/assets/css/main.dev.css +7 -0
  469. package/examples/greenfield/module-monolith/src/components/layout/starter-nav.tsx +12 -15
  470. package/examples/greenfield/module-monolith/src/config/starter-nav.ts +9 -0
  471. package/examples/greenfield/module-monolith/src/features/starter/components/starter-home.tsx +25 -29
  472. package/examples/greenfield/module-monolith/src/features/starter/hooks/starter-preview-values.ts +60 -0
  473. package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
  474. package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.ts +20 -37
  475. package/examples/manifest.json +5 -1
  476. package/examples/smoke/run-matrix.mjs +37 -0
  477. package/package.json +30 -13
  478. package/scripts/audit-tdz-split.mjs +11 -5
  479. package/scripts/build-cdn.mjs +6 -5
  480. package/scripts/check-cdn-size-regression.mjs +49 -0
  481. package/scripts/check-hubspot-bundle-size.mjs +18 -4
  482. package/scripts/cli-smoke-helpers.mjs +150 -0
  483. package/scripts/dist-cli-pack-smoke.test.mjs +79 -0
  484. package/scripts/ensure-wphs-workspace.mjs +7 -2
  485. package/scripts/generate-cdn-bundle-breakdown.mjs +61 -0
  486. package/scripts/generate-cdn-manifest.mjs +23 -8
  487. package/scripts/portal-vite-env.mjs +76 -2
  488. package/scripts/publish-cdn-github.mjs +79 -14
  489. package/scripts/refresh-artifact-sizes.mjs +77 -0
  490. package/scripts/regenerate-route-tree.mjs +71 -0
  491. package/scripts/resolve-hubspot-cli.mjs +51 -0
  492. package/scripts/resolve-vite-config.mjs +2 -3
  493. package/scripts/resolve-vite-spawn.mjs +48 -0
  494. package/scripts/run-vite-build.mjs +5 -6
  495. package/scripts/sync-auth-scaffold-from-client.mjs +41 -0
  496. package/scripts/verify-cdn-api-endpoint.mjs +17 -10
  497. package/scripts/vite/create-dev-server-config.mjs +7 -1
  498. package/scripts/vite/portal-build-shared.js +62 -2
  499. package/scripts/watch-hubspot.mjs +11 -13
  500. package/scripts/wp-cli-smoke.test.mjs +263 -0
  501. package/src/dev/bootstrap-greenfield.tsx +6 -0
  502. package/src/dev-module-config/ui/module-config-overlay-side.ts +13 -3
  503. package/src/dev-module-config/ui/module-config-toolbar-theme.ts +12 -3
  504. package/templates/module-hybrid-cdn/README.md +2 -1
  505. package/templates/module-hybrid-cdn/public/fields.json +47 -7
  506. package/templates/module-hybrid-cdn/public/module.html +7 -6
  507. package/templates/module-hybrid-cdn/src/assets/css/main.dev.css +7 -0
  508. package/templates/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
  509. package/templates/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
  510. package/templates/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -27
  511. package/templates/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +5 -5
  512. package/templates/module-monolith/README.md +2 -1
  513. package/templates/module-monolith/public/fields.json +49 -6
  514. package/templates/module-monolith/src/assets/css/main.dev.css +7 -0
  515. package/templates/module-monolith/src/components/layout/starter-nav.tsx +12 -15
  516. package/templates/module-monolith/src/config/starter-nav.ts +9 -0
  517. package/templates/module-monolith/src/features/starter/components/starter-home.tsx +25 -27
  518. package/templates/module-monolith/src/features/starter/hooks/starter-preview-values.ts +5 -5
  519. package/templates/scaffold/auth/_full/src/app.tsx +172 -0
  520. package/templates/scaffold/auth/_full/src/config/auth-tier.ts +4 -0
  521. package/templates/scaffold/auth/_full/src/features/auth/auth-session.ts +51 -0
  522. package/templates/scaffold/auth/_full/src/features/auth/components/starter-login.tsx +79 -0
  523. package/templates/scaffold/auth/_full/src/features/auth/login-session-bridge.ts +74 -0
  524. package/templates/scaffold/auth/_full/src/features/auth/mfa-otp-utils.ts +24 -0
  525. package/templates/scaffold/auth/_full/src/features/auth/mfa-pending-storage.ts +108 -0
  526. package/templates/scaffold/auth/_full/src/features/auth/mfa-portal.ts +45 -0
  527. package/templates/scaffold/auth/_full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
  528. package/templates/scaffold/auth/_full/src/routeTree.gen.ts +182 -0
  529. package/templates/scaffold/auth/_full/src/routes/_auth/two-fa.tsx +91 -0
  530. package/templates/scaffold/auth/_nav-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
  531. package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
  532. package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
  533. package/templates/scaffold/auth/_nav-top/src/components/Layouts/MainLayout.tsx +42 -0
  534. package/templates/scaffold/auth/_shared/src/app.tsx +178 -0
  535. package/templates/scaffold/auth/_shared/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
  536. package/templates/scaffold/auth/_shared/src/components/Layouts/AuthLayout.tsx +7 -0
  537. package/templates/scaffold/auth/_shared/src/components/Layouts/DefaultLayout.tsx +5 -0
  538. package/templates/scaffold/auth/_shared/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
  539. package/templates/scaffold/auth/_shared/src/components/Layouts/index.ts +13 -0
  540. package/templates/scaffold/auth/_shared/src/components/ui/Button.tsx +22 -0
  541. package/templates/scaffold/auth/_shared/src/components/ui/Form.tsx +22 -0
  542. package/templates/scaffold/auth/_shared/src/components/ui/Input.tsx +12 -0
  543. package/templates/scaffold/auth/_shared/src/components/ui/Toaster.tsx +5 -0
  544. package/templates/scaffold/auth/_shared/src/components/ui/link.tsx +10 -0
  545. package/templates/scaffold/auth/_shared/src/components/ui/loader/loader.tsx +18 -0
  546. package/templates/scaffold/auth/_shared/src/config/auth-tier.ts +4 -0
  547. package/templates/scaffold/auth/_shared/src/config/nav-scaffold.ts +4 -0
  548. package/templates/scaffold/auth/_shared/src/config/portal-nav.ts +9 -0
  549. package/templates/scaffold/auth/_shared/src/config/router.ts +1 -0
  550. package/templates/scaffold/auth/_shared/src/config/routes.ts +10 -0
  551. package/templates/scaffold/auth/_shared/src/data/hubSpotContext.ts +57 -0
  552. package/templates/scaffold/auth/_shared/src/data/sync-sdk-hub-context.ts +44 -0
  553. package/templates/scaffold/auth/_shared/src/env.ts +59 -0
  554. package/templates/scaffold/auth/_shared/src/features/auth/app-bootstrap-guards.ts +14 -0
  555. package/templates/scaffold/auth/_shared/src/features/auth/auth-navigation.ts +81 -0
  556. package/templates/scaffold/auth/_shared/src/features/auth/auth-route-paths.ts +29 -0
  557. package/templates/scaffold/auth/_shared/src/features/auth/auth-session-events.ts +2 -0
  558. package/templates/scaffold/auth/_shared/src/features/auth/auth-session.ts +26 -0
  559. package/templates/scaffold/auth/_shared/src/features/auth/clear-client-auth-session.ts +62 -0
  560. package/templates/scaffold/auth/_shared/src/features/auth/components/starter-login.tsx +83 -0
  561. package/templates/scaffold/auth/_shared/src/features/auth/login-email-storage.ts +64 -0
  562. package/templates/scaffold/auth/_shared/src/features/auth/login-session-bridge.ts +72 -0
  563. package/templates/scaffold/auth/_shared/src/features/auth/post-login-path.ts +17 -0
  564. package/templates/scaffold/auth/_shared/src/features/auth/resolve-auth-login-error-message.ts +52 -0
  565. package/templates/scaffold/auth/_shared/src/features/auth/resolve-post-login-path.ts +21 -0
  566. package/templates/scaffold/auth/_shared/src/features/auth/use-portal-session.ts +25 -0
  567. package/templates/scaffold/auth/_shared/src/features/auth/use-signed-in-email.ts +55 -0
  568. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-guide-page.tsx +218 -0
  569. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-page-frame.tsx +25 -0
  570. package/templates/scaffold/auth/_shared/src/features/starter/components/starter-protected-page.tsx +54 -0
  571. package/templates/scaffold/auth/_shared/src/features/starter/content/auth-guide-content.ts +91 -0
  572. package/templates/scaffold/auth/_shared/src/hubspot/is-cms-editor.ts +78 -0
  573. package/templates/scaffold/auth/_shared/src/integrations/configure-woodsportal-sdk.ts +100 -0
  574. package/templates/scaffold/auth/_shared/src/integrations/tanstack-query/root-provider.tsx +18 -0
  575. package/templates/scaffold/auth/_shared/src/integrations/tanstack-router/router.tsx +39 -0
  576. package/templates/scaffold/auth/_shared/src/integrations/woodsportal-sdk.ts +37 -0
  577. package/templates/scaffold/auth/_shared/src/portal/mount-portal.tsx +59 -0
  578. package/templates/scaffold/auth/_shared/src/routeTree.gen.ts +134 -0
  579. package/templates/scaffold/auth/_shared/src/routes/__root.tsx +12 -0
  580. package/templates/scaffold/auth/_shared/src/routes/_app/portal.tsx +10 -0
  581. package/templates/scaffold/auth/_shared/src/routes/_auth/login.tsx +10 -0
  582. package/templates/scaffold/auth/_shared/src/routes/guide.tsx +9 -0
  583. package/templates/scaffold/auth/_shared/src/routes/index.tsx +8 -0
  584. package/templates/scaffold/auth/_shared/src/routes/unauthorized.tsx +50 -0
  585. package/templates/scaffold/auth/_shared/src/utils/ValidationSchema.ts +1 -0
  586. package/templates/scaffold/auth/_shared/src/utils/cookie.ts +23 -0
  587. package/templates/scaffold/auth/_shared/src/utils/normalize-router-path.ts +10 -0
  588. package/templates/scaffold/auth/_shared/src/utils/private-route.tsx +100 -0
  589. package/templates/scaffold/auth/_shared/src/utils/public-route.tsx +64 -0
  590. package/templates/scaffold/auth/_shared/src/utils/resolve-api-base-url.ts +44 -0
  591. package/templates/scaffold/auth/_shared/src/utils/safe-router-navigation.ts +82 -0
  592. package/templates/scaffold/auth/_sso/src/app.tsx +180 -0
  593. package/templates/scaffold/auth/_sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
  594. package/templates/scaffold/auth/_sso/src/config/auth-tier.ts +4 -0
  595. package/templates/scaffold/auth/_sso/src/features/auth/components/starter-login.tsx +90 -0
  596. package/templates/scaffold/auth/_sso/src/features/auth/sso-callback.ts +126 -0
  597. package/templates/scaffold/auth/_sso/src/features/auth/use-sso-callback-handler.ts +92 -0
  598. package/templates/scaffold/auth/_sso/src/routeTree.gen.ts +155 -0
  599. package/templates/scaffold/auth/_sso/src/routes/_auth/login/sso.tsx +27 -0
  600. package/templates/scaffold/auth/nav-manifest.json +8 -0
  601. package/templates/scaffold/auth/sync-manifest.json +16 -0
  602. package/templates/scaffold/auth/tier-manifest.json +18 -0
  603. package/templates/scaffold/page/page-component-auth.tsx.tpl +10 -0
  604. package/templates/scaffold/page/page-component-plain.tsx.tpl +11 -0
  605. package/templates/scaffold/page/route-protected-auth.tsx.tpl +10 -0
  606. package/templates/scaffold/page/route-public-auth.tsx.tpl +9 -0
  607. package/templates/scaffold/page/route-public-plain.tsx.tpl +6 -0
  608. package/vite/vite.config.cdn-app.mjs +43 -30
  609. package/vite/vite.config.cdn-audit.mjs +34 -0
  610. package/vite/vite.config.cdn-esm.mjs +1 -1
  611. package/dist/chunk-4GOJPOW3.js.map +0 -1
  612. package/dist/chunk-S2YJDWZU.js.map +0 -1
  613. /package/dist/{exec-VY6BGWF3.js.map → exec-NS4GKXZS.js.map} +0 -0
@@ -0,0 +1,150 @@
1
+ import { spawnSync } from 'node:child_process'
2
+ import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
3
+ import { tmpdir } from 'node:os'
4
+ import { dirname, join, resolve } from 'node:path'
5
+ import { fileURLToPath } from 'node:url'
6
+
7
+ export const kitRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
8
+ export const cliEntry = join(kitRoot, 'src/cli/index.ts')
9
+
10
+ const LEGACY_SHIM_SCRIPTS = [
11
+ 'build-cdn.mjs',
12
+ 'run-vite-build.mjs',
13
+ 'run-hubspot-module-postbuild.mjs',
14
+ 'watch-hubspot.mjs',
15
+ ]
16
+
17
+ const FIXTURE_PATHS = {
18
+ 'greenfield/module-hybrid-cdn': join(kitRoot, 'examples/greenfield/module-hybrid-cdn'),
19
+ 'greenfield/module-hybrid-cdn-auth-starter': join(
20
+ kitRoot,
21
+ 'examples/greenfield/module-hybrid-cdn-auth-starter',
22
+ ),
23
+ 'fixtures/adopted-module-monolith': join(kitRoot, 'examples/fixtures/adopted-module-monolith'),
24
+ }
25
+
26
+ /**
27
+ * @param {string | null | undefined} projectRoot
28
+ * @param {string[]} args
29
+ * @param {{ skipProject?: boolean; cwd?: string; extraEnv?: Record<string, string> }} [opts]
30
+ */
31
+ export function runWp(projectRoot, args, opts = {}) {
32
+ const globalFlags = opts.skipProject
33
+ ? ['--ci', '-y']
34
+ : ['--project', projectRoot, '--ci', '-y']
35
+
36
+ return spawnSync(
37
+ process.execPath,
38
+ ['--import', 'tsx', cliEntry, ...globalFlags, ...args],
39
+ {
40
+ cwd: opts.cwd ?? kitRoot,
41
+ encoding: 'utf8',
42
+ env: { ...process.env, NO_COLOR: '1', ...opts.extraEnv },
43
+ },
44
+ )
45
+ }
46
+
47
+ /**
48
+ * @param {string} stdout
49
+ */
50
+ export function parseJsonLine(stdout) {
51
+ const lines = stdout
52
+ .split('\n')
53
+ .map((line) => line.trim())
54
+ .filter(Boolean)
55
+ for (let i = lines.length - 1; i >= 0; i -= 1) {
56
+ const line = lines[i]
57
+ if (!line.startsWith('{')) continue
58
+ try {
59
+ return JSON.parse(line)
60
+ } catch {
61
+ // continue
62
+ }
63
+ }
64
+ throw new Error(`No JSON line found in stdout:\n${stdout}`)
65
+ }
66
+
67
+ /**
68
+ * @param {string} fixtureKey
69
+ * @param {string} targetDir
70
+ */
71
+ export function copyFixture(fixtureKey, targetDir) {
72
+ const source = FIXTURE_PATHS[fixtureKey]
73
+ if (!source || !existsSync(source)) {
74
+ throw new Error(`Unknown or missing fixture: ${fixtureKey}`)
75
+ }
76
+ cpSync(source, targetDir, { recursive: true })
77
+ }
78
+
79
+ /**
80
+ * @param {string} fixtureKey
81
+ * @param {(dir: string) => void | Promise<void>} fn
82
+ */
83
+ export async function withTempFixture(fixtureKey, fn) {
84
+ const dir = mkdtempSync(join(tmpdir(), 'wphs-cli-fixture-'))
85
+ try {
86
+ copyFixture(fixtureKey, dir)
87
+ await fn(dir)
88
+ } finally {
89
+ rmSync(dir, { recursive: true, force: true })
90
+ }
91
+ }
92
+
93
+ /**
94
+ * @param {string} dir
95
+ */
96
+ export function seedModuleBuildId(dir) {
97
+ writeFileSync(join(dir, '.module-build-id'), '# baseline\nv0.0.1-dev\n')
98
+ }
99
+
100
+ /**
101
+ * CDN build/deploy dry-runs need baseline + dev slug (no git user.name in CI).
102
+ * @param {string} dir
103
+ */
104
+ export function seedCdnBuildPrereqs(dir) {
105
+ seedModuleBuildId(dir)
106
+ const configDir = join(dir, '.wphs', 'config')
107
+ mkdirSync(configDir, { recursive: true })
108
+ writeFileSync(join(configDir, 'developer.json'), `${JSON.stringify({ slug: 'cli-smoke' }, null, 2)}\n`)
109
+ }
110
+
111
+ /**
112
+ * @param {string} dir
113
+ */
114
+ export function seedHubspotConfig(dir) {
115
+ writeFileSync(
116
+ join(dir, 'hubspot.config.yml'),
117
+ `defaultPortal: dev
118
+ portals:
119
+ - name: dev
120
+ portalId: 12345
121
+ `,
122
+ )
123
+ }
124
+
125
+ /**
126
+ * @param {string} dir
127
+ */
128
+ export function seedRegressionShims(dir) {
129
+ const scriptsDir = join(dir, 'scripts')
130
+ mkdirSync(scriptsDir, { recursive: true })
131
+ for (const script of LEGACY_SHIM_SCRIPTS) {
132
+ cpSync(join(kitRoot, 'scripts', script), join(scriptsDir, script))
133
+ }
134
+ }
135
+
136
+ /**
137
+ * @param {number | number[]} expected
138
+ * @param {import('node:child_process').SpawnSyncReturns<string>} result
139
+ * @param {string} label
140
+ */
141
+ export function assertExit(expected, result, label) {
142
+ const allowed = Array.isArray(expected) ? expected : [expected]
143
+ if (allowed.includes(result.status ?? -1)) {
144
+ return
145
+ }
146
+ const detail = [result.stderr, result.stdout].filter(Boolean).join('\n')
147
+ throw new Error(
148
+ `${label}: expected exit ${allowed.join(' or ')}, got ${result.status}\n${detail}`,
149
+ )
150
+ }
@@ -0,0 +1,79 @@
1
+ import assert from 'node:assert/strict'
2
+ import { spawnSync } from 'node:child_process'
3
+ import { existsSync, mkdtempSync, rmSync } from 'node:fs'
4
+ import { tmpdir } from 'node:os'
5
+ import { join, resolve } from 'node:path'
6
+ import { test } from 'node:test'
7
+
8
+ import { copyFixture, kitRoot } from './cli-smoke-helpers.mjs'
9
+
10
+ const distCli = join(kitRoot, 'dist/cli.js')
11
+
12
+ test('dist cli: doctor scaffolds .wphs without SyntaxError', () => {
13
+ if (!existsSync(distCli)) {
14
+ console.log('skip: dist/cli.js missing — run npm run build first')
15
+ return
16
+ }
17
+
18
+ const dir = mkdtempSync(join(tmpdir(), 'wphs-dist-pack-'))
19
+ try {
20
+ copyFixture('greenfield/module-hybrid-cdn', dir)
21
+ const result = spawnSync(
22
+ process.execPath,
23
+ [distCli, '--project', dir, '--ci', '-y', 'doctor'],
24
+ {
25
+ cwd: kitRoot,
26
+ encoding: 'utf8',
27
+ env: { ...process.env, NO_COLOR: '1', WP_SKIP_VERSION_CHECK: '1' },
28
+ },
29
+ )
30
+
31
+ const combined = `${result.stdout}\n${result.stderr}`
32
+ assert.doesNotMatch(combined, /Invalid or unexpected token/)
33
+ assert.ok(
34
+ result.status === 0 || result.status === 2,
35
+ `unexpected exit ${result.status}: ${combined}`,
36
+ )
37
+ assert.ok(existsSync(resolve(dir, '.wphs', 'config')), 'expected .wphs/config after doctor')
38
+ } finally {
39
+ rmSync(dir, { recursive: true, force: true })
40
+ }
41
+ })
42
+
43
+ test('dist cli: init dry-run completes without SyntaxError', () => {
44
+ if (!existsSync(distCli)) {
45
+ console.log('skip: dist/cli.js missing — run npm run build first')
46
+ return
47
+ }
48
+
49
+ const targetDir = mkdtempSync(join(tmpdir(), 'wphs-dist-init-'))
50
+ try {
51
+ const result = spawnSync(
52
+ process.execPath,
53
+ [
54
+ distCli,
55
+ '--ci',
56
+ '-y',
57
+ '--dry-run',
58
+ 'init',
59
+ '-t',
60
+ 'module-hybrid-cdn',
61
+ '-n',
62
+ 'dist-init-smoke',
63
+ '--directory',
64
+ targetDir,
65
+ ],
66
+ {
67
+ cwd: kitRoot,
68
+ encoding: 'utf8',
69
+ env: { ...process.env, NO_COLOR: '1', WP_SKIP_VERSION_CHECK: '1' },
70
+ },
71
+ )
72
+
73
+ const combined = `${result.stdout}\n${result.stderr}`
74
+ assert.doesNotMatch(combined, /Invalid or unexpected token/)
75
+ assert.equal(result.status, 0, combined)
76
+ } finally {
77
+ rmSync(targetDir, { recursive: true, force: true })
78
+ }
79
+ })
@@ -1,8 +1,9 @@
1
- #!/usr/bin/env node
2
1
  /**
3
2
  * Scaffold WoodsCLI `.wphs/` workspace + kit symlinks.
4
3
  */
5
4
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs'
5
+ import { resolve } from 'node:path'
6
+ import { fileURLToPath } from 'node:url'
6
7
 
7
8
  import { findProjectRoot, getKitRoot } from './project-root.mjs'
8
9
  import { wphsPaths, wphsWorkspaceSubdirs } from './wphs-paths.mjs'
@@ -48,7 +49,11 @@ export function ensureWphsWorkspace(projectRoot, kitRoot) {
48
49
  return paths
49
50
  }
50
51
 
51
- if (import.meta.url === `file://${process.argv[1]}`) {
52
+ const invokedDirectly =
53
+ process.argv[1] &&
54
+ resolve(fileURLToPath(import.meta.url)) === resolve(process.argv[1])
55
+
56
+ if (invokedDirectly) {
52
57
  const paths = ensureWphsWorkspace()
53
58
  console.log(`[wphs] workspace ready at ${paths.workspaceRoot}`)
54
59
  }
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Write docs/audit/CDN-BUNDLE-BREAKDOWN.md from cdn-bundle-visualizer.json (rollup-plugin-visualizer v2).
4
+ */
5
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
6
+ import { resolve } from 'node:path'
7
+ import { findProjectRoot } from './project-root.mjs'
8
+
9
+ const root = findProjectRoot()
10
+ const jsonPath = resolve(root, 'docs/audit/cdn-bundle-visualizer.json')
11
+ const outPath = resolve(root, 'docs/audit/CDN-BUNDLE-BREAKDOWN.md')
12
+
13
+ if (!existsSync(jsonPath)) {
14
+ console.error(
15
+ `[cdn-breakdown] Missing ${jsonPath} — run: yarn audit:cdn-bundle`,
16
+ )
17
+ process.exit(1)
18
+ }
19
+
20
+ const data = JSON.parse(readFileSync(jsonPath, 'utf8'))
21
+ const { nodeParts = {}, nodeMetas = {} } = data
22
+
23
+ const leaves = Object.entries(nodeParts)
24
+ .map(([uid, part]) => {
25
+ const meta = nodeMetas[uid] ?? {}
26
+ return {
27
+ name: meta.id ?? uid,
28
+ gzipSize: part.gzipSize ?? 0,
29
+ renderedLength: part.renderedLength ?? 0,
30
+ }
31
+ })
32
+ .filter((n) => n.renderedLength > 0)
33
+ .sort((a, b) => b.gzipSize - a.gzipSize)
34
+
35
+ const top = leaves.slice(0, 15)
36
+ const generatedAt = new Date().toISOString()
37
+
38
+ const lines = [
39
+ '# CDN app bundle breakdown',
40
+ '',
41
+ `Generated: ${generatedAt}`,
42
+ '',
43
+ 'Source: `yarn audit:cdn-bundle` → `docs/audit/cdn-bundle-visualizer.json`',
44
+ '',
45
+ 'Top 15 modules by gzip size (CDN app graph):',
46
+ '',
47
+ '| Rank | Module | Gzip (KiB) | Raw (KiB) |',
48
+ '|------|--------|------------|-----------|',
49
+ ]
50
+
51
+ top.forEach((node, i) => {
52
+ const gzip = node.gzipSize / 1024
53
+ const raw = node.renderedLength / 1024
54
+ const name = String(node.name).replace(/\|/g, '\\|')
55
+ lines.push(`| ${i + 1} | \`${name}\` | ${gzip.toFixed(1)} | ${raw.toFixed(1)} |`)
56
+ })
57
+
58
+ lines.push('', 'See also: [BUNDLE-STRATEGY.md](../BUNDLE-STRATEGY.md), [artifact-sizes.json](./artifact-sizes.json).')
59
+
60
+ writeFileSync(outPath, `${lines.join('\n')}\n`)
61
+ console.log(`[cdn-breakdown] wrote ${outPath}`)
@@ -15,7 +15,7 @@ const cdnDir = resolve(root, 'dist/cdn')
15
15
  const buildId = portalBuildId()
16
16
 
17
17
  function fileMetrics(file) {
18
- const path = resolve(cdnDir, file)
18
+ const path = resolve(cdnDir, file.replace(/^\//, ''))
19
19
  const raw = readFileSync(path)
20
20
  return {
21
21
  file,
@@ -24,17 +24,31 @@ function fileMetrics(file) {
24
24
  }
25
25
  }
26
26
 
27
- const jsFiles = readdirSync(cdnDir)
28
- .filter((f) => f.endsWith('.js'))
29
- .map((file) => {
27
+ function scriptEntry(file) {
28
+ if (file.startsWith('vendor.')) {
29
+ return { name: 'vendor', order: 1, preload: true }
30
+ }
31
+ if (file.startsWith('app.') && !file.includes('/')) {
32
+ return { name: 'app', order: 2, preload: true }
33
+ }
34
+ if (file.startsWith('chunks/')) {
35
+ return { name: file.replace(/^chunks\//, ''), order: 99, preload: false }
36
+ }
37
+ return { name: file, order: 99, preload: false }
38
+ }
39
+
40
+ const jsFiles = readdirSync(cdnDir, { recursive: true })
41
+ .filter((f) => String(f).endsWith('.js'))
42
+ .map((rel) => {
43
+ const file = String(rel)
30
44
  const metrics = fileMetrics(file)
45
+ const entry = scriptEntry(file)
31
46
  return {
32
47
  ...metrics,
33
- name: file.startsWith('vendor.') ? 'vendor' : file.startsWith('app.') ? 'app' : file,
34
- order: file.startsWith('vendor.') ? 1 : file.startsWith('app.') ? 2 : 99,
48
+ ...entry,
35
49
  }
36
50
  })
37
- .sort((a, b) => a.order - b.order)
51
+ .sort((a, b) => a.order - b.order || a.file.localeCompare(b.file))
38
52
 
39
53
  const cssFiles = readdirSync(cdnDir)
40
54
  .filter((f) => f.endsWith('.css'))
@@ -64,10 +78,11 @@ const manifest = {
64
78
  buildId,
65
79
  baseUrl: resolveCdnBaseUrl(),
66
80
  publishMode: process.env.VITE_PORTAL_CDN_PUBLISH_MODE ?? 'jsdelivr',
67
- scripts: jsFiles.map(({ name, file, order, rawBytes, gzipBytes }) => ({
81
+ scripts: jsFiles.map(({ name, file, order, preload, rawBytes, gzipBytes }) => ({
68
82
  name,
69
83
  file,
70
84
  order,
85
+ preload,
71
86
  rawBytes,
72
87
  gzipBytes,
73
88
  url: `${resolveCdnBaseUrl()}/${file}`,
@@ -1,17 +1,91 @@
1
1
  /**
2
- * Vite env for HubSpot/CDN builds — .env.[mode] wins over stale shell VITE_* vars.
2
+ * Vite env for HubSpot/CDN builds — .env.[mode] wins over stale shell / .env.local VITE_* vars.
3
3
  */
4
+ import { existsSync, readFileSync } from 'node:fs'
5
+ import { resolve } from 'node:path'
4
6
  import { loadEnv } from 'vite'
5
7
  import { envWithPortalBuildId } from './resolve-portal-build-id.mjs'
6
8
  import { envWithPortalCdnConfig } from './load-portal-cdn-config.mjs'
7
9
 
10
+ /** @param {string} content */
11
+ export function parseEnvFile(content) {
12
+ const result = {}
13
+ for (const line of content.split('\n')) {
14
+ const trimmed = line.trim()
15
+ if (!trimmed || trimmed.startsWith('#')) continue
16
+ const eq = trimmed.indexOf('=')
17
+ if (eq <= 0) continue
18
+ const key = trimmed.slice(0, eq).trim()
19
+ let value = trimmed.slice(eq + 1).trim()
20
+ if (
21
+ (value.startsWith('"') && value.endsWith('"')) ||
22
+ (value.startsWith("'") && value.endsWith("'"))
23
+ ) {
24
+ value = value.slice(1, -1)
25
+ }
26
+ result[key] = value
27
+ }
28
+ return result
29
+ }
30
+
31
+ /** @param {'local' | 'dev' | 'stg' | 'prod'} mode @param {string} root */
32
+ export function readPortalTierEnvFile(mode, root) {
33
+ const path = resolve(root, `.env.${mode}`)
34
+ if (!existsSync(path)) return {}
35
+ return parseEnvFile(readFileSync(path, 'utf8'))
36
+ }
37
+
38
+ function stashViteProcessEnv() {
39
+ const stashed = {}
40
+ for (const key of Object.keys(process.env)) {
41
+ if (key.startsWith('VITE_')) {
42
+ stashed[key] = process.env[key]
43
+ delete process.env[key]
44
+ }
45
+ }
46
+ return stashed
47
+ }
48
+
49
+ /** @param {Record<string, string | undefined>} stashed */
50
+ function restoreViteProcessEnv(stashed) {
51
+ for (const [key, value] of Object.entries(stashed)) {
52
+ if (value != null) process.env[key] = value
53
+ }
54
+ }
55
+
56
+ /** loadEnv without shell / .env.local VITE_* polluting tier resolution */
57
+ /** @param {'local' | 'dev' | 'stg' | 'prod'} mode @param {string} root */
58
+ export function loadPortalFileEnv(mode, root) {
59
+ const stashed = stashViteProcessEnv()
60
+ try {
61
+ return loadEnv(mode, root, '')
62
+ } finally {
63
+ restoreViteProcessEnv(stashed)
64
+ }
65
+ }
66
+
67
+ /**
68
+ * API URL baked into CDN bundles for a deploy tier — reads `.env.[mode]` only.
69
+ * @param {'local' | 'dev' | 'stg' | 'prod'} mode
70
+ * @param {string} root
71
+ */
72
+ export function resolveTierApiEndpoint(mode, root) {
73
+ const tier = readPortalTierEnvFile(mode, root)
74
+ const fromTier = tier.VITE_PUBLIC_REST_API_ENDPOINT
75
+ if (fromTier) return fromTier.replace(/\/$/, '')
76
+ const fromFile = loadPortalFileEnv(mode, root).VITE_PUBLIC_REST_API_ENDPOINT
77
+ const fromCi =
78
+ process.env.WOODPORTAL_API_BASE_URL || process.env.VITE_PUBLIC_REST_API_ENDPOINT
79
+ return (fromFile || fromCi)?.replace(/\/$/, '')
80
+ }
81
+
8
82
  /**
9
83
  * @param {'local' | 'dev' | 'stg' | 'prod'} mode
10
84
  * @param {string} root
11
85
  * @param {NodeJS.ProcessEnv} [extra]
12
86
  */
13
87
  export function envForPortalBuild(mode, root, extra = {}) {
14
- const fileEnv = loadEnv(mode, root, '')
88
+ const fileEnv = loadPortalFileEnv(mode, root)
15
89
  const base = { ...process.env }
16
90
 
17
91
  for (const key of Object.keys(base)) {
@@ -98,6 +98,9 @@ function authRemote(remote, token) {
98
98
  function copyCdnArtifacts(sourceDir, targetDir) {
99
99
  mkdirSync(targetDir, { recursive: true })
100
100
  for (const entry of readdirSync(sourceDir)) {
101
+ if (entry.endsWith('.map')) {
102
+ fail(`Refusing to publish source map: ${entry}`)
103
+ }
101
104
  const src = join(sourceDir, entry)
102
105
  const dest = join(targetDir, entry)
103
106
  rmSync(dest, { recursive: true, force: true })
@@ -152,22 +155,81 @@ async function assertGithubRepoPublic(github) {
152
155
  }
153
156
  }
154
157
 
155
- async function checkJsDelivr(config, vendorFile, appFile, appCssFile) {
156
- const base = jsDelivrBaseUrl(config.github, config.cdnPathInRepo, config.defaultBranch)
157
- for (const file of [appCssFile, vendorFile, appFile]) {
158
- const url = `${base}/${file}`
159
- log(`Checking jsDelivr (may take a minute on first publish): ${url}`)
160
- try {
161
- const res = await fetch(url, { method: 'HEAD' })
162
- if (res.ok) {
163
- log(` OK ${res.status} ${file}`)
164
- } else {
165
- log(` ${file} → HTTP ${res.status} (jsDelivr may still be propagating — wait 5–15 min)`)
158
+ async function headJsDelivrFile(base, file, { required = false } = {}) {
159
+ const url = `${base}/${file}`
160
+ log(`Checking jsDelivr (may take a minute on first publish): ${url}`)
161
+ try {
162
+ const res = await fetch(url, { method: 'HEAD' })
163
+ if (res.ok) {
164
+ log(` OK ${res.status} ${file}`)
165
+ return true
166
+ }
167
+ const msg = `${file} → HTTP ${res.status}${required ? '' : ' (jsDelivr may still be propagating — wait 5–15 min)'}`
168
+ if (required) {
169
+ fail(msg)
170
+ }
171
+ log(` ${msg}`)
172
+ return false
173
+ } catch (err) {
174
+ const msg = `Could not reach jsDelivr for ${file}: ${err.message}`
175
+ if (required) {
176
+ fail(msg)
177
+ }
178
+ log(` ${msg}`)
179
+ return false
180
+ }
181
+ }
182
+
183
+ async function headJsDelivrFiles(base, files, { required = false, concurrency = 5 } = {}) {
184
+ if (files.length === 0) {
185
+ return { ok: true, failed: [] }
186
+ }
187
+ log(`Checking ${files.length} lazy chunk(s) on jsDelivr`)
188
+ const failed = []
189
+ for (let i = 0; i < files.length; i += concurrency) {
190
+ const batch = files.slice(i, i + concurrency)
191
+ const results = await Promise.all(
192
+ batch.map(async (file) => {
193
+ const ok = await headJsDelivrFile(base, file, { required: false })
194
+ return { file, ok }
195
+ }),
196
+ )
197
+ for (const result of results) {
198
+ if (!result.ok) {
199
+ failed.push(result.file)
166
200
  }
167
- } catch (err) {
168
- log(` Could not reach jsDelivr for ${file}: ${err.message}`)
169
201
  }
170
202
  }
203
+ if (failed.length > 0) {
204
+ const msg = `jsDelivr lazy chunk(s) not reachable: ${failed.join(', ')}`
205
+ if (required) {
206
+ fail(msg)
207
+ }
208
+ log(` ${msg}`)
209
+ }
210
+ return { ok: failed.length === 0, failed }
211
+ }
212
+
213
+ async function checkJsDelivr(config, vendorFile, appFile, appCssFile, lazyChunkFiles = []) {
214
+ const base = jsDelivrBaseUrl(config.github, config.cdnPathInRepo, config.defaultBranch)
215
+ for (const file of [appCssFile, vendorFile, appFile]) {
216
+ await headJsDelivrFile(base, file)
217
+ }
218
+ if (lazyChunkFiles.length > 0) {
219
+ await headJsDelivrFiles(base, lazyChunkFiles, { required: true })
220
+ } else {
221
+ log(' No lazy chunks/ in manifest — skipping lazy chunk HEAD check')
222
+ }
223
+ }
224
+
225
+ function readLazyChunkFilesFromManifest(manifestPath) {
226
+ if (!existsSync(manifestPath)) {
227
+ return []
228
+ }
229
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
230
+ return (manifest.scripts ?? [])
231
+ .map((entry) => entry?.file)
232
+ .filter((file) => typeof file === 'string' && file.startsWith('chunks/'))
171
233
  }
172
234
 
173
235
  const config = loadPortalCdnConfig()
@@ -331,6 +393,9 @@ log(' yarn build:hubspot:prod # prod API')
331
393
  log(' 3. yarn upload:hubspot')
332
394
  log(' Or: yarn deploy:dev | yarn deploy:prod')
333
395
 
396
+ const manifestPath = join(sourceCdn, 'manifest.json')
397
+ const lazyChunkFiles = readLazyChunkFilesFromManifest(manifestPath)
398
+
334
399
  if (!skipJsDelivrCheck) {
335
- await checkJsDelivr(config, vendorFile, appFile, appCssFile)
400
+ await checkJsDelivr(config, vendorFile, appFile, appCssFile, lazyChunkFiles)
336
401
  }
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Refresh docs/audit/artifact-sizes.json from dist/cdn + HubSpot module output.
4
+ */
5
+ import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs'
6
+ import { resolve, join } from 'node:path'
7
+ import { gzipSync } from 'node:zlib'
8
+ import { findProjectRoot } from './project-root.mjs'
9
+ import { moduleOutDir, readWoodsportalConfig } from './read-woodsportal-config.mjs'
10
+
11
+ const root = findProjectRoot()
12
+ const { config } = readWoodsportalConfig(root)
13
+
14
+ function metrics(path) {
15
+ const raw = readFileSync(path)
16
+ const gzip = gzipSync(raw)
17
+ return {
18
+ rawBytes: raw.length,
19
+ gzipBytes: gzip.length,
20
+ rawMiB: Number((raw.length / (1024 * 1024)).toFixed(3)),
21
+ gzipKiB: Number((gzip.length / 1024).toFixed(1)),
22
+ overValidationLimit: raw.length > 1.5 * 1024 * 1024,
23
+ }
24
+ }
25
+
26
+ function walkJs(dir, prefix = '') {
27
+ const out = []
28
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
29
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name
30
+ const full = join(dir, entry.name)
31
+ if (entry.isDirectory()) {
32
+ out.push(...walkJs(full, rel))
33
+ } else if (entry.name.endsWith('.js')) {
34
+ out.push(rel)
35
+ }
36
+ }
37
+ return out
38
+ }
39
+
40
+ const moduleDir = moduleOutDir(root)
41
+ const cdnDir = resolve(root, 'dist/cdn')
42
+ const artifacts = {}
43
+
44
+ for (const name of ['module.js', 'module.css', 'module.html', 'fields.json']) {
45
+ const p = resolve(moduleDir, name)
46
+ if (existsSync(p)) {
47
+ artifacts[name] = metrics(p)
48
+ }
49
+ }
50
+
51
+ const cdn = {}
52
+ if (existsSync(cdnDir)) {
53
+ let manifest = null
54
+ const manifestPath = resolve(cdnDir, 'manifest.json')
55
+ if (existsSync(manifestPath)) {
56
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'))
57
+ cdn['manifest.json'] = { generatedAt: manifest.generatedAt, buildId: manifest.buildId }
58
+ }
59
+ for (const file of walkJs(cdnDir)) {
60
+ cdn[file] = metrics(resolve(cdnDir, file))
61
+ }
62
+ for (const file of readdirSync(cdnDir).filter((f) => f.endsWith('.css'))) {
63
+ cdn[file] = metrics(resolve(cdnDir, file))
64
+ }
65
+ }
66
+
67
+ const doc = {
68
+ generatedAt: new Date().toISOString(),
69
+ embedMode: 'cdn',
70
+ hubspotLimits: { validationMiB: 1.5, bufferMiB: 2 },
71
+ artifacts,
72
+ cdn,
73
+ }
74
+
75
+ const outPath = resolve(root, 'docs/audit/artifact-sizes.json')
76
+ writeFileSync(outPath, JSON.stringify(doc, null, 2))
77
+ console.log(`[artifact-sizes] wrote ${outPath}`)