bsmnt 0.7.1 → 0.10.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 (121) hide show
  1. package/dist/application/add-hooks/index.d.ts.map +1 -1
  2. package/dist/application/add-hooks/index.js +1 -0
  3. package/dist/application/add-hooks/index.js.map +1 -1
  4. package/dist/application/add-integration/index.d.ts.map +1 -1
  5. package/dist/application/add-integration/index.js +20 -2
  6. package/dist/application/add-integration/index.js.map +1 -1
  7. package/dist/core/create/execute-plan.d.ts +2 -0
  8. package/dist/core/create/execute-plan.d.ts.map +1 -1
  9. package/dist/core/create/execute-plan.js +3 -0
  10. package/dist/core/create/execute-plan.js.map +1 -1
  11. package/dist/domain/version.d.ts +14 -0
  12. package/dist/domain/version.d.ts.map +1 -0
  13. package/dist/domain/version.js +81 -0
  14. package/dist/domain/version.js.map +1 -0
  15. package/dist/index.js +3 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/infrastructure/create/executor.d.ts.map +1 -1
  18. package/dist/infrastructure/create/executor.js +2 -0
  19. package/dist/infrastructure/create/executor.js.map +1 -1
  20. package/dist/infrastructure/create/render-generated-docs.d.ts +18 -0
  21. package/dist/infrastructure/create/render-generated-docs.d.ts.map +1 -0
  22. package/dist/infrastructure/create/render-generated-docs.js +72 -0
  23. package/dist/infrastructure/create/render-generated-docs.js.map +1 -0
  24. package/dist/infrastructure/create/setup-dotenvx.d.ts.map +1 -1
  25. package/dist/infrastructure/create/setup-dotenvx.js +2 -1
  26. package/dist/infrastructure/create/setup-dotenvx.js.map +1 -1
  27. package/dist/infrastructure/create/setup-remote.d.ts +6 -1
  28. package/dist/infrastructure/create/setup-remote.d.ts.map +1 -1
  29. package/dist/infrastructure/create/setup-remote.js +7 -2
  30. package/dist/infrastructure/create/setup-remote.js.map +1 -1
  31. package/dist/infrastructure/integrations/ensure-studio-headers.d.ts +6 -0
  32. package/dist/infrastructure/integrations/ensure-studio-headers.d.ts.map +1 -0
  33. package/dist/infrastructure/integrations/ensure-studio-headers.js +153 -0
  34. package/dist/infrastructure/integrations/ensure-studio-headers.js.map +1 -0
  35. package/dist/infrastructure/update/cache.d.ts +14 -0
  36. package/dist/infrastructure/update/cache.d.ts.map +1 -0
  37. package/dist/infrastructure/update/cache.js +41 -0
  38. package/dist/infrastructure/update/cache.js.map +1 -0
  39. package/dist/infrastructure/update/check-version.d.ts +2 -0
  40. package/dist/infrastructure/update/check-version.d.ts.map +1 -0
  41. package/dist/infrastructure/update/check-version.js +33 -0
  42. package/dist/infrastructure/update/check-version.js.map +1 -0
  43. package/dist/infrastructure/update/notifier.d.ts +8 -0
  44. package/dist/infrastructure/update/notifier.d.ts.map +1 -0
  45. package/dist/infrastructure/update/notifier.js +141 -0
  46. package/dist/infrastructure/update/notifier.js.map +1 -0
  47. package/dist/modules/features/cms/sanity/config.d.ts.map +1 -1
  48. package/dist/modules/features/cms/sanity/config.js +2 -1
  49. package/dist/modules/features/cms/sanity/config.js.map +1 -1
  50. package/dist/modules/features/cms/sanity-pagebuilder/config.d.ts.map +1 -1
  51. package/dist/modules/features/cms/sanity-pagebuilder/config.js +4 -1
  52. package/dist/modules/features/cms/sanity-pagebuilder/config.js.map +1 -1
  53. package/package.json +2 -2
  54. package/src/modules/features/cms/sanity/files/app/api/blog/[slug]/route.ts +4 -1
  55. package/src/modules/features/cms/sanity/files/app/sitemap.md/route.ts +2 -1
  56. package/src/modules/features/cms/sanity/files/components/ui/sanity-image/index.tsx +19 -5
  57. package/src/modules/features/cms/sanity/files/lib/integrations/sanity/README.md +31 -0
  58. package/src/modules/features/cms/sanity/files/proxy.ts +9 -0
  59. package/src/modules/features/cms/sanity-pagebuilder/files/app/api/[[...slug]]/route.ts +8 -3
  60. package/src/modules/features/cms/sanity-pagebuilder/files/app/sitemap.md/route.ts +7 -1
  61. package/src/modules/features/cms/sanity-pagebuilder/files/components/ui/sanity-image/index.tsx +15 -5
  62. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/block-actions-item.tsx +81 -0
  63. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-field.tsx +13 -7
  64. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/components/slug-notices.tsx +135 -0
  65. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/icons.ts +2 -0
  66. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/live/index.tsx +1 -1
  67. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/markdown-proxy.config.ts +1 -1
  68. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/page-builder-config.ts +7 -0
  69. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/queries.ts +72 -21
  70. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/index.ts +1 -0
  71. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/components/reusable/gated-content.ts +178 -0
  72. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/index.ts +9 -1
  73. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/layout/redirect.ts +35 -4
  74. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/metadata.ts +54 -1
  75. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page-builder.ts +4 -0
  76. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/schemas/shared/page.ts +11 -0
  77. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/structure.ts +4 -0
  78. package/src/modules/features/cms/sanity-pagebuilder/files/lib/integrations/sanity/utils/page-builder-markdown.ts +20 -0
  79. package/src/modules/features/cms/sanity-pagebuilder/files/lib/utils/metadata.ts +27 -5
  80. package/src/modules/features/cms/sanity-pagebuilder/files/proxy.ts +9 -0
  81. package/src/modules/features/env/dotenvx/files/setup-remote.ts +3 -1
  82. package/src/templates/next-default/.env.example +10 -0
  83. package/src/templates/next-default/.github/workflows/ci.yml +7 -0
  84. package/src/templates/next-default/README.md +14 -0
  85. package/src/templates/next-default/app/robots.ts +2 -3
  86. package/src/templates/next-default/knip.json +8 -6
  87. package/src/templates/next-default/lefthook.yml +0 -5
  88. package/src/templates/next-default/next.config.ts +36 -2
  89. package/src/templates/next-default/package.json +9 -9
  90. package/src/templates/next-experiments/.env.example +10 -0
  91. package/src/templates/next-experiments/.github/workflows/ci.yml +7 -0
  92. package/src/templates/next-experiments/README.md +14 -0
  93. package/src/templates/next-experiments/app/robots.ts +2 -3
  94. package/src/templates/next-experiments/knip.json +8 -6
  95. package/src/templates/next-experiments/lefthook.yml +0 -5
  96. package/src/templates/next-experiments/next.config.ts +36 -2
  97. package/src/templates/next-experiments/package.json +9 -9
  98. package/src/templates/next-pagebuilder/.env.example +10 -0
  99. package/src/templates/next-pagebuilder/.github/PULL_REQUEST_TEMPLATE.md +13 -0
  100. package/src/templates/next-pagebuilder/.github/workflows/ci.yml +15 -0
  101. package/src/templates/next-pagebuilder/README.md +45 -0
  102. package/src/templates/next-pagebuilder/app/(content)/[[...slug]]/page.tsx +26 -11
  103. package/src/templates/next-pagebuilder/app/actions/unlock-gated-content.ts +39 -0
  104. package/src/templates/next-pagebuilder/app/robots.ts +2 -3
  105. package/src/templates/next-pagebuilder/app/sitemap.xml/route.ts +6 -3
  106. package/src/templates/next-pagebuilder/components/page-builder/components/content-collection/skeleton.tsx +53 -0
  107. package/src/templates/next-pagebuilder/components/page-builder/components/gated-content/index.tsx +169 -0
  108. package/src/templates/next-pagebuilder/components/page-builder/renderer.tsx +10 -1
  109. package/src/templates/next-pagebuilder/knip.json +8 -6
  110. package/src/templates/next-pagebuilder/lefthook.yml +0 -5
  111. package/src/templates/next-pagebuilder/lib/integrations/sanity/sanity.types.ts +81 -0
  112. package/src/templates/next-pagebuilder/next.config.ts +33 -2
  113. package/src/templates/next-pagebuilder/package.json +4 -4
  114. package/src/templates/next-webgl/.env.example +10 -0
  115. package/src/templates/next-webgl/.github/workflows/ci.yml +7 -0
  116. package/src/templates/next-webgl/README.md +14 -0
  117. package/src/templates/next-webgl/app/robots.ts +2 -3
  118. package/src/templates/next-webgl/knip.json +8 -6
  119. package/src/templates/next-webgl/lefthook.yml +0 -5
  120. package/src/templates/next-webgl/next.config.ts +36 -2
  121. package/src/templates/next-webgl/package.json +9 -9
@@ -1,6 +1,7 @@
1
1
  # ============================================
2
2
  # Basement Next Starter - Environment Variables
3
3
  # ============================================
4
+ # bsmnt:if dotenvx
4
5
  # This project uses dotenvx (https://dotenvx.com): the committed `.env` holds
5
6
  # shared values, with secrets encrypted there. The private keys live in
6
7
  # `.env.keys` (gitignored) — restore them with `bun run env:setup`.
@@ -15,6 +16,13 @@
15
16
  #
16
17
  # This file just documents the available variables; real values live in `.env`.
17
18
  # ============================================
19
+ # bsmnt:endif
20
+ # bsmnt:if !dotenvx
21
+ # Copy this file to `.env.local` and fill in the values you need.
22
+ # `.env.local` is gitignored, so real values stay off version control.
23
+ # Only NEXT_PUBLIC_* variables are exposed to the browser.
24
+ # ============================================
25
+ # bsmnt:endif
18
26
 
19
27
 
20
28
  # ============================================
@@ -24,6 +32,8 @@
24
32
  # Base URL for your site (used for SEO, canonical URLs, etc.)
25
33
  # Development: http://localhost:3000
26
34
  # Production: https://your-domain.com
35
+ # Inlined at build time — scope this to the Production environment only in
36
+ # Vercel so Preview deployments fall through to VERCEL_PROJECT_PRODUCTION_URL.
27
37
  NEXT_PUBLIC_BASE_URL=""
28
38
 
29
39
  # Draft mode secret for preview functionality
@@ -46,6 +46,7 @@ jobs:
46
46
  - name: Lint
47
47
  run: bun run lint
48
48
 
49
+ # bsmnt:if dotenvx
49
50
  # dotenvx needs the private key to decrypt secrets at build time. It's
50
51
  # pulled from 1Password via an org-wide service-account token + the op-ref
51
52
  # committed in .env. Optional: builds pass without it (only plaintext /
@@ -70,6 +71,12 @@ jobs:
70
71
  fi
71
72
  bun run build
72
73
 
74
+ # bsmnt:endif
75
+ # bsmnt:if !dotenvx
76
+ - name: Build
77
+ run: bun run build
78
+
79
+ # bsmnt:endif
73
80
  # Runs your tests if any exist; a fresh project with none passes cleanly.
74
81
  - name: Test
75
82
  run: |
@@ -22,6 +22,7 @@ bun dev
22
22
  | `bun format` | Format the codebase |
23
23
  | `bun typecheck` | Run TypeScript |
24
24
  | `bun analyze` | Analyze the Next.js bundle |
25
+ <!-- bsmnt:if dotenvx -->
25
26
  | `bun env:set KEY value` | Encrypt one value into `.env` (`--plain`, `--preview`/`--prod`) |
26
27
  | `bun env:encrypt-all` | Bulk-encrypt every plaintext value in a file (`--preview`/`--prod`) |
27
28
  | `bun env:setup` | Restore `.env.keys` from 1Password |
@@ -29,7 +30,9 @@ bun dev
29
30
  | `bun env:setup-remote` | Push private keys to GitHub / Vercel (`github`/`vercel`, or pick) |
30
31
  | `bun setup-remote` | Create the GitHub repo, link a Vercel project, and push the key to Vercel env |
31
32
  | `bun env:save` | Save the private key to 1Password (Development vault) |
33
+ <!-- bsmnt:endif -->
32
34
 
35
+ <!-- bsmnt:if dotenvx -->
33
36
  ## Environment variables
34
37
 
35
38
  Secrets are encrypted at rest with [dotenvx](https://dotenvx.com): the committed `.env` holds encrypted values, the private keys live in `.env.keys` (gitignored), and dev/build run through `dotenvx run` so values decrypt automatically.
@@ -53,6 +56,15 @@ Secrets are encrypted at rest with [dotenvx](https://dotenvx.com): the committed
53
56
 
54
57
  A gitleaks pre-commit hook + CI scan block committed plaintext secrets (install: `brew install gitleaks`).
55
58
 
59
+ <!-- bsmnt:endif -->
60
+ <!-- bsmnt:if !dotenvx -->
61
+ ## Environment variables
62
+
63
+ Copy `.env.example` to `.env.local` and fill in the values you need. `.env.local` is gitignored, so it stays off version control. Only `NEXT_PUBLIC_*` variables are exposed to the browser — everything else is server-only.
64
+
65
+ For deploys, set the same variables in your host's dashboard (e.g. Vercel → Settings → Environment Variables).
66
+
67
+ <!-- bsmnt:endif -->
56
68
  ## Project Structure
57
69
 
58
70
  ```txt
@@ -91,8 +103,10 @@ The workflow takes its runtime versions from your manifests, so there's a single
91
103
 
92
104
  It also caches Bun's install cache between runs, and the test step is a no-op until you add real test files.
93
105
 
106
+ <!-- bsmnt:if dotenvx -->
94
107
  The build decrypts the committed `.env` with the dotenvx private key, pulled from 1Password: set an **org-level** `OP_SERVICE_ACCOUNT_TOKEN` (a read-only [service account](https://developer.1password.com/docs/service-accounts/) scoped to the `Development` vault) — one secret for every repo — and CI reads the key via the op-ref committed in `.env`. A per-repo `DOTENV_PRIVATE_KEY` secret (`bun run env:setup-remote github`) works as a fallback; builds pass without either (only plaintext / `NEXT_PUBLIC_*` is read).
95
108
 
109
+ <!-- bsmnt:endif -->
96
110
  ### Branch protection
97
111
 
98
112
  To block merges when CI fails, enable branch protection on `main`:
@@ -1,6 +1,5 @@
1
1
  import type { MetadataRoute } from "next"
2
-
3
- const APP_BASE_URL = process.env.NEXT_PUBLIC_BASE_URL ?? "http://localhost:3000"
2
+ import { getBaseUrl } from "@/lib/utils/url"
4
3
 
5
4
  export default function robots(): MetadataRoute.Robots {
6
5
  return {
@@ -9,6 +8,6 @@ export default function robots(): MetadataRoute.Robots {
9
8
  allow: "/",
10
9
  disallow: [],
11
10
  },
12
- sitemap: `${APP_BASE_URL}/sitemap.xml`,
11
+ sitemap: `${getBaseUrl()}/sitemap.xml`,
13
12
  }
14
13
  }
@@ -11,11 +11,13 @@
11
11
  "@svgr/webpack",
12
12
  "gsap",
13
13
  "@gsap/react",
14
- "motion"
14
+ "motion",
15
+ "detect-gpu",
16
+ "lodash-es",
17
+ "@types/lodash-es",
18
+ "react-device-detect",
19
+ "zustand"
15
20
  ],
16
- "ignoreBinaries": [
17
- "op",
18
- "gh",
19
- "vercel"
20
- ]
21
+ "ignoreBinaries": ["op", "gh", "vercel"],
22
+ "ignoreFiles": [".agents/**", ".claude/**", "hooks/**"]
21
23
  }
@@ -14,11 +14,6 @@ pre-commit:
14
14
  run: bunx tsgo --noEmit --incremental false
15
15
  stage_fixed: false
16
16
 
17
- pre-push:
18
- commands:
19
- knip:
20
- run: bun run knip
21
-
22
17
  post-merge:
23
18
  commands:
24
19
  install-deps:
@@ -64,8 +64,10 @@ const nextConfig: NextConfig = {
64
64
  },
65
65
  },
66
66
  },
67
+ logging: {
68
+ browserToTerminal: true,
69
+ },
67
70
  experimental: {
68
- browserDebugInfoInTerminal: true,
69
71
  optimizePackageImports: [
70
72
  "@react-three/drei",
71
73
  "@react-three/fiber",
@@ -86,7 +88,8 @@ const nextConfig: NextConfig = {
86
88
  },
87
89
  headers: async () => [
88
90
  {
89
- source: "/(.*)",
91
+ // Excludes /studio* — must stay mutually exclusive with the rule below.
92
+ source: "/((?!studio(?:/|$)).*)",
90
93
  headers: [
91
94
  {
92
95
  key: "X-Content-Type-Options",
@@ -118,6 +121,37 @@ const nextConfig: NextConfig = {
118
121
  },
119
122
  ],
120
123
  },
124
+ {
125
+ // X-Frame-Options can't allow a third-party origin, and Next can't unset
126
+ // it from another rule — the iframe needs it absent, not overridden.
127
+ source: "/studio/:path*",
128
+ headers: [
129
+ {
130
+ key: "X-Content-Type-Options",
131
+ value: "nosniff",
132
+ },
133
+ {
134
+ key: "Content-Security-Policy",
135
+ value: "frame-ancestors 'self' https://*.sanity.io;",
136
+ },
137
+ {
138
+ key: "X-XSS-Protection",
139
+ value: "1; mode=block",
140
+ },
141
+ {
142
+ key: "X-DNS-Prefetch-Control",
143
+ value: "on",
144
+ },
145
+ {
146
+ key: "Strict-Transport-Security",
147
+ value: "max-age=63072000; includeSubDomains; preload",
148
+ },
149
+ {
150
+ key: "Permissions-Policy",
151
+ value: "camera=(), microphone=(), geolocation=()",
152
+ },
153
+ ],
154
+ },
121
155
  ],
122
156
  redirects: async () => [
123
157
  {
@@ -32,32 +32,32 @@
32
32
  "@react-three/fiber": "^10.0.0-alpha.2",
33
33
  "class-variance-authority": "^0.7.1",
34
34
  "clsx": "^2.1.1",
35
- "next": "^16",
36
- "react": "^19",
37
- "react-dom": "^19",
35
+ "next": "^16.3.0",
36
+ "react": "^19.2.8",
37
+ "react-dom": "^19.2.8",
38
38
  "tailwind-merge": "^3.4.0",
39
39
  "three": "^0.182.0",
40
40
  "zod": "^4.3.6"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "^2.4.14",
44
- "@next/bundle-analyzer": "^16",
44
+ "@next/bundle-analyzer": "^16.3.0",
45
45
  "@svgr/webpack": "^8.1.0",
46
- "@tailwindcss/postcss": "^4",
46
+ "@tailwindcss/postcss": "^4.2.2",
47
47
  "@types/bun": "^1.3.6",
48
48
  "@types/node": "^24.13.1",
49
- "@types/react": "^19.2.9",
49
+ "@types/react": "^19.2.14",
50
50
  "@types/react-dom": "^19.2.3",
51
51
  "@types/three": "^0.182.0",
52
- "@typescript/native-preview": "^7.0.0-dev.20260122.3",
52
+ "@typescript/native-preview": "^7.0.0-dev.20260323.1",
53
53
  "babel-plugin-react-compiler": "^1.0.0",
54
54
  "cross-env": "^10.1.0",
55
55
  "knip": "^6.16.1",
56
56
  "lefthook": "^1.13.0",
57
57
  "postcss-preset-env": "^10.6.1",
58
58
  "schema-dts": "^2.0.0",
59
- "tailwindcss": "^4",
60
- "typescript": "^5"
59
+ "tailwindcss": "^4.2.2",
60
+ "typescript": "^5.9.3"
61
61
  },
62
62
  "trustedDependencies": [
63
63
  "@biomejs/biome",