bsmnt 0.4.3 → 0.5.0

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 (187) hide show
  1. package/dist/application/add-integration/index.d.ts +24 -6
  2. package/dist/application/add-integration/index.d.ts.map +1 -1
  3. package/dist/application/add-integration/index.js +130 -82
  4. package/dist/application/add-integration/index.js.map +1 -1
  5. package/dist/application/create-project/map-selection-to-registry.js +1 -1
  6. package/dist/application/create-project/map-selection-to-registry.js.map +1 -1
  7. package/dist/application/shared/project-detection.d.ts +2 -2
  8. package/dist/application/shared/project-detection.d.ts.map +1 -1
  9. package/dist/application/shared/project-detection.js +2 -2
  10. package/dist/application/shared/project-detection.js.map +1 -1
  11. package/dist/core/create/internal-ids.d.ts +4 -1
  12. package/dist/core/create/internal-ids.d.ts.map +1 -1
  13. package/dist/core/create/internal-ids.js +6 -1
  14. package/dist/core/create/internal-ids.js.map +1 -1
  15. package/dist/domain/cms.d.ts +0 -7
  16. package/dist/domain/cms.d.ts.map +1 -1
  17. package/dist/domain/cms.js.map +1 -1
  18. package/dist/domain/forms.d.ts +17 -0
  19. package/dist/domain/forms.d.ts.map +1 -0
  20. package/dist/domain/forms.js +13 -0
  21. package/dist/domain/forms.js.map +1 -0
  22. package/dist/domain/integration.d.ts +30 -0
  23. package/dist/domain/integration.d.ts.map +1 -0
  24. package/dist/domain/integration.js +12 -0
  25. package/dist/domain/integration.js.map +1 -0
  26. package/dist/domain/skills.d.ts +32 -0
  27. package/dist/domain/skills.d.ts.map +1 -1
  28. package/dist/domain/skills.js +39 -0
  29. package/dist/domain/skills.js.map +1 -1
  30. package/dist/index.js +95 -37
  31. package/dist/index.js.map +1 -1
  32. package/dist/infrastructure/agents/register-sanity-mcp.js +9 -6
  33. package/dist/infrastructure/agents/register-sanity-mcp.js.map +1 -1
  34. package/dist/infrastructure/create/apply-package-json.d.ts.map +1 -1
  35. package/dist/infrastructure/create/apply-package-json.js +19 -0
  36. package/dist/infrastructure/create/apply-package-json.js.map +1 -1
  37. package/dist/infrastructure/create/install-dependencies.d.ts.map +1 -1
  38. package/dist/infrastructure/create/install-dependencies.js +4 -0
  39. package/dist/infrastructure/create/install-dependencies.js.map +1 -1
  40. package/dist/infrastructure/create/merge-registry.d.ts.map +1 -1
  41. package/dist/infrastructure/create/merge-registry.js +8 -0
  42. package/dist/infrastructure/create/merge-registry.js.map +1 -1
  43. package/dist/infrastructure/create/setup-agent.d.ts.map +1 -1
  44. package/dist/infrastructure/create/setup-agent.js +29 -6
  45. package/dist/infrastructure/create/setup-agent.js.map +1 -1
  46. package/dist/infrastructure/create/setup-sanity.d.ts.map +1 -1
  47. package/dist/infrastructure/create/setup-sanity.js +3 -0
  48. package/dist/infrastructure/create/setup-sanity.js.map +1 -1
  49. package/dist/infrastructure/integrations/inject-integration.d.ts +3 -3
  50. package/dist/infrastructure/integrations/inject-integration.d.ts.map +1 -1
  51. package/dist/infrastructure/integrations/inject-integration.js +81 -37
  52. package/dist/infrastructure/integrations/inject-integration.js.map +1 -1
  53. package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
  54. package/dist/modules/features/cms/sanity/config.js +11 -5
  55. package/dist/modules/features/cms/sanity/config.js.map +1 -1
  56. package/dist/modules/features/cms/sanity/index.js +8 -2
  57. package/dist/modules/features/cms/sanity/index.js.map +1 -1
  58. package/dist/modules/features/cms/sanity/mergers/ci-workflow.d.ts +13 -0
  59. package/dist/modules/features/cms/sanity/mergers/ci-workflow.d.ts.map +1 -0
  60. package/dist/modules/features/cms/sanity/mergers/ci-workflow.js +38 -0
  61. package/dist/modules/features/cms/sanity/mergers/ci-workflow.js.map +1 -0
  62. package/dist/modules/features/cms/sanity/mergers/knip.d.ts +12 -0
  63. package/dist/modules/features/cms/sanity/mergers/knip.d.ts.map +1 -0
  64. package/dist/modules/features/cms/sanity/mergers/knip.js +38 -0
  65. package/dist/modules/features/cms/sanity/mergers/knip.js.map +1 -0
  66. package/dist/modules/features/cms/sanity/mergers/layout.d.ts.map +1 -1
  67. package/dist/modules/features/cms/sanity/mergers/layout.js +7 -3
  68. package/dist/modules/features/cms/sanity/mergers/layout.js.map +1 -1
  69. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts +3 -3
  70. package/dist/modules/features/cms/sanity/mergers/sitemap.d.ts.map +1 -1
  71. package/dist/modules/features/cms/sanity/mergers/sitemap.js +48 -62
  72. package/dist/modules/features/cms/sanity/mergers/sitemap.js.map +1 -1
  73. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
  74. package/dist/modules/features/cms/sanity-pagebuilder/config.js +8 -5
  75. package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
  76. package/dist/modules/features/cms/sanity-pagebuilder/index.js +2 -2
  77. package/dist/modules/features/cms/sanity-pagebuilder/index.js.map +1 -1
  78. package/dist/modules/features/forms/hubspot/config.d.ts +31 -0
  79. package/dist/modules/features/forms/hubspot/config.d.ts.map +1 -0
  80. package/dist/modules/features/forms/hubspot/config.js +25 -0
  81. package/dist/modules/features/forms/hubspot/config.js.map +1 -0
  82. package/dist/paths.d.ts +8 -0
  83. package/dist/paths.d.ts.map +1 -1
  84. package/dist/paths.js +8 -0
  85. package/dist/paths.js.map +1 -1
  86. package/package.json +17 -9
  87. package/src/assets/check-node-version.mjs +22 -0
  88. package/src/modules/features/cms/sanity/files/app/blog/page.tsx +54 -0
  89. package/src/modules/features/cms/sanity/files/app/feed.xml/route.ts +36 -0
  90. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/components/disable-draft-mode.tsx +3 -3
  91. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/schemas/article.ts +7 -7
  92. package/src/modules/features/cms/sanity/files/lib/scripts/setup-ci-secrets.ts +117 -0
  93. package/src/modules/features/cms/sanity/files/lib/utils/rss.ts +96 -0
  94. package/src/modules/features/cms/sanity-pagebuilder/files/.knip.json +8 -0
  95. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +100 -0
  96. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/draft-mode/disable/route.ts +7 -0
  97. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/draft-mode/enable/route.ts +20 -0
  98. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/revalidate/route.ts +126 -0
  99. package/src/modules/features/cms/sanity-pagebuilder/files/app/feed.xml/route.ts +40 -0
  100. package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +124 -0
  101. package/src/modules/features/cms/sanity-pagebuilder/files/app/studio/[[...tool]]/page.tsx +8 -0
  102. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/draft-mode-toggle.tsx +27 -0
  103. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/rich-text.tsx +87 -0
  104. package/src/modules/features/cms/sanity-pagebuilder/files/components/sanity/visual-editing.tsx +28 -0
  105. package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +41 -0
  106. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/check-integration.ts +5 -0
  107. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/client.ts +27 -0
  108. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/disable-draft-mode.tsx +23 -0
  109. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-builder-input.tsx +39 -0
  110. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/page-category-input.tsx +50 -0
  111. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-field.tsx +18 -0
  112. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-input.tsx +14 -0
  113. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/confirm-publish-action.ts +40 -0
  114. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/env.ts +34 -0
  115. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/layout.ts +48 -0
  116. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/fetchers/redirects.ts +17 -0
  117. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +62 -0
  118. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +88 -0
  119. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/markdown-proxy.config.ts +50 -0
  120. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +130 -0
  121. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-category.ts +28 -0
  122. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-tree-pane.tsx +420 -0
  123. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/pinned-pages.ts +54 -0
  124. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/presentation.ts +119 -0
  125. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +385 -0
  126. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.cli.ts +29 -0
  127. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/sanity.config.ts +113 -0
  128. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +4 -0
  129. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/blog-content.ts +89 -0
  130. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/description.ts +29 -0
  131. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/hero.ts +28 -0
  132. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/singleton/content-collection.ts +45 -0
  133. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/content/author.ts +70 -0
  134. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/content/blog-category.ts +55 -0
  135. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +96 -0
  136. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/company-data.ts +62 -0
  137. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/footer.ts +79 -0
  138. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/navbar.ts +75 -0
  139. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/redirect.ts +120 -0
  140. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/link.ts +125 -0
  141. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/logo-field.ts +9 -0
  142. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/metadata.ts +68 -0
  143. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/nav-objects.ts +192 -0
  144. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-builder.ts +39 -0
  145. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-folder.ts +124 -0
  146. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +242 -0
  147. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/richText.ts +63 -0
  148. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/singletons.ts +39 -0
  149. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +330 -0
  150. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/image.ts +8 -0
  151. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/link.ts +140 -0
  152. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +81 -0
  153. package/src/modules/features/cms/sanity-pagebuilder/files/lib/scripts/sanity-typegen.ts +45 -0
  154. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/check-redirect.ts +30 -0
  155. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/json-ld.tsx +212 -0
  156. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/metadata.ts +167 -0
  157. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/rss.ts +96 -0
  158. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/sitemap.ts +40 -0
  159. package/src/modules/features/cms/sanity-pagebuilder/files/proxy.ts +81 -0
  160. package/src/templates/next-default/.github/workflows/ci.yml +62 -0
  161. package/src/templates/next-default/README.md +22 -0
  162. package/src/templates/next-default/knip.json +14 -0
  163. package/src/templates/next-default/lefthook.yml +5 -0
  164. package/src/templates/next-default/package.json +8 -4
  165. package/src/templates/next-experiments/.github/workflows/ci.yml +62 -0
  166. package/src/templates/next-experiments/README.md +22 -0
  167. package/src/templates/next-experiments/knip.json +14 -0
  168. package/src/templates/next-experiments/lefthook.yml +30 -0
  169. package/src/templates/next-experiments/package.json +10 -2
  170. package/src/templates/next-pagebuilder/.github/workflows/ci.yml +70 -0
  171. package/src/templates/next-pagebuilder/README.md +34 -0
  172. package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +6 -1
  173. package/src/templates/next-pagebuilder/app/(content)/layout.tsx +3 -12
  174. package/src/templates/next-pagebuilder/components/layout/footer/index.tsx +11 -10
  175. package/src/templates/next-pagebuilder/components/layout/header/index.tsx +5 -3
  176. package/src/templates/next-pagebuilder/components/layout/json-ld/index.tsx +9 -10
  177. package/src/templates/next-pagebuilder/components/layout/wrapper/index.tsx +3 -11
  178. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/index.tsx +1 -1
  179. package/src/templates/next-pagebuilder/knip.json +27 -0
  180. package/src/templates/next-pagebuilder/lefthook.yml +5 -0
  181. package/src/templates/next-pagebuilder/lib/scripts/setup-ci-secrets.ts +117 -0
  182. package/src/templates/next-pagebuilder/package.json +9 -3
  183. package/src/templates/next-webgl/.github/workflows/ci.yml +62 -0
  184. package/src/templates/next-webgl/README.md +22 -0
  185. package/src/templates/next-webgl/knip.json +13 -0
  186. package/src/templates/next-webgl/lefthook.yml +5 -0
  187. package/src/templates/next-webgl/package.json +8 -4
@@ -0,0 +1,38 @@
1
+ import fs from "fs-extra";
2
+ /**
3
+ * Sanity build env injected into the CI workflow's Build step.
4
+ * Project ID and dataset are public (they ship in the client bundle) so they
5
+ * come from repository *variables*; the read token is a *secret*.
6
+ */
7
+ const SANITY_BUILD_ENV = ` env:
8
+ # Sanity project ID and dataset are public (they ship in the client
9
+ # bundle), so they come from repository variables. The read token is
10
+ # a secret. Set them with \`bun run ci:secrets\` or under
11
+ # Settings → Secrets and variables → Actions.
12
+ NEXT_PUBLIC_SANITY_PROJECT_ID: \${{ vars.NEXT_PUBLIC_SANITY_PROJECT_ID }}
13
+ NEXT_PUBLIC_SANITY_DATASET: \${{ vars.NEXT_PUBLIC_SANITY_DATASET }}
14
+ SANITY_API_READ_TOKEN: \${{ secrets.SANITY_API_READ_TOKEN }}
15
+ `;
16
+ const BUILD_STEP = " run: bun run build\n";
17
+ /**
18
+ * Inject the Sanity build env into the project's CI workflow Build step.
19
+ * No-ops if the workflow already references the Sanity env or has no
20
+ * recognizable `bun run build` step.
21
+ */
22
+ export async function mergeCiWorkflow(workflowPath) {
23
+ if (!(await fs.pathExists(workflowPath))) {
24
+ return { skipped: true, reason: "No CI workflow to update" };
25
+ }
26
+ const content = await fs.readFile(workflowPath, "utf-8");
27
+ if (content.includes("NEXT_PUBLIC_SANITY_PROJECT_ID")) {
28
+ return { skipped: true, reason: "Workflow already has Sanity env" };
29
+ }
30
+ if (!content.includes(BUILD_STEP)) {
31
+ return { skipped: true, reason: "No `bun run build` step found" };
32
+ }
33
+ // Insert the env block immediately after the Build step's run line.
34
+ const updated = content.replace(BUILD_STEP, `${BUILD_STEP}${SANITY_BUILD_ENV}`);
35
+ await fs.writeFile(workflowPath, updated);
36
+ return { success: true };
37
+ }
38
+ //# sourceMappingURL=ci-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-workflow.js","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/ci-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B;;;;GAIG;AACH,MAAM,gBAAgB,GAAG;;;;;;;;CAQxB,CAAC;AAEF,MAAM,UAAU,GAAG,8BAA8B,CAAC;AAQlD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,YAAoB;IAEpB,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC;IAC9D,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAEzD,IAAI,OAAO,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,+BAA+B,EAAE,CAAC;IACnE,CAAC;IAED,oEAAoE;IACpE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAC9B,UAAU,EACV,GAAG,UAAU,GAAG,gBAAgB,EAAE,CAClC,CAAC;IAEF,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,12 @@
1
+ interface MergeResult {
2
+ skipped?: boolean;
3
+ reason?: string;
4
+ success?: boolean;
5
+ }
6
+ /**
7
+ * Merge the Sanity knip entries/ignores into the project's `knip.json` so
8
+ * dead-code analysis stays green once the Sanity files are in place.
9
+ */
10
+ export declare function mergeKnip(knipPath: string): Promise<MergeResult>;
11
+ export {};
12
+ //# sourceMappingURL=knip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knip.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/knip.ts"],"names":[],"mappings":"AAsBA,UAAU,WAAW;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAgBtE"}
@@ -0,0 +1,38 @@
1
+ import fs from "fs-extra";
2
+ /**
3
+ * knip config additions for the Sanity surface. Adding Sanity brings a large
4
+ * set of intentional-but-unimported files (schemas, Studio config, generated
5
+ * types) plus a few transitive/CLI deps, so without these a fresh
6
+ * Sanity-enabled project would fail `bun run knip` in CI.
7
+ */
8
+ const SANITY_ENTRY = ["lib/integrations/**/*.{ts,tsx}"];
9
+ const SANITY_IGNORE_DEPENDENCIES = [
10
+ "@sanity/visual-editing",
11
+ "@portabletext/react",
12
+ ];
13
+ const SANITY_IGNORE_BINARIES = ["gh"];
14
+ /** Union `additions` into `existing`, preserving order and dropping dupes. */
15
+ function union(existing, additions) {
16
+ const result = [...(existing ?? [])];
17
+ for (const item of additions) {
18
+ if (!result.includes(item))
19
+ result.push(item);
20
+ }
21
+ return result;
22
+ }
23
+ /**
24
+ * Merge the Sanity knip entries/ignores into the project's `knip.json` so
25
+ * dead-code analysis stays green once the Sanity files are in place.
26
+ */
27
+ export async function mergeKnip(knipPath) {
28
+ if (!(await fs.pathExists(knipPath))) {
29
+ return { skipped: true, reason: "No knip.json to update" };
30
+ }
31
+ const config = (await fs.readJson(knipPath));
32
+ config.entry = union(config.entry, SANITY_ENTRY);
33
+ config.ignoreDependencies = union(config.ignoreDependencies, SANITY_IGNORE_DEPENDENCIES);
34
+ config.ignoreBinaries = union(config.ignoreBinaries, SANITY_IGNORE_BINARIES);
35
+ await fs.writeJson(knipPath, config, { spaces: 2 });
36
+ return { success: true };
37
+ }
38
+ //# sourceMappingURL=knip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knip.js","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/knip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,YAAY,GAAG,CAAC,gCAAgC,CAAC,CAAC;AACxD,MAAM,0BAA0B,GAAG;IAClC,wBAAwB;IACxB,qBAAqB;CACrB,CAAC;AACF,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,CAAC;AAetC,8EAA8E;AAC9E,SAAS,KAAK,CAAC,QAA8B,EAAE,SAAmB;IACjE,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAgB;IAC/C,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,wBAAwB,EAAE,CAAC;IAC5D,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAe,CAAC;IAE3D,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACjD,MAAM,CAAC,kBAAkB,GAAG,KAAK,CAChC,MAAM,CAAC,kBAAkB,EACzB,0BAA0B,CAC1B,CAAC;IACF,MAAM,CAAC,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IAE7E,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/layout.ts"],"names":[],"mappings":"AA2DA,UAAU,kBAAkB;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,WAAW;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAChC,YAAY,EAAE,MAAM,EACpB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAE,kBAAuB,GAChD,OAAO,CAAC,WAAW,CAAC,CAwJtB"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/layout.ts"],"names":[],"mappings":"AA2DA,UAAU,kBAAkB;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,WAAW;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAChC,YAAY,EAAE,MAAM,EACpB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAE,kBAAuB,GAChD,OAAO,CAAC,WAAW,CAAC,CA4JtB"}
@@ -72,12 +72,16 @@ export async function mergeLayout(templatePath, { targetDir, pathPrefix } = {})
72
72
  return { skipped: true, reason: "Already has Sanity integration" };
73
73
  }
74
74
  // 1. Add Sanity imports after the full top-level import section.
75
- // This avoids corrupting multiline imports like:
75
+ // Each statement ends at its module specifier's closing quote, with an
76
+ // optional semicolon (templates use Biome's `asNeeded` style, so most have
77
+ // none). Matching the quote (not `;`) keeps multiline and side-effect
78
+ // imports intact:
76
79
  // import {
77
80
  // Foo,
78
81
  // Bar,
79
- // } from "baz";
80
- const importSectionMatch = content.match(/^(?:import[\s\S]+?;\n)+/m);
82
+ // } from "baz"
83
+ // import "./styles.css"
84
+ const importSectionMatch = content.match(/^(?:import[\s\S]+?["'];?\r?\n)+/m);
81
85
  if (importSectionMatch && importSectionMatch.index !== undefined) {
82
86
  const insertPos = importSectionMatch.index + importSectionMatch[0].length;
83
87
  content =
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/layout.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B;;;GAGG;AACH,MAAM,cAAc,GAAG;yEACkD,CAAC;AAE1E;;;GAGG;AACH,MAAM,sBAAsB,GAAG;;;;;;;;;CAS9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhC,CAAC;AAaF;;;;;;;;;;GAUG;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M,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QACrE,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;YAC/C,MAAM,EAAE,CAAC,SAAS,CAAC,iBAAiB,EAAE,wBAAwB,CAAC,CAAC;QACjE,CAAC;IACF,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/layout.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B;;;GAGG;AACH,MAAM,cAAc,GAAG;yEACkD,CAAC;AAE1E;;;GAGG;AACH,MAAM,sBAAsB,GAAG;;;;;;;;;CAS9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BhC,CAAC;AAaF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAChC,YAAoB,EACpB,EAAE,SAAS,EAAE,UAAU,KAAyB,EAAE;IAElD,IAAI,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAEvD,yCAAyC;IACzC,IACC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EACrC,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,gCAAgC,EAAE,CAAC;IACpE,CAAC;IAED,iEAAiE;IACjE,uEAAuE;IACvE,2EAA2E;IAC3E,sEAAsE;IACtE,kBAAkB;IAClB,WAAW;IACX,SAAS;IACT,SAAS;IACT,eAAe;IACf,wBAAwB;IACxB,MAAM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,CAAC,CAAC;YACrD,MAAM,IAAI,KAAK,WAAW,wBAAwB,CAAC;YACnD,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC;QACpC,CAAC;QAED,MAAM,IAAI,KAAK,MAAM,4BAA4B,UAAU,GAAG,SAAS,EAAE,CAAC;QAC1E,OAAO,MAAM,CAAC;IACf,CAAC,CACD,CAAC;IAEF,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAE1C,8BAA8B;IAC9B,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,UAAU,IAAI,EAAE,EAChB,YAAY,EACZ,QAAQ,CACR,CAAC;QACF,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAE9B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;QAC3D,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YACvC,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QACrE,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;YAC/C,MAAM,EAAE,CAAC,SAAS,CAAC,iBAAiB,EAAE,wBAAwB,CAAC,CAAC;QACjE,CAAC;IACF,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -4,9 +4,9 @@ interface MergeResult {
4
4
  success?: boolean;
5
5
  }
6
6
  /**
7
- * Merge Sanity integration into template sitemap.
8
- * Preserves all existing agnostic code (routes, baseRoutes structure)
9
- * and injects Sanity-specific fetching logic.
7
+ * Merge Sanity article fetching into the template sitemap. Preserves the
8
+ * template's agnostic structure (getStaticEntries/toXml/Response) and appends
9
+ * article entries to the static ones.
10
10
  */
11
11
  export declare function mergeSitemap(templatePath: string): Promise<MergeResult>;
12
12
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/sitemap.ts"],"names":[],"mappings":"AAyDA,UAAU,WAAW;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAqC7E"}
1
+ {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/sitemap.ts"],"names":[],"mappings":"AAgDA,UAAU,WAAW;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAqC7E"}
@@ -1,14 +1,9 @@
1
1
  import fs from "fs-extra";
2
- /**
3
- * Sanity-specific import to add
4
- */
5
2
  const SANITY_IMPORT = `import { isSanityConfigured } from "@/lib/integrations/check-integration"`;
6
- /**
7
- * Sanity fetch logic to inject before return statement.
8
- * Uses early return pattern and spread operator for cleaner code.
9
- */
3
+ // The template line that builds the static entries; articles are appended after it.
4
+ const ENTRIES_ANCHOR = /^[ \t]*const entries: SitemapEntry\[\] = getStaticEntries\(\)[ \t]*$/m;
5
+ // Appends published (non-noIndex) articles to `entries` in the template's SitemapEntry shape.
10
6
  const SANITY_FETCH_LOGIC = `
11
- // Only fetch Sanity articles if Sanity is configured
12
7
  if (isSanityConfigured()) {
13
8
  try {
14
9
  const sanityModule = await import("@/lib/integrations/sanity/client")
@@ -17,75 +12,66 @@ const SANITY_FETCH_LOGIC = `
17
12
  const client = sanityModule?.client
18
13
  const groq = sanityGroq?.groq
19
14
 
20
- // Skip if client is null (shouldn't happen since we check isSanityConfigured)
21
- if (!(client && groq)) return baseRoutes
22
-
23
- type SanityDocument = {
24
- slug: { current: string }
25
- _updatedAt: string
26
- metadata?: { noIndex?: boolean }
27
- }
28
-
29
- const articles = (await client.fetch(
30
- groq\`*[_type == "article" && defined(slug.current)] {
31
- slug,
32
- _updatedAt,
33
- metadata
34
- }\`
35
- )) as SanityDocument[]
15
+ if (client && groq) {
16
+ type SanityArticle = {
17
+ slug: { current: string }
18
+ _updatedAt: string
19
+ metadata?: { noIndex?: boolean }
20
+ }
36
21
 
37
- // Add articles to sitemap (exclude noIndex articles)
38
- const articleEntries: MetadataRoute.Sitemap = articles
39
- .filter((article: SanityDocument) => !article.metadata?.noIndex)
40
- .map((article: SanityDocument) => ({
41
- url: \`\${APP_BASE_URL}/blog/\${article.slug.current}\`,
42
- lastModified: new Date(article._updatedAt),
43
- changeFrequency: "weekly" as const,
44
- priority: 0.7,
45
- }))
22
+ const articles = (await client.fetch(
23
+ groq\`*[_type == "article" && defined(slug.current)] {
24
+ slug,
25
+ _updatedAt,
26
+ metadata
27
+ }\`
28
+ )) as SanityArticle[]
46
29
 
47
- return [...baseRoutes, ...articleEntries]
30
+ for (const article of articles) {
31
+ if (article.metadata?.noIndex) continue
32
+ entries.push({
33
+ loc: \`\${BASE_URL}/blog/\${article.slug.current}\`,
34
+ lastmod: new Date(article._updatedAt).toISOString(),
35
+ changefreq: "weekly",
36
+ priority: 0.7,
37
+ })
38
+ }
39
+ }
48
40
  } catch (error) {
49
41
  console.error("Error generating sitemap from Sanity:", error)
50
- return baseRoutes
51
42
  }
52
- }
53
-
54
- `;
43
+ }`;
55
44
  /**
56
- * Merge Sanity integration into template sitemap.
57
- * Preserves all existing agnostic code (routes, baseRoutes structure)
58
- * and injects Sanity-specific fetching logic.
45
+ * Merge Sanity article fetching into the template sitemap. Preserves the
46
+ * template's agnostic structure (getStaticEntries/toXml/Response) and appends
47
+ * article entries to the static ones.
59
48
  */
60
49
  export async function mergeSitemap(templatePath) {
61
50
  let content = await fs.readFile(templatePath, "utf-8");
62
- // Skip if already has Sanity integration
63
51
  if (content.includes("isSanityConfigured")) {
64
52
  return { skipped: true, reason: "Already has Sanity integration" };
65
53
  }
66
- // 1. Add Sanity import after existing imports
67
- const importMatches = [...content.matchAll(/^import .+$/gm)];
68
- if (importMatches.length > 0) {
69
- const lastImport = importMatches.at(-1);
70
- if (lastImport && lastImport.index !== undefined) {
71
- const insertPos = lastImport.index + lastImport[0].length;
72
- content =
73
- content.slice(0, insertPos) +
74
- "\n" +
75
- SANITY_IMPORT +
76
- content.slice(insertPos);
77
- }
54
+ // Bail before editing so a structure change never leaves an unused import.
55
+ const anchorMatch = content.match(ENTRIES_ANCHOR);
56
+ if (!anchorMatch) {
57
+ return {
58
+ skipped: true,
59
+ reason: "Sitemap template structure not recognized; skipped Sanity injection",
60
+ };
78
61
  }
79
- // 2. Add Sanity fetch logic before the final return statement
80
- // Find the last "return baseRoutes" or "return [...baseRoutes" pattern
81
- const returnMatch = content.match(/(\n)([ \t]*)(return\s+(?:baseRoutes|\[\.\.\.baseRoutes))/m);
82
- if (returnMatch) {
83
- const returnIndex = content.indexOf(returnMatch[0]);
62
+ // 1. Add Sanity import after the last existing import.
63
+ const importMatches = [...content.matchAll(/^import .+$/gm)];
64
+ const lastImport = importMatches.at(-1);
65
+ if (lastImport?.index !== undefined) {
66
+ const insertPos = lastImport.index + lastImport[0].length;
84
67
  content =
85
- content.slice(0, returnIndex) +
86
- SANITY_FETCH_LOGIC +
87
- content.slice(returnIndex);
68
+ content.slice(0, insertPos) +
69
+ "\n" +
70
+ SANITY_IMPORT +
71
+ content.slice(insertPos);
88
72
  }
73
+ // 2. Append the article-fetch logic right after the static entries are built.
74
+ content = content.replace(anchorMatch[0], `${anchorMatch[0]}\n${SANITY_FETCH_LOGIC}`);
89
75
  await fs.writeFile(templatePath, content);
90
76
  return { success: true };
91
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../../../../../src/modules/features/cms/sanity/mergers/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B;;GAEG;AACH,MAAM,aAAa,GAAG,2EAA2E,CAAC;AAElG;;;GAGG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C1B,CAAC;AAQF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,YAAoB;IACtD,IAAI,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAEvD,yCAAyC;IACzC,IAAI,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,gCAAgC,EAAE,CAAC;IACpE,CAAC;IAED,8CAA8C;IAC9C,MAAM,aAAa,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;IAC7D,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,UAAU,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAClD,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC1D,OAAO;gBACN,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC;oBAC3B,IAAI;oBACJ,aAAa;o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,KAAK,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,OAAO;YACN,OAAO,EAAE,IAAI;YACb,MAAM,EACL,qEAAqE;SACtE,CAAC;IACH,CAAC;IAED,uDAAuD;IACvD,MAAM,aAAa,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,UAAU,EAAE,KAAK,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC1D,OAAO;YACN,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC;gBAC3B,IAAI;gBACJ,aAAa;gBACb,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,8EAA8E;IAC9E,OAAO,GAAG,OAAO,CAAC,OAAO,CACxB,WAAW,CAAC,CAAC,CAAC,EACd,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,kBAAkB,EAAE,CAC1C,CAAC;IAEF,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,kCAAkC;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,EAAE,kCA0CrC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,kCAAkC;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,EAAE,kCA6CrC,CAAC"}
@@ -9,12 +9,12 @@ export const sanityPagebuilderConfig = {
9
9
  "@phosphor-icons/react": "^2.1.10",
10
10
  "@portabletext/types": "^4.0.2",
11
11
  "@sanity/asset-utils": "^2.3.0",
12
- "@sanity/image-url": "^2.0.3",
12
+ "@sanity/image-url": "^2.1.1",
13
13
  "@sanity/table": "^2.0.1",
14
- "@sanity/vision": "^5.17.1",
15
- "@sanity/visual-editing": "^5.3.1",
16
- "next-sanity": "^12.1.4",
17
- sanity: "^5.17.1",
14
+ "@sanity/vision": "^5.30.0",
15
+ "@sanity/visual-editing": "^5.4.3",
16
+ "next-sanity": "^13.0.10",
17
+ sanity: "^5.30.0",
18
18
  "sanity-plugin-media": "^4.1.1",
19
19
  },
20
20
  devDependencies: {
@@ -29,12 +29,15 @@ export const sanityPagebuilderConfig = {
29
29
  additivePaths: [
30
30
  "lib/integrations/sanity",
31
31
  "lib/integrations/check-integration.ts",
32
+ "lib/utils/check-redirect.ts",
32
33
  "lib/utils/json-ld.tsx",
33
34
  "lib/utils/metadata.ts",
35
+ "lib/utils/rss.ts",
34
36
  "lib/utils/sitemap.ts",
35
37
  "lib/scripts/sanity-typegen.ts",
36
38
  "app/studio",
37
39
  "app/api",
40
+ "app/feed.xml",
38
41
  "app/sitemap.md",
39
42
  "proxy.ts",
40
43
  "components/sanity",
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IAC1E,IAAI,EAAE,oBAAoB;IAE1B,YAAY,EAAE;QACb,uBAAuB,EAAE,SAAS;QAClC,qBAAqB,EAAE,QAAQ;QAC/B,qBAAqB,EAAE,QAAQ;QAC/B,mBAAmB,EAAE,QAAQ;QAC7B,eAAe,EAAE,QAAQ;QACzB,gBAAgB,EAAE,SAAS;QAC3B,wBAAwB,EAAE,QAAQ;QAClC,aAAa,EAAE,SAAS;QACxB,MAAM,EAAE,SAAS;QACjB,qBAAqB,EAAE,QAAQ;KAC/B;IAED,eAAe,EAAE;QAChB,YAAY,EAAE,QAAQ;KACtB;IAED,OAAO,EAAE;QACR,gBAAgB,EACf,wFAAwF;QACzF,gBAAgB,EAAE,qCAAqC;QACvD,MAAM,EAAE,wBAAwB;QAChC,QAAQ,EAAE,wBAAwB;KAClC;IAED,aAAa,EAAE;QACd,yBAAyB;QACzB,uCAAuC;QACvC,uBAAuB;QACvB,uBAAuB;QACvB,sBAAsB;QACtB,+BAA+B;QAC/B,YAAY;QACZ,SAAS;QACT,gBAAgB;QAChB,UAAU;QACV,mBAAmB;QACnB,4BAA4B;KAC5B;CACD,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IAC1E,IAAI,EAAE,oBAAoB;IAE1B,YAAY,EAAE;QACb,uBAAuB,EAAE,SAAS;QAClC,qBAAqB,EAAE,QAAQ;QAC/B,qBAAqB,EAAE,QAAQ;QAC/B,mBAAmB,EAAE,QAAQ;QAC7B,eAAe,EAAE,QAAQ;QACzB,gBAAgB,EAAE,SAAS;QAC3B,wBAAwB,EAAE,QAAQ;QAClC,aAAa,EAAE,UAAU;QACzB,MAAM,EAAE,SAAS;QACjB,qBAAqB,EAAE,QAAQ;KAC/B;IAED,eAAe,EAAE;QAChB,YAAY,EAAE,QAAQ;KACtB;IAED,OAAO,EAAE;QACR,gBAAgB,EACf,wFAAwF;QACzF,gBAAgB,EAAE,qCAAqC;QACvD,MAAM,EAAE,wBAAwB;QAChC,QAAQ,EAAE,wBAAwB;KAClC;IAED,aAAa,EAAE;QACd,yBAAyB;QACzB,uCAAuC;QACvC,6BAA6B;QAC7B,uBAAuB;QACvB,uBAAuB;QACvB,kBAAkB;QAClB,sBAAsB;QACtB,+BAA+B;QAC/B,YAAY;QACZ,SAAS;QACT,cAAc;QACd,gBAAgB;QAChB,UAAU;QACV,mBAAmB;QACnB,4BAA4B;KAC5B;CACD,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import path from "node:path";
2
- import { CMS_FEATURE_MODULE_IDS, CREATE_LIFECYCLE_STEP_IDS, SANITY_PAGEBUILDER_FEATURE_MODULE_ID, } from "../../../../core/create/internal-ids.js";
2
+ import { CREATE_LIFECYCLE_STEP_IDS, SANITY_FEATURE_MODULE_ID, SANITY_PAGEBUILDER_FEATURE_MODULE_ID, } from "../../../../core/create/internal-ids.js";
3
3
  import { SANITY_PAGEBUILDER_FILES_DIR } from "../../../../paths.js";
4
4
  import { sanityPagebuilderConfig } from "./config.js";
5
5
  export const sanityPagebuilderFeature = {
6
6
  id: SANITY_PAGEBUILDER_FEATURE_MODULE_ID,
7
7
  kind: "feature",
8
8
  label: "Sanity (Page Builder)",
9
- conflictsWith: [CMS_FEATURE_MODULE_IDS.sanity],
9
+ conflictsWith: [SANITY_FEATURE_MODULE_ID],
10
10
  contribute(context) {
11
11
  return {
12
12
  packageJson: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,oCAAoC,GACpC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAkB;IACtD,EAAE,EAAE,oCAAoC;IACxC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,uBAAuB;IAC9B,aAAa,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC;IAC9C,UAAU,CAAC,OAAO;QACjB,OAAO;YACN,WAAW,EAAE;gBACZ,YAAY,EAAE,uBAAuB,CAAC,YAAY;gBAClD,eAAe,EAAE,uBAAuB,CAAC,eAAe;gBACxD,OAAO,EAAE,uBAAuB,CAAC,OAAO;aACxC;YACD,SAAS,EAAE,uBAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;gBACvE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,YAAY,CAAC;gBAC3D,EAAE,EAAE,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC;gBACvD,SAAS,EAAE,KAAK;aAChB,CAAC,CAAC;YACH,GAAG,EAAE;gBACJ,EAAE,GAAG,EAAE,+BAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACxD,EAAE,GAAG,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACrD,EAAE,GAAG,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;aAChD;YACD,SAAS,EAAE;gBACV,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,yBAAyB,CAAC,kBAAkB,EAAE,CAAC;aAChE;SACD,CAAC;IACH,CAAC;CACD,CAAC;AAEF,SAAS,iBAAiB,CAAC,YAAoB,EAAE,MAAmB;IACnE,IAAI,CAAC,MAAM;QAAE,OAAO,YAAY,CAAC;IAEjC,KAAK,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;QACrD,IAAI,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,OAAO,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;QACnC,CAAC;IACF,CAAC;IAED,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QAChE,OAAO,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,YAAY,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/features/cms/sanity-pagebuilder/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,oCAAoC,GACpC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAkB;IACtD,EAAE,EAAE,oCAAoC;IACxC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,uBAAuB;IAC9B,aAAa,EAAE,CAAC,wBAAwB,CAAC;IACzC,UAAU,CAAC,OAAO;QACjB,OAAO;YACN,WAAW,EAAE;gBACZ,YAAY,EAAE,uBAAuB,CAAC,YAAY;gBAClD,eAAe,EAAE,uBAAuB,CAAC,eAAe;gBACxD,OAAO,EAAE,uBAAuB,CAAC,OAAO;aACxC;YACD,SAAS,EAAE,uBAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;gBACvE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,YAAY,CAAC;gBAC3D,EAAE,EAAE,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC;gBACvD,SAAS,EAAE,KAAK;aAChB,CAAC,CAAC;YACH,GAAG,EAAE;gBACJ,EAAE,GAAG,EAAE,+BAA+B,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACxD,EAAE,GAAG,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACrD,EAAE,GAAG,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,EAAE;aAChD;YACD,SAAS,EAAE;gBACV,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,yBAAyB,CAAC,kBAAkB,EAAE,CAAC;aAChE;SACD,CAAC;IACH,CAAC;CACD,CAAC;AAEF,SAAS,iBAAiB,CAAC,YAAoB,EAAE,MAAmB;IACnE,IAAI,CAAC,MAAM;QAAE,OAAO,YAAY,CAAC;IAEjC,KAAK,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;QACrD,IAAI,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,OAAO,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;QACnC,CAAC;IACF,CAAC;IAED,IAAI,YAAY,KAAK,UAAU,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QAChE,OAAO,GAAG,MAAM,GAAG,YAAY,EAAE,CAAC;IACnC,CAAC;IAED,OAAO,YAAY,CAAC;AACrB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * HubSpot integration configuration manifest.
3
+ * Single source of truth for dependencies, scripts, paths, and merge rules.
4
+ *
5
+ * The core is dependency-free: it loads HubSpot's official forms script at
6
+ * runtime and styles the injected DOM with self-contained CSS.
7
+ */
8
+ import type { IntegrationId } from "../../../../domain/integration.js";
9
+ /**
10
+ * A path copied only when another integration is already present in the target
11
+ * project. Used to ship the optional Sanity Studio form picker.
12
+ */
13
+ export interface ConditionalPath {
14
+ /** Source path relative to this integration's `files/` directory. */
15
+ src: string;
16
+ /** Destination path relative to the project root (before `src/` prefixing). */
17
+ dest: string;
18
+ /** Integration that must already exist for the copy to run. */
19
+ requires: IntegrationId;
20
+ }
21
+ export interface HubSpotIntegrationConfig {
22
+ name: string;
23
+ dependencies: Record<string, string>;
24
+ devDependencies: Record<string, string>;
25
+ scripts: Record<string, string>;
26
+ additivePaths: string[];
27
+ mergeFiles: string[];
28
+ conditionalPaths: ConditionalPath[];
29
+ }
30
+ export declare const hubspotConfig: HubSpotIntegrationConfig;
31
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/modules/features/forms/hubspot/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,QAAQ,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACpC;AAED,eAAO,MAAM,aAAa,EAAE,wBAoB3B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * HubSpot integration configuration manifest.
3
+ * Single source of truth for dependencies, scripts, paths, and merge rules.
4
+ *
5
+ * The core is dependency-free: it loads HubSpot's official forms script at
6
+ * runtime and styles the injected DOM with self-contained CSS.
7
+ */
8
+ export const hubspotConfig = {
9
+ name: "hubspot",
10
+ // The core embed loads HubSpot's script at runtime — no extra packages.
11
+ dependencies: {},
12
+ devDependencies: {},
13
+ scripts: {},
14
+ additivePaths: ["lib/integrations/hubspot"],
15
+ mergeFiles: [],
16
+ // The Sanity Studio picker is only useful with Sanity installed.
17
+ conditionalPaths: [
18
+ {
19
+ src: "_sanity-adapter",
20
+ dest: "lib/integrations/hubspot/sanity",
21
+ requires: "sanity",
22
+ },
23
+ ],
24
+ };
25
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../src/modules/features/forms/hubspot/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2BH,MAAM,CAAC,MAAM,aAAa,GAA6B;IACtD,IAAI,EAAE,SAAS;IAEf,wEAAwE;IACxE,YAAY,EAAE,EAAE;IAChB,eAAe,EAAE,EAAE;IACnB,OAAO,EAAE,EAAE;IAEX,aAAa,EAAE,CAAC,0BAA0B,CAAC;IAE3C,UAAU,EAAE,EAAE;IAEd,iEAAiE;IACjE,gBAAgB,EAAE;QACjB;YACC,GAAG,EAAE,iBAAiB;YACtB,IAAI,EAAE,iCAAiC;YACvC,QAAQ,EAAE,QAAQ;SAClB;KACD;CACD,CAAC"}
package/dist/paths.d.ts CHANGED
@@ -4,6 +4,8 @@ export declare const TEMPLATES_DIR: string;
4
4
  export declare const TEMPLATE_HOOKS_DIR: string;
5
5
  /** Directory containing the Biome linting plugin rules. */
6
6
  export declare const PLUGINS_DIR: string;
7
+ /** Node-version guard injected into each scaffolded project; under `src/` so it ships verbatim. */
8
+ export declare const CHECK_NODE_VERSION_FILE: string;
7
9
  /**
8
10
  * Directory containing the Sanity integration source files.
9
11
  * Always resolves to `src/modules/features/cms/sanity/files/` relative to the
@@ -17,4 +19,10 @@ export declare const SANITY_FILES_DIR: string;
17
19
  * relative to the project root.
18
20
  */
19
21
  export declare const SANITY_PAGEBUILDER_FILES_DIR: string;
22
+ /**
23
+ * Directory containing the HubSpot integration source files.
24
+ * Always resolves to `src/modules/features/forms/hubspot/files/` relative to the
25
+ * project root.
26
+ */
27
+ export declare const HUBSPOT_FILES_DIR: string;
20
28
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAaA,6DAA6D;AAC7D,eAAO,MAAM,aAAa,EAAE,MAI3B,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,EAAE,MAIhC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAE,MAA2C,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAQ1C,CAAC"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAaA,6DAA6D;AAC7D,eAAO,MAAM,aAAa,EAAE,MAI3B,CAAC;AAEF,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,EAAE,MAIhC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,WAAW,EAAE,MAA2C,CAAC;AAEtE,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,EAAE,MAKrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAQ1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAQ/B,CAAC"}
package/dist/paths.js CHANGED
@@ -14,6 +14,8 @@ export const TEMPLATES_DIR = path.join(PROJECT_ROOT, "src", "templates");
14
14
  export const TEMPLATE_HOOKS_DIR = path.join(PROJECT_ROOT, "src", "template-hooks");
15
15
  /** Directory containing the Biome linting plugin rules. */
16
16
  export const PLUGINS_DIR = path.join(PROJECT_ROOT, "plugins");
17
+ /** Node-version guard injected into each scaffolded project; under `src/` so it ships verbatim. */
18
+ export const CHECK_NODE_VERSION_FILE = path.join(PROJECT_ROOT, "src", "assets", "check-node-version.mjs");
17
19
  /**
18
20
  * Directory containing the Sanity integration source files.
19
21
  * Always resolves to `src/modules/features/cms/sanity/files/` relative to the
@@ -27,4 +29,10 @@ export const SANITY_FILES_DIR = path.join(PROJECT_ROOT, "src", "modules", "featu
27
29
  * relative to the project root.
28
30
  */
29
31
  export const SANITY_PAGEBUILDER_FILES_DIR = path.join(PROJECT_ROOT, "src", "modules", "features", "cms", "sanity-pagebuilder", "files");
32
+ /**
33
+ * Directory containing the HubSpot integration source files.
34
+ * Always resolves to `src/modules/features/forms/hubspot/files/` relative to the
35
+ * project root.
36
+ */
37
+ export const HUBSPOT_FILES_DIR = path.join(PROJECT_ROOT, "src", "modules", "features", "forms", "hubspot", "files");
30
38
  //# sourceMappingURL=paths.js.map
package/dist/paths.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAW,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1D,MAAM,SAAS,GAAW,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAEnD;;;;GAIG;AACH,MAAM,YAAY,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CA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kB,GAAW,IAAI,CAAC,IAAI,CAClD,YAAY,EACZ,KAAK,EACL,gBAAgB,CAChB,CAAC;AAEF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAEtE,mGAAmG;AACnG,MAAM,CAAC,MAAM,uBAAuB,GAAW,IAAI,CAAC,IAAI,CACvD,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,wBAAwB,CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,IAAI,CAAC,IAAI,CAChD,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,CACP,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAW,IAAI,CAAC,IAAI,CAC5D,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,oBAAoB,EACpB,OAAO,CACP,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAW,IAAI,CAAC,IAAI,CACjD,YAAY,EACZ,KAAK,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,CACP,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "bsmnt",
3
- "version": "0.4.3",
4
- "packageManager": "bun@1.2.20",
3
+ "version": "0.5.0",
4
+ "packageManager": "bun@1.3.14",
5
5
  "description": "CLI to scaffold basement projects and add integrations",
6
6
  "type": "module",
7
+ "engines": {
8
+ "node": ">=24"
9
+ },
7
10
  "workspaces": [
8
11
  ".",
9
12
  "src/templates/*"
@@ -21,9 +24,12 @@
21
24
  "!src/templates/*/bun.lock",
22
25
  "src/template-hooks",
23
26
  "src/modules/features/cms/sanity/files",
27
+ "src/modules/features/cms/sanity-pagebuilder/files",
28
+ "src/assets",
24
29
  "plugins"
25
30
  ],
26
31
  "scripts": {
32
+ "preinstall": "node src/assets/check-node-version.mjs",
27
33
  "build": "tsc",
28
34
  "check": "tsc --noEmit",
29
35
  "dev": "tsx src/index.ts",
@@ -51,7 +57,9 @@
51
57
  "lint:all": "turbo run lint --filter=bsmnt-next-starter --filter=bsmnt-webgpu-starter --filter=bsmnt-experiments-starter",
52
58
  "version-canary": "changeset version --snapshot canary",
53
59
  "release-canary": "changeset publish --tag canary --no-git-tag",
54
- "test:templates": "bash scripts/test-templates.sh"
60
+ "test:templates": "bash scripts/test-templates.sh",
61
+ "link:local": "bash scripts/build-and-link.sh",
62
+ "unlink:local": "bash scripts/build-and-link.sh --unlink"
55
63
  },
56
64
  "keywords": [
57
65
  "webgpu",
@@ -63,23 +71,23 @@
63
71
  "author": "",
64
72
  "license": "ISC",
65
73
  "dependencies": {
66
- "@sanity/client": "^7.15.0",
67
- "@sanity/image-url": "^2.0.3",
68
- "@sanity/vision": "^5.11.0",
74
+ "@sanity/client": "^7.22.1",
75
+ "@sanity/image-url": "^2.1.1",
76
+ "@sanity/vision": "^5.30.0",
69
77
  "commander": "^13.1.0",
70
78
  "fs-extra": "^11.3.3",
71
- "next-sanity": "^12.1.0",
79
+ "next-sanity": "^13.0.10",
72
80
  "ora": "^9.1.0",
73
81
  "picocolors": "^1.1.1",
74
82
  "prompts": "^2.4.2",
75
- "sanity": "^5.11.0"
83
+ "sanity": "^5.30.0"
76
84
  },
77
85
  "devDependencies": {
78
86
  "@biomejs/biome": "^2.4.14",
79
87
  "@changesets/changelog-github": "^0.5.2",
80
88
  "@changesets/cli": "^2.29.8",
81
89
  "@types/fs-extra": "^11.0.4",
82
- "@types/node": "^25.2.3",
90
+ "@types/node": "^24.13.1",
83
91
  "@types/prompts": "^2.4.9",
84
92
  "cross-env": "^10.1.0",
85
93
  "lefthook": "^1.13.0",
@@ -0,0 +1,22 @@
1
+ // Reads engines.node from cwd's package.json so one file works in this repo and
2
+ // every project it's injected into.
3
+ import { readFileSync } from "node:fs";
4
+
5
+ let required = Number.NaN;
6
+ try {
7
+ const { engines } = JSON.parse(readFileSync("package.json", "utf8"));
8
+ required = Number(engines?.node?.match(/\d+/)?.[0]);
9
+ } catch {
10
+ // Can't read or parse package.json — nothing to enforce, let install proceed.
11
+ process.exit(0);
12
+ }
13
+
14
+ if (
15
+ !Number.isNaN(required) &&
16
+ Number(process.versions.node.split(".")[0]) < required
17
+ ) {
18
+ console.error(
19
+ `\nNode ${required}+ required. You have ${process.versions.node}.\n`,
20
+ );
21
+ process.exit(1);
22
+ }