@react-consulting/rc-kit 0.0.0-stage → 0.13.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 (337) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -2
  3. package/devkit/README.md +301 -0
  4. package/devkit/cli.test.ts +211 -0
  5. package/devkit/cli.ts +120 -0
  6. package/devkit/commands/build.ts +127 -0
  7. package/devkit/commands/checks.ts +123 -0
  8. package/devkit/commands/context.ts +47 -0
  9. package/devkit/commands/db.ts +154 -0
  10. package/devkit/commands/deploy.ts +46 -0
  11. package/devkit/commands/dev.ts +191 -0
  12. package/devkit/commands/doctor.ts +25 -0
  13. package/devkit/commands/kit.ts +45 -0
  14. package/devkit/commands/new.ts +81 -0
  15. package/devkit/commands/registry.ts +20 -0
  16. package/devkit/commands/secrets.ts +254 -0
  17. package/devkit/lib/args.ts +65 -0
  18. package/devkit/lib/audit.test.ts +405 -0
  19. package/devkit/lib/audit.ts +813 -0
  20. package/devkit/lib/config.test.ts +203 -0
  21. package/devkit/lib/config.ts +417 -0
  22. package/devkit/lib/database/index.test.ts +223 -0
  23. package/devkit/lib/database/index.ts +314 -0
  24. package/devkit/lib/database/neon.test.ts +233 -0
  25. package/devkit/lib/database/neon.ts +357 -0
  26. package/devkit/lib/database/prepare.ts +54 -0
  27. package/devkit/lib/deploy-config.test.ts +217 -0
  28. package/devkit/lib/deploy-config.ts +133 -0
  29. package/devkit/lib/deploy.test.ts +275 -0
  30. package/devkit/lib/deploy.ts +177 -0
  31. package/devkit/lib/dev-gateway.test.ts +128 -0
  32. package/devkit/lib/dev-gateway.ts +162 -0
  33. package/devkit/lib/dev-menu.test.ts +114 -0
  34. package/devkit/lib/dev-menu.ts +332 -0
  35. package/devkit/lib/dev-secrets.test.ts +156 -0
  36. package/devkit/lib/dev-secrets.ts +97 -0
  37. package/devkit/lib/dev.test.ts +194 -0
  38. package/devkit/lib/dev.ts +119 -0
  39. package/devkit/lib/doctor.test.ts +144 -0
  40. package/devkit/lib/doctor.ts +264 -0
  41. package/devkit/lib/env-file.test.ts +102 -0
  42. package/devkit/lib/env-file.ts +96 -0
  43. package/devkit/lib/glob.ts +31 -0
  44. package/devkit/lib/infisical.test.ts +208 -0
  45. package/devkit/lib/infisical.ts +139 -0
  46. package/devkit/lib/json-schema.ts +220 -0
  47. package/devkit/lib/jsonc.test.ts +53 -0
  48. package/devkit/lib/jsonc.ts +93 -0
  49. package/devkit/lib/kit-migrate.test.ts +215 -0
  50. package/devkit/lib/kit-migrate.ts +624 -0
  51. package/devkit/lib/kit-package.test.ts +83 -0
  52. package/devkit/lib/kit-package.ts +57 -0
  53. package/devkit/lib/kit-version.ts +22 -0
  54. package/devkit/lib/naming.test.ts +547 -0
  55. package/devkit/lib/naming.ts +796 -0
  56. package/devkit/lib/paths.ts +7 -0
  57. package/devkit/lib/process.ts +78 -0
  58. package/devkit/lib/project-checks.ts +86 -0
  59. package/devkit/lib/scaffold.test.ts +302 -0
  60. package/devkit/lib/scaffold.ts +315 -0
  61. package/devkit/lib/secrets.test.ts +101 -0
  62. package/devkit/lib/secrets.ts +125 -0
  63. package/devkit/lib/sourcemaps.test.ts +86 -0
  64. package/devkit/lib/sourcemaps.ts +98 -0
  65. package/devkit/lib/test-utils.ts +68 -0
  66. package/devkit/lib/workspace.ts +87 -0
  67. package/devkit/lib/wrangler.ts +231 -0
  68. package/docs/rc-config.md +93 -0
  69. package/package.json +86 -4
  70. package/presets/build.d.ts +15 -0
  71. package/presets/build.js +53 -0
  72. package/presets/vite-plus.d.ts +28 -0
  73. package/presets/vite-plus.js +153 -0
  74. package/registry/README.md +294 -0
  75. package/registry/public/r/avatar-stack.json +18 -0
  76. package/registry/public/r/avatar.json +20 -0
  77. package/registry/public/r/back-link.json +21 -0
  78. package/registry/public/r/badge.json +17 -0
  79. package/registry/public/r/button.json +18 -0
  80. package/registry/public/r/calendar-days.json +14 -0
  81. package/registry/public/r/calendar-popover.json +24 -0
  82. package/registry/public/r/calendar.json +23 -0
  83. package/registry/public/r/callout.json +20 -0
  84. package/registry/public/r/card.json +18 -0
  85. package/registry/public/r/character-counter.json +17 -0
  86. package/registry/public/r/checkbox.json +22 -0
  87. package/registry/public/r/choice-cards.json +22 -0
  88. package/registry/public/r/color-tag.json +17 -0
  89. package/registry/public/r/combobox.json +24 -0
  90. package/registry/public/r/confirm-button.json +24 -0
  91. package/registry/public/r/confirm-dialog.json +23 -0
  92. package/registry/public/r/copy-button.json +24 -0
  93. package/registry/public/r/date-picker.json +24 -0
  94. package/registry/public/r/date-range-picker.json +28 -0
  95. package/registry/public/r/detail-header.json +17 -0
  96. package/registry/public/r/detail-row.json +17 -0
  97. package/registry/public/r/dev-inbox-api.json +33 -0
  98. package/registry/public/r/dev-toolbar.json +109 -0
  99. package/registry/public/r/dev-tools-contract.json +15 -0
  100. package/registry/public/r/dialog.json +23 -0
  101. package/registry/public/r/empty-state.json +20 -0
  102. package/registry/public/r/error-state.json +23 -0
  103. package/registry/public/r/eyebrow.json +17 -0
  104. package/registry/public/r/fab.json +20 -0
  105. package/registry/public/r/field-error.json +17 -0
  106. package/registry/public/r/field-grid.json +17 -0
  107. package/registry/public/r/field.json +19 -0
  108. package/registry/public/r/file-picker.json +22 -0
  109. package/registry/public/r/filter-chips.json +17 -0
  110. package/registry/public/r/form-section.json +17 -0
  111. package/registry/public/r/form-sheet.json +22 -0
  112. package/registry/public/r/icon-button.json +23 -0
  113. package/registry/public/r/input.json +18 -0
  114. package/registry/public/r/label.json +18 -0
  115. package/registry/public/r/list-row.json +17 -0
  116. package/registry/public/r/loading-state.json +18 -0
  117. package/registry/public/r/localized-field.json +23 -0
  118. package/registry/public/r/markdown-text.json +17 -0
  119. package/registry/public/r/menu.json +21 -0
  120. package/registry/public/r/money-input.json +17 -0
  121. package/registry/public/r/month-day-select.json +18 -0
  122. package/registry/public/r/numbered-step.json +20 -0
  123. package/registry/public/r/page-actions.json +14 -0
  124. package/registry/public/r/page-header.json +17 -0
  125. package/registry/public/r/pending.json +17 -0
  126. package/registry/public/r/person-option.json +21 -0
  127. package/registry/public/r/popover.json +20 -0
  128. package/registry/public/r/progress-bar.json +17 -0
  129. package/registry/public/r/query-view.json +22 -0
  130. package/registry/public/r/registry.json +1352 -0
  131. package/registry/public/r/retry-button.json +21 -0
  132. package/registry/public/r/rich-text-editor.json +32 -0
  133. package/registry/public/r/save-bar.json +22 -0
  134. package/registry/public/r/search-input.json +23 -0
  135. package/registry/public/r/search-select.json +24 -0
  136. package/registry/public/r/section-tabs.json +17 -0
  137. package/registry/public/r/segmented.json +18 -0
  138. package/registry/public/r/select.json +23 -0
  139. package/registry/public/r/sheet.json +24 -0
  140. package/registry/public/r/skeleton.json +17 -0
  141. package/registry/public/r/spinner.json +20 -0
  142. package/registry/public/r/stale-notice.json +23 -0
  143. package/registry/public/r/stat-tile.json +23 -0
  144. package/registry/public/r/stepper.json +23 -0
  145. package/registry/public/r/suggestion-strip.json +21 -0
  146. package/registry/public/r/swatch-picker.json +22 -0
  147. package/registry/public/r/switch.json +21 -0
  148. package/registry/public/r/tabs.json +20 -0
  149. package/registry/public/r/textarea.json +18 -0
  150. package/registry/public/r/theme.json +15 -0
  151. package/registry/public/r/timezone-select.json +19 -0
  152. package/registry/public/r/toaster.json +21 -0
  153. package/registry/public/r/tooltip.json +17 -0
  154. package/registry/public/r/ui-labels.json +14 -0
  155. package/registry/public/r/use-copy-to-clipboard.json +20 -0
  156. package/registry/public/r/use-online.json +14 -0
  157. package/registry/public/r/use-stale-queries.json +17 -0
  158. package/registry/public/r/utils.json +18 -0
  159. package/registry/public/r/weekday-picker.json +19 -0
  160. package/registry/public/r/yes-no.json +20 -0
  161. package/registry/serve.ts +29 -0
  162. package/rules/architecture.md +47 -0
  163. package/rules/cloudflare.md +74 -0
  164. package/rules/code.md +12 -0
  165. package/rules/git.md +10 -0
  166. package/rules/index.md +14 -0
  167. package/rules/observability.md +13 -0
  168. package/rules/performance.md +39 -0
  169. package/rules/runtime.md +9 -0
  170. package/rules/secrets.md +11 -0
  171. package/rules/stack.md +33 -0
  172. package/rules/ui.md +23 -0
  173. package/runtime/ai.test.ts +106 -0
  174. package/runtime/ai.ts +125 -0
  175. package/runtime/observability/allowlists.ts +42 -0
  176. package/runtime/observability/anonymize.test.ts +111 -0
  177. package/runtime/observability/anonymize.ts +249 -0
  178. package/runtime/observability/browser.test.ts +46 -0
  179. package/runtime/observability/browser.ts +126 -0
  180. package/runtime/observability/server.test.ts +84 -0
  181. package/runtime/observability/server.ts +152 -0
  182. package/runtime/observability/tunnel.test.ts +276 -0
  183. package/runtime/observability/tunnel.ts +360 -0
  184. package/runtime/observability/user-agent.ts +51 -0
  185. package/schema/rc.config.schema.json +333 -0
  186. package/template/.gitattributes +1 -0
  187. package/template/.github/workflows/ci.yml +64 -0
  188. package/template/CLAUDE.md +48 -0
  189. package/template/README.md +50 -0
  190. package/template/apps/admin/.dev.vars.example +5 -0
  191. package/template/apps/admin/components.json +24 -0
  192. package/template/apps/admin/package.json +48 -0
  193. package/template/apps/admin/public/favicon.svg +1 -0
  194. package/template/apps/admin/src/components/app-shell.tsx +41 -0
  195. package/template/apps/admin/src/components/dev-sign-in-links.tsx +57 -0
  196. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-context.ts +13 -0
  197. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-environment-panel.tsx +105 -0
  198. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-list.tsx +54 -0
  199. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-message.tsx +104 -0
  200. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-inbox-panel.tsx +130 -0
  201. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-launcher.tsx +45 -0
  202. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-panel.tsx +90 -0
  203. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar-types.ts +11 -0
  204. package/template/apps/admin/src/components/dev-toolbar/dev-toolbar.tsx +61 -0
  205. package/template/apps/admin/src/components/dev-toolbar/development-devtools.tsx +32 -0
  206. package/template/apps/admin/src/components/login-form.tsx +115 -0
  207. package/template/apps/admin/src/components/login-sent.tsx +23 -0
  208. package/template/apps/admin/src/components/message-list.tsx +44 -0
  209. package/template/apps/admin/src/components/turnstile-challenge.tsx +140 -0
  210. package/template/apps/admin/src/components/ui/button.tsx +87 -0
  211. package/template/apps/admin/src/components/ui/callout.tsx +84 -0
  212. package/template/apps/admin/src/components/ui/card.tsx +48 -0
  213. package/template/apps/admin/src/components/ui/eyebrow.tsx +33 -0
  214. package/template/apps/admin/src/components/ui/field-error.tsx +24 -0
  215. package/template/apps/admin/src/components/ui/field.tsx +100 -0
  216. package/template/apps/admin/src/components/ui/input.tsx +73 -0
  217. package/template/apps/admin/src/components/ui/label.tsx +39 -0
  218. package/template/apps/admin/src/components/ui/skeleton.tsx +225 -0
  219. package/template/apps/admin/src/components/ui/spinner.tsx +12 -0
  220. package/template/apps/admin/src/components/ui/toaster.tsx +33 -0
  221. package/template/apps/admin/src/components/ui/tooltip.tsx +51 -0
  222. package/template/apps/admin/src/hooks/use-dev-inbox.ts +25 -0
  223. package/template/apps/admin/src/hooks/use-dev-toolbar-state.ts +48 -0
  224. package/template/apps/admin/src/lib/api.ts +39 -0
  225. package/template/apps/admin/src/lib/auth-client.ts +7 -0
  226. package/template/apps/admin/src/lib/dev-inbox-links.ts +66 -0
  227. package/template/apps/admin/src/lib/dev-tools-client.ts +54 -0
  228. package/template/apps/admin/src/lib/dev-tools-contract.ts +52 -0
  229. package/template/apps/admin/src/lib/messages.ts +5 -0
  230. package/template/apps/admin/src/lib/query-keys.ts +3 -0
  231. package/template/apps/admin/src/lib/security-headers.ts +18 -0
  232. package/template/apps/admin/src/lib/session.ts +27 -0
  233. package/template/apps/admin/src/lib/site-url.ts +7 -0
  234. package/template/apps/admin/src/lib/turnstile.ts +70 -0
  235. package/template/apps/admin/src/lib/ui-labels.tsx +182 -0
  236. package/template/apps/admin/src/lib/utils.ts +6 -0
  237. package/template/apps/admin/src/routeTree.gen.ts +109 -0
  238. package/template/apps/admin/src/router.tsx +29 -0
  239. package/template/apps/admin/src/routes/__root.tsx +56 -0
  240. package/template/apps/admin/src/routes/_app/index.tsx +38 -0
  241. package/template/apps/admin/src/routes/_app.tsx +26 -0
  242. package/template/apps/admin/src/routes/login.tsx +48 -0
  243. package/template/apps/admin/src/styles/app.css +11 -0
  244. package/template/apps/admin/src/worker.ts +88 -0
  245. package/template/apps/admin/tsconfig.json +19 -0
  246. package/template/apps/admin/vite.config.ts +69 -0
  247. package/template/apps/admin/wrangler.jsonc +92 -0
  248. package/template/apps/web/.env.example +1 -0
  249. package/template/apps/web/astro.config.ts +46 -0
  250. package/template/apps/web/package.json +33 -0
  251. package/template/apps/web/public/favicon.svg +1 -0
  252. package/template/apps/web/src/components/ContactForm.astro +78 -0
  253. package/template/apps/web/src/env.d.ts +11 -0
  254. package/template/apps/web/src/layouts/BaseLayout.astro +32 -0
  255. package/template/apps/web/src/lib/api.ts +8 -0
  256. package/template/apps/web/src/pages/api/messages.ts +32 -0
  257. package/template/apps/web/src/pages/index.astro +26 -0
  258. package/template/apps/web/src/pages/media/[...key].ts +4 -0
  259. package/template/apps/web/src/scripts/contact-form.ts +105 -0
  260. package/template/apps/web/src/scripts/error-reporting.ts +4 -0
  261. package/template/apps/web/src/scripts/turnstile.ts +177 -0
  262. package/template/apps/web/src/styles/global.css +11 -0
  263. package/template/apps/web/src/worker.ts +34 -0
  264. package/template/apps/web/tsconfig.json +11 -0
  265. package/template/apps/web/wrangler.jsonc +45 -0
  266. package/template/bun.lock +1925 -0
  267. package/template/bunfig.toml +2 -0
  268. package/template/gitignore +23 -0
  269. package/template/package.json +74 -0
  270. package/template/packages/api/components.json +21 -0
  271. package/template/packages/api/package.json +30 -0
  272. package/template/packages/api/src/client.ts +13 -0
  273. package/template/packages/api/src/cloudflare-env.d.ts +26 -0
  274. package/template/packages/api/src/emails/escape-html.ts +13 -0
  275. package/template/packages/api/src/emails/layout.ts +22 -0
  276. package/template/packages/api/src/emails/magic-link.ts +32 -0
  277. package/template/packages/api/src/emails/new-message.ts +32 -0
  278. package/template/packages/api/src/emails/send.ts +14 -0
  279. package/template/packages/api/src/lib/auth-guard.ts +16 -0
  280. package/template/packages/api/src/lib/auth.ts +108 -0
  281. package/template/packages/api/src/lib/context.ts +7 -0
  282. package/template/packages/api/src/lib/dev-inbox/routes.ts +77 -0
  283. package/template/packages/api/src/lib/dev-inbox/send.ts +57 -0
  284. package/template/packages/api/src/lib/dev-inbox/store.ts +185 -0
  285. package/template/packages/api/src/lib/dev-inbox.ts +6 -0
  286. package/template/packages/api/src/lib/dev-tools-contract.ts +52 -0
  287. package/template/packages/api/src/lib/environment.ts +17 -0
  288. package/template/packages/api/src/lib/turnstile.ts +33 -0
  289. package/template/packages/api/src/media.ts +45 -0
  290. package/template/packages/api/src/routes/admin-messages.ts +21 -0
  291. package/template/packages/api/src/routes/dev.ts +31 -0
  292. package/template/packages/api/src/routes/health.ts +7 -0
  293. package/template/packages/api/src/routes/messages.ts +58 -0
  294. package/template/packages/api/src/schemas.ts +18 -0
  295. package/template/packages/api/src/server.ts +29 -0
  296. package/template/packages/api/tsconfig.json +10 -0
  297. package/template/packages/db/migrations/0001_init.sql +79 -0
  298. package/template/packages/db/package.json +34 -0
  299. package/template/packages/db/prisma/schema.prisma +95 -0
  300. package/template/packages/db/prisma.config.ts +9 -0
  301. package/template/packages/db/scripts/migrate.ts +15 -0
  302. package/template/packages/db/scripts/new-migration.ts +185 -0
  303. package/template/packages/db/scripts/reset.ts +54 -0
  304. package/template/packages/db/scripts/seed.ts +44 -0
  305. package/template/packages/db/scripts/wrangler.ts +35 -0
  306. package/template/packages/db/src/d1.ts +7 -0
  307. package/template/packages/db/src/migration-guard.test.ts +43 -0
  308. package/template/packages/db/src/migration-guard.ts +51 -0
  309. package/template/packages/db/src/new-migration.test.ts +16 -0
  310. package/template/packages/db/src/scope.ts +38 -0
  311. package/template/packages/db/src/seed.ts +30 -0
  312. package/template/packages/db/src/sql.ts +42 -0
  313. package/template/packages/db/tsconfig.json +8 -0
  314. package/template/packages/shared/components.json +21 -0
  315. package/template/packages/shared/package.json +33 -0
  316. package/template/packages/shared/src/edge/origins.ts +20 -0
  317. package/template/packages/shared/src/edge/turnstile.ts +11 -0
  318. package/template/packages/shared/src/locales.ts +13 -0
  319. package/template/packages/shared/src/message-rules.ts +16 -0
  320. package/template/packages/shared/src/messages.test.ts +26 -0
  321. package/template/packages/shared/src/messages.ts +30 -0
  322. package/template/packages/shared/src/observability/build-release.ts +9 -0
  323. package/template/packages/shared/src/observability/error-reporting.ts +31 -0
  324. package/template/packages/shared/src/observability/error-tunnel.ts +20 -0
  325. package/template/packages/shared/src/observability/sentry-browser.ts +1 -0
  326. package/template/packages/shared/src/observability/server-errors.ts +74 -0
  327. package/template/packages/shared/src/project.ts +1 -0
  328. package/template/packages/shared/src/styles/rc-theme.css +138 -0
  329. package/template/packages/shared/src/styles/theme.css +9 -0
  330. package/template/packages/shared/tsconfig.json +10 -0
  331. package/template/rc.config.json +25 -0
  332. package/template/scripts/bootstrap-local.ts +42 -0
  333. package/template/tsconfig.base.json +20 -0
  334. package/template/tsconfig.json +8 -0
  335. package/template/tsconfig.worker.json +7 -0
  336. package/template/turbo.json +40 -0
  337. package/template/vite.config.ts +8 -0
@@ -0,0 +1,98 @@
1
+ import { readdirSync, rmSync } from "node:fs"
2
+ import { join } from "node:path"
3
+
4
+ import type { SentryConfig } from "./config"
5
+
6
+ export const DEFAULT_SENTRY_URL = "https://de.sentry.io/"
7
+
8
+ export type SourcemapsPlan =
9
+ | { action: "upload"; project: string; release: string; url: string }
10
+ | { action: "skip"; reason: string }
11
+ | { action: "fail"; reason: string }
12
+
13
+ export interface SourcemapsPlanInput {
14
+ sentry: SentryConfig | undefined
15
+ app: string
16
+ release: string | null
17
+ env: Record<string, string | undefined>
18
+ }
19
+
20
+ export function isWorkersBuild(
21
+ env: Record<string, string | undefined>
22
+ ): boolean {
23
+ return env.WORKERS_CI === "1"
24
+ }
25
+
26
+ export function planSourcemaps(input: SourcemapsPlanInput): SourcemapsPlan {
27
+ const project = input.sentry?.projects[input.app]
28
+
29
+ if (!(input.sentry && project)) {
30
+ return {
31
+ action: "fail",
32
+ reason: `rc.config.json : sentry.projects.${input.app} absent (organisation et projet Sentry de l'app).`,
33
+ }
34
+ }
35
+
36
+ if (!input.env.SENTRY_AUTH_TOKEN) {
37
+ return isWorkersBuild(input.env)
38
+ ? {
39
+ action: "fail",
40
+ reason:
41
+ "SENTRY_AUTH_TOKEN absent de ce build Workers Builds : les erreurs de production arriveraient illisibles dans Sentry.",
42
+ }
43
+ : { action: "skip", reason: "SENTRY_AUTH_TOKEN absent, envoi sauté." }
44
+ }
45
+
46
+ if (!input.release) {
47
+ return {
48
+ action: "fail",
49
+ reason:
50
+ "release introuvable : ni WORKERS_CI_COMMIT_SHA ni commit git courant.",
51
+ }
52
+ }
53
+
54
+ return {
55
+ action: "upload",
56
+ project,
57
+ release: input.release,
58
+ url: input.sentry.url ?? DEFAULT_SENTRY_URL,
59
+ }
60
+ }
61
+
62
+ export function sentryCliCommands(
63
+ plan: Extract<SourcemapsPlan, { action: "upload" }>,
64
+ org: string,
65
+ directories: string[]
66
+ ): string[][] {
67
+ return [
68
+ ["sourcemaps", "inject", ...directories],
69
+ [
70
+ "sourcemaps",
71
+ "upload",
72
+ "--org",
73
+ org,
74
+ "--project",
75
+ plan.project,
76
+ "--release",
77
+ plan.release,
78
+ ...directories,
79
+ ],
80
+ ]
81
+ }
82
+
83
+ export function removeSourceMaps(directory: string): number {
84
+ let removed = 0
85
+
86
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
87
+ const path = join(directory, entry.name)
88
+
89
+ if (entry.isDirectory()) {
90
+ removed += removeSourceMaps(path)
91
+ } else if (entry.name.endsWith(".map")) {
92
+ rmSync(path)
93
+ removed += 1
94
+ }
95
+ }
96
+
97
+ return removed
98
+ }
@@ -0,0 +1,68 @@
1
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"
2
+ import { tmpdir } from "node:os"
3
+ import { dirname, join } from "node:path"
4
+
5
+ import type { RunOptions, RunResult, Runner } from "./process"
6
+
7
+ const created: string[] = []
8
+
9
+ export function tempDir(label = "rc-kit-"): string {
10
+ const dir = mkdtempSync(join(tmpdir(), label))
11
+
12
+ created.push(dir)
13
+
14
+ return dir
15
+ }
16
+
17
+ export function cleanupTempDirs(): void {
18
+ for (const dir of created.splice(0)) {
19
+ rmSync(dir, { force: true, recursive: true })
20
+ }
21
+ }
22
+
23
+ export function writeTree(
24
+ root: string,
25
+ files: Record<string, string | object>
26
+ ): string {
27
+ for (const [path, content] of Object.entries(files)) {
28
+ const file = join(root, path)
29
+
30
+ mkdirSync(dirname(file), { recursive: true })
31
+ writeFileSync(
32
+ file,
33
+ typeof content === "string"
34
+ ? content
35
+ : `${JSON.stringify(content, null, 2)}\n`
36
+ )
37
+ }
38
+
39
+ return root
40
+ }
41
+
42
+ export interface RecordedCall {
43
+ command: string[]
44
+ options: RunOptions
45
+ }
46
+
47
+ export function fakeRunner(
48
+ respond: (
49
+ command: string[],
50
+ options: RunOptions
51
+ ) => Partial<RunResult> | undefined
52
+ ): { runner: Runner; calls: RecordedCall[] } {
53
+ const calls: RecordedCall[] = []
54
+
55
+ return {
56
+ calls,
57
+ runner: (command, options = {}) => {
58
+ calls.push({ command, options })
59
+
60
+ return {
61
+ exitCode: 0,
62
+ stdout: "",
63
+ stderr: "",
64
+ ...respond(command, options),
65
+ }
66
+ },
67
+ }
68
+ }
@@ -0,0 +1,87 @@
1
+ import { existsSync, readFileSync } from "node:fs"
2
+ import { dirname, join, relative } from "node:path"
3
+
4
+ import { toPosixPath } from "./kit-package"
5
+
6
+ export interface PackageJson {
7
+ name?: string
8
+ scripts?: Record<string, string>
9
+ dependencies?: Record<string, string>
10
+ devDependencies?: Record<string, string>
11
+ peerDependencies?: Record<string, string>
12
+ optionalDependencies?: Record<string, string>
13
+ workspaces?:
14
+ | string[]
15
+ | { packages?: string[]; catalog?: Record<string, string> }
16
+ catalog?: Record<string, string>
17
+ overrides?: Record<string, string>
18
+ }
19
+
20
+ export interface Workspace {
21
+ dir: string
22
+ rel: string
23
+ pkg: PackageJson
24
+ }
25
+
26
+ export function readPackageJson(dir: string): PackageJson | null {
27
+ const path = join(dir, "package.json")
28
+
29
+ if (!existsSync(path)) {
30
+ return null
31
+ }
32
+
33
+ return JSON.parse(readFileSync(path, "utf8")) as PackageJson
34
+ }
35
+
36
+ export function workspacePatterns(pkg: PackageJson): string[] {
37
+ if (Array.isArray(pkg.workspaces)) {
38
+ return pkg.workspaces
39
+ }
40
+
41
+ return pkg.workspaces?.packages ?? []
42
+ }
43
+
44
+ export function catalogOf(pkg: PackageJson): Record<string, string> {
45
+ return {
46
+ ...pkg.catalog,
47
+ ...(Array.isArray(pkg.workspaces) ? {} : pkg.workspaces?.catalog),
48
+ }
49
+ }
50
+
51
+ export function dependenciesOf(pkg: PackageJson): Record<string, string> {
52
+ return {
53
+ ...pkg.optionalDependencies,
54
+ ...pkg.peerDependencies,
55
+ ...pkg.devDependencies,
56
+ ...pkg.dependencies,
57
+ }
58
+ }
59
+
60
+ export function listWorkspaces(root: string): Workspace[] {
61
+ const rootPkg = readPackageJson(root)
62
+
63
+ if (!rootPkg) {
64
+ return []
65
+ }
66
+
67
+ const dirs = new Set<string>()
68
+
69
+ for (const pattern of workspacePatterns(rootPkg)) {
70
+ const glob = new Bun.Glob(`${pattern.replace(/\/$/, "")}/package.json`)
71
+
72
+ for (const file of glob.scanSync({ cwd: root, onlyFiles: true })) {
73
+ if (!file.includes("node_modules")) {
74
+ dirs.add(dirname(join(root, file)))
75
+ }
76
+ }
77
+ }
78
+
79
+ return [
80
+ { dir: root, rel: ".", pkg: rootPkg },
81
+ ...[...dirs].toSorted().flatMap((dir) => {
82
+ const pkg = readPackageJson(dir)
83
+
84
+ return pkg ? [{ dir, rel: toPosixPath(relative(root, dir)), pkg }] : []
85
+ }),
86
+ ]
87
+ }
@@ -0,0 +1,231 @@
1
+ import { existsSync, readFileSync } from "node:fs"
2
+ import { join } from "node:path"
3
+
4
+ import { parseJsonc } from "./jsonc"
5
+
6
+ interface Binding {
7
+ binding?: string
8
+ }
9
+
10
+ export interface WranglerLevel {
11
+ name?: string
12
+ account_id?: string
13
+ vars?: Record<string, unknown>
14
+ secrets?: { required?: string[] }
15
+ d1_databases?: (Binding & { database_name?: string; database_id?: string })[]
16
+ r2_buckets?: (Binding & { bucket_name?: string })[]
17
+ kv_namespaces?: (Binding & { id?: string })[]
18
+ queues?: {
19
+ producers?: (Binding & { queue?: string })[]
20
+ consumers?: { queue?: string; dead_letter_queue?: string }[]
21
+ }
22
+ workflows?: (Binding & {
23
+ name?: string
24
+ class_name?: string
25
+ script_name?: string
26
+ })[]
27
+ services?: (Binding & { service?: string; entrypoint?: string })[]
28
+ ratelimits?: { name?: string; namespace_id?: string }[]
29
+ unsafe?: { bindings?: { name?: string; type?: string }[] }
30
+ durable_objects?: {
31
+ bindings?: { name?: string; class_name?: string; script_name?: string }[]
32
+ }
33
+ send_email?: { name?: string }[]
34
+ ai?: Binding
35
+ assets?: Binding
36
+ browser?: Binding
37
+ images?: Binding
38
+ version_metadata?: Binding
39
+ hyperdrive?: (Binding & { id?: string })[]
40
+ vectorize?: (Binding & { index_name?: string })[]
41
+ analytics_engine_datasets?: (Binding & { dataset?: string })[]
42
+ dispatch_namespaces?: (Binding & { namespace?: string })[]
43
+ mtls_certificates?: Binding[]
44
+ secrets_store_secrets?: Binding[]
45
+ [key: string]: unknown
46
+ }
47
+
48
+ export interface WranglerConfig extends WranglerLevel {
49
+ env?: Record<string, WranglerLevel>
50
+ }
51
+
52
+ export interface LevelRef {
53
+ key: string | null
54
+ label: string
55
+ level: WranglerLevel
56
+ }
57
+
58
+ export type BindingKind =
59
+ | "d1"
60
+ | "r2"
61
+ | "kv"
62
+ | "queue"
63
+ | "workflow"
64
+ | "service"
65
+ | "ratelimit"
66
+ | "durable_object"
67
+ | "send_email"
68
+ | "ai"
69
+ | "assets"
70
+ | "browser"
71
+ | "images"
72
+ | "version_metadata"
73
+ | "hyperdrive"
74
+ | "vectorize"
75
+ | "analytics_engine"
76
+ | "dispatch_namespace"
77
+ | "mtls_certificate"
78
+ | "secrets_store"
79
+ | "unsafe"
80
+
81
+ export interface BindingEntry {
82
+ kind: BindingKind
83
+ name: string
84
+ }
85
+
86
+ export const CONFIG_FILES = ["wrangler.jsonc", "wrangler.json"]
87
+
88
+ export function wranglerConfigPath(dir: string): string {
89
+ const found = CONFIG_FILES.map((file) => join(dir, file)).find((path) =>
90
+ existsSync(path)
91
+ )
92
+
93
+ if (!found) {
94
+ throw new Error(`Aucun wrangler.jsonc dans ${dir}.`)
95
+ }
96
+
97
+ return found
98
+ }
99
+
100
+ export function readWranglerConfig(dir: string): WranglerConfig {
101
+ return parseJsonc<WranglerConfig>(
102
+ readFileSync(wranglerConfigPath(dir), "utf8")
103
+ )
104
+ }
105
+
106
+ export function levelsOf(config: WranglerConfig): LevelRef[] {
107
+ return [
108
+ { key: null, label: "niveau haut", level: config },
109
+ ...Object.entries(config.env ?? {}).map(([key, level]) => ({
110
+ key,
111
+ label: `env.${key}`,
112
+ level,
113
+ })),
114
+ ]
115
+ }
116
+
117
+ function named<T extends Binding>(
118
+ kind: BindingKind,
119
+ entries: T[] | undefined
120
+ ): BindingEntry[] {
121
+ return (entries ?? [])
122
+ .filter((entry) => typeof entry.binding === "string")
123
+ .map((entry) => ({ kind, name: entry.binding as string }))
124
+ }
125
+
126
+ function single(kind: BindingKind, entry: Binding | undefined): BindingEntry[] {
127
+ return entry?.binding ? [{ kind, name: entry.binding }] : []
128
+ }
129
+
130
+ function byName(
131
+ kind: BindingKind,
132
+ entries: { name?: string }[] | undefined
133
+ ): BindingEntry[] {
134
+ return (entries ?? [])
135
+ .filter((entry) => typeof entry.name === "string")
136
+ .map((entry) => ({ kind, name: entry.name as string }))
137
+ }
138
+
139
+ export function bindingsOf(level: WranglerLevel): BindingEntry[] {
140
+ const unsafe = level.unsafe?.bindings ?? []
141
+
142
+ return [
143
+ ...named("d1", level.d1_databases),
144
+ ...named("r2", level.r2_buckets),
145
+ ...named("kv", level.kv_namespaces),
146
+ ...named("queue", level.queues?.producers),
147
+ ...named("workflow", level.workflows),
148
+ ...named("service", level.services),
149
+ ...byName("ratelimit", level.ratelimits),
150
+ ...byName(
151
+ "ratelimit",
152
+ unsafe.filter((entry) => entry.type === "ratelimit")
153
+ ),
154
+ ...byName(
155
+ "unsafe",
156
+ unsafe.filter((entry) => entry.type !== "ratelimit")
157
+ ),
158
+ ...byName("durable_object", level.durable_objects?.bindings),
159
+ ...byName("send_email", level.send_email),
160
+ ...single("ai", level.ai),
161
+ ...single("assets", level.assets),
162
+ ...single("browser", level.browser),
163
+ ...single("images", level.images),
164
+ ...single("version_metadata", level.version_metadata),
165
+ ...named("hyperdrive", level.hyperdrive),
166
+ ...named("vectorize", level.vectorize),
167
+ ...named("analytics_engine", level.analytics_engine_datasets),
168
+ ...named("dispatch_namespace", level.dispatch_namespaces),
169
+ ...named("mtls_certificate", level.mtls_certificates),
170
+ ...named("secrets_store", level.secrets_store_secrets),
171
+ ]
172
+ }
173
+
174
+ export interface Deployment {
175
+ environment: string
176
+ level: WranglerLevel
177
+ name: string
178
+ usesEnv: boolean
179
+ }
180
+
181
+ export function deploymentOf(
182
+ config: WranglerConfig,
183
+ environment: string,
184
+ label = "wrangler.jsonc"
185
+ ): Deployment {
186
+ const level = config.env?.[environment]
187
+
188
+ if (level) {
189
+ if (!level.name) {
190
+ throw new Error(`${label} : env.${environment} ne déclare pas de name.`)
191
+ }
192
+
193
+ return { environment, level, name: level.name, usesEnv: true }
194
+ }
195
+
196
+ if (!config.env && environment === "production" && config.name) {
197
+ return { environment, level: config, name: config.name, usesEnv: false }
198
+ }
199
+
200
+ const known = Object.keys(config.env ?? {})
201
+
202
+ throw new Error(
203
+ `${label} : pas d'environnement « ${environment} »${known.length > 0 ? ` (environnements : ${known.join(", ")})` : ""}.`
204
+ )
205
+ }
206
+
207
+ const PLACEHOLDER_ID_RE = /^[0-]+$/
208
+
209
+ export function isPlaceholderId(id: string | undefined): boolean {
210
+ return PLACEHOLDER_ID_RE.test(id ?? "")
211
+ }
212
+
213
+ export function placeholderIds(level: WranglerLevel): string[] {
214
+ const d1 = (level.d1_databases ?? [])
215
+ .filter((database) => isPlaceholderId(database.database_id))
216
+ .map(
217
+ (database) => `D1 ${database.database_name ?? database.binding ?? "?"}`
218
+ )
219
+ const kv = (level.kv_namespaces ?? [])
220
+ .filter((namespace) => isPlaceholderId(namespace.id))
221
+ .map((namespace) => `KV ${namespace.binding ?? "?"}`)
222
+ const hyperdrive = (level.hyperdrive ?? [])
223
+ .filter((entry) => isPlaceholderId(entry.id))
224
+ .map((entry) => `Hyperdrive ${entry.binding ?? "?"}`)
225
+
226
+ return [...d1, ...kv, ...hyperdrive]
227
+ }
228
+
229
+ export function requiredSecrets(level: WranglerLevel): string[] {
230
+ return level.secrets?.required ?? []
231
+ }
@@ -0,0 +1,93 @@
1
+ # `rc.config.json`
2
+
3
+ Un fichier à la racine de chaque projet, lu par la CLI `rc` (depuis n'importe quel sous-dossier : `rc` remonte jusqu'à lui). Il ne contient que des noms et des identifiants, jamais une valeur secrète.
4
+
5
+ ```jsonc
6
+ {
7
+ "$schema": "./node_modules/@react-consulting/rc-kit/schema/rc.config.schema.json",
8
+ "project": "contoso-immo",
9
+ "kit": ">=0.13.0",
10
+ "prefix": "ctm",
11
+ "account": "contoso",
12
+ "apps": {
13
+ "admin": { "path": "apps/admin" },
14
+ "web": { "path": "apps/web", "dependsOn": ["admin"] }
15
+ },
16
+ "infisical": {
17
+ "projectId": "11111111-1111-4111-8111-111111111111",
18
+ "environments": {
19
+ "dev": "dev",
20
+ "production": "prod"
21
+ }
22
+ },
23
+ "sentry": {
24
+ "org": "contoso",
25
+ "projects": { "admin": "ctm-admin", "web": "ctm-web" }
26
+ },
27
+ "devEnvFiles": [
28
+ { "path": "apps/admin/.dev.vars" },
29
+ { "path": "apps/web/.env", "include": ["PUBLIC_*"] }
30
+ ],
31
+ "naming": {
32
+ "legacy": []
33
+ }
34
+ }
35
+ ```
36
+
37
+ | Clé | Rôle |
38
+ |---|---|
39
+ | `project` | slug du projet |
40
+ | `kit` | version de `@react-consulting/rc-kit` attendue, en plage semver (`>=0.13.0`) ; `rc` refuse de tourner avec un kit installé plus ancien et demande de mettre `@react-consulting/rc-kit` à jour |
41
+ | `prefix` | préfixe Cloudflare de 3 lettres, unique sur tous les comptes |
42
+ | `account` | clé de l'entité propriétaire (minuscules et tirets), la même dans tous les projets de l'entité ; `rc check:naming` vérifie que chaque `wrangler.jsonc` déclare un `account_id` valide, le même pour tous les Workers du projet |
43
+ | `apps.<nom>.path` | dossier du Worker (contient `wrangler.jsonc`) ; le rôle du Worker est le nom de la clé (`admin`, `web`, `api`…) |
44
+ | `apps.<nom>.dependsOn` | Workers à déployer avant celui-ci (binding de service) ; `rc deploy all` respecte cet ordre |
45
+ | `infisical.projectId` | identifiant (UUID) du projet Infisical qui porte les secrets ; obligatoire, non secret. `rc secrets:pull` et `rc secrets:push` le lisent |
46
+ | `infisical.environments` | slug de l'environnement Infisical par clé d'environnement rc. Par défaut : `dev` → `dev`, `production` → `prod`, toute autre clé → la même clé. Un client d'un produit mono-tenant (`"acme"`) pointe vers `"<projet>-acme"` |
47
+ | `sentry.org` | slug de l'organisation Sentry de l'entité ; lu par `rc sentry:sourcemaps` |
48
+ | `sentry.url` | région Sentry, `https://de.sentry.io/` par défaut |
49
+ | `sentry.projects.<app>` | slug du projet Sentry de chaque app (clé de `apps`), cible de ses source maps |
50
+ | `devEnvFiles[]` | fichiers écrits par `rc secrets:pull` depuis l'environnement `dev` ; `include` filtre les clés par motif glob |
51
+ | `apps.<nom>.optionalSecrets[]` | secrets facultatifs que `rc secrets:push` envoie à ce Worker quand Infisical leur donne une valeur (en plus de `secrets.required`) |
52
+ | `apps.<nom>.localOnlyBindings[]` | bindings du niveau local qu'aucun déploiement ne déclare (base d'un site de démonstration) : `rc check:deploy-config` ne les exige pas dans `env.<nom>` et refuse qu'un déploiement les déclare |
53
+ | `devEnvFiles[].exclude` | motifs glob des clés à ne pas écrire dans ce fichier |
54
+ | `devEnvFiles[].generate` | clés générées sur le poste si elles n'ont pas de valeur (`BETTER_AUTH_SECRET`) |
55
+ | `naming.legacy[]` | noms de ressources existants hors convention, tolérés par `rc check:naming` |
56
+ | `naming.externalWorkers[]` | Workers d'un autre projet qu'un binding de service peut viser (l'admin d'un produit mono-tenant, pour le site d'un de ses clients) |
57
+ | `naming.clients` | préfixe de chaque environnement client d'un produit mono-tenant (`{ "<clé env>": "<pfx>" }`) |
58
+
59
+ | `database.provider` | `neon` (Postgres) ou `d1` (Cloudflare D1) ; active `rc db:*` et la préparation de la base par `rc dev` |
60
+ | `database.envFile` | fichier env local où `rc db:env` écrit les chaînes de connexion de dev, `.env.local` par défaut |
61
+ | `database.migrate` | `{ command, cwd }` qui applique les migrations ; défaut `neon` : `bun x prisma migrate deploy` dans `packages/db`, défaut `d1` : `wrangler d1 migrations apply <binding> --local` (ou `--remote --env production`) dans le dossier de `d1.app` |
62
+ | `database.seed` | `{ command, cwd }` du seed, lancé par `rc db:seed` avec `DATABASE_URL`, `APP_ENV` et `RC_DATABASE_TARGET` (`local` ou `production`) |
63
+ | `database.neon.production.projectId` | identifiant du projet Neon de production (non secret), seule source de la chaîne `--production` |
64
+ | `database.neon.production.projectName` | nom du projet Neon de production, à taper pour confirmer une commande `--production` |
65
+ | `database.neon.production.endpointId` | compute de la branche `main` de production (`ep-…`) : `--production` refuse tout autre compute et le garde local refuse une `DATABASE_URL` qui le vise |
66
+ | `database.neon.devProjectName` | projet Neon de dev, `<production.projectName>-dev` par défaut |
67
+ | `database.neon.featureBranchTtlDays` | durée de vie d'une branche `feature/*`, 14 jours par défaut |
68
+ | `database.d1.app`, `database.d1.binding` | app qui déclare la base D1 et nom de son binding (`DB`) |
69
+
70
+ Surcharges par poste : `INFISICAL_PROJECT_ID` (projet Infisical), `INFISICAL_ENV_<ENV>` (environnement Infisical, par exemple `INFISICAL_ENV_PRODUCTION=prod-perso`).
71
+
72
+ ## Bases de données
73
+
74
+ Un projet a toujours deux bases séparées :
75
+
76
+ - **Production** : un projet Neon à la seule branche `main` (ou la base D1 de l'environnement `production`).
77
+ - **Dev** : un autre projet Neon, `<production>-dev`. Sa branche `main` porte le schéma et le seed de base et reste réservée à une future préproduction ; personne ne la vise depuis un poste. La branche `development`, enfant de `main`, sert au poste sur la branche git `main` ; toute autre branche git obtient `feature/<branche>`, enfant de `development`, qui expire au bout de `featureBranchTtlDays` jours.
78
+
79
+ `rc dev` prépare la base avant les services (`rc db:env` puis `rc db:migrate`). Les commandes de production (`rc db:migrate --production`, `rc db:seed --production`) exigent un terminal, font taper le nom du projet de production et lisent la chaîne par `neonctl` sur `database.neon.production`, jamais depuis le fichier env : aucune chaîne de production n'est stockée sur le poste. Les données de référence (boîtes mail, rôles…) ne passent jamais par ce seed : elles sont insérées par une migration SQL jouée au déploiement (règle « Données de référence » de `rules/stack.md`).
80
+
81
+ ```jsonc
82
+ "database": {
83
+ "provider": "neon",
84
+ "seed": { "command": ["bun", "prisma/seed.ts"], "cwd": "apps/api" },
85
+ "neon": {
86
+ "production": {
87
+ "projectId": "little-river-19152729",
88
+ "projectName": "contoso-immo",
89
+ "endpointId": "ep-late-art-ba06tlzi"
90
+ }
91
+ }
92
+ }
93
+ ```
package/package.json CHANGED
@@ -1,6 +1,88 @@
1
1
  {
2
2
  "name": "@react-consulting/rc-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.13.1",
4
+ "description": "Règles, composants, CLI rc et modèle de départ pour des projets Cloudflare Workers en Bun",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/React-Consulting-SARL-AU/rc-kit.git"
9
+ },
10
+ "bin": {
11
+ "rc": "devkit/cli.ts"
12
+ },
13
+ "files": [
14
+ "devkit",
15
+ "docs",
16
+ "presets",
17
+ "registry/public/r",
18
+ "registry/serve.ts",
19
+ "rules",
20
+ "runtime",
21
+ "schema",
22
+ "template",
23
+ "LICENSE",
24
+ "README.md",
25
+ "!**/node_modules",
26
+ "!**/.turbo",
27
+ "!**/.wrangler",
28
+ "!**/.astro",
29
+ "!**/dist",
30
+ "!**/.output",
31
+ "!**/.tanstack",
32
+ "!**/.dev.vars",
33
+ "!**/.env",
34
+ "!**/.infisical-token",
35
+ "!template/packages/db/src/generated"
36
+ ],
37
+ "type": "module",
38
+ "exports": {
39
+ "./vite-plus": {
40
+ "types": "./presets/vite-plus.d.ts",
41
+ "default": "./presets/vite-plus.js"
42
+ },
43
+ "./build": {
44
+ "types": "./presets/build.d.ts",
45
+ "default": "./presets/build.js"
46
+ },
47
+ "./naming": "./devkit/lib/naming.ts",
48
+ "./dev-gateway": "./devkit/lib/dev-gateway.ts",
49
+ "./ai": "./runtime/ai.ts",
50
+ "./observability/anonymize": "./runtime/observability/anonymize.ts",
51
+ "./observability/browser": "./runtime/observability/browser.ts",
52
+ "./observability/server": "./runtime/observability/server.ts",
53
+ "./observability/tunnel": "./runtime/observability/tunnel.ts",
54
+ "./rc.config.schema.json": "./schema/rc.config.schema.json",
55
+ "./package.json": "./package.json"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public"
59
+ },
60
+ "scripts": {
61
+ "lint": "vp lint && vp fmt --check",
62
+ "lint:fix": "vp lint --fix && vp fmt",
63
+ "format": "vp fmt",
64
+ "check:types": "tsgo --noEmit --pretty false",
65
+ "test": "bun test devkit runtime",
66
+ "release": "semantic-release",
67
+ "prepare": "vp config"
68
+ },
69
+ "devDependencies": {
70
+ "@semantic-release/changelog": "7.0.0",
71
+ "@semantic-release/commit-analyzer": "14.0.0-beta.5",
72
+ "@semantic-release/git": "11.0.1",
73
+ "@semantic-release/github": "^12.0.11",
74
+ "@semantic-release/npm": "^13.2.0",
75
+ "@semantic-release/release-notes-generator": "15.0.0-beta.4",
76
+ "@types/bun": "^1.4.4",
77
+ "@types/node": "^26.6.6",
78
+ "@typescript/native-preview": "^7.0.0-dev.20260707.2",
79
+ "semantic-release": "26.0.1",
80
+ "typescript": "^6.0.3",
81
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.5.1",
82
+ "vite-plus": "1.5.1"
83
+ },
84
+ "overrides": {
85
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.5.1"
86
+ },
87
+ "packageManager": "bun@1.4.4"
88
+ }
@@ -0,0 +1,15 @@
1
+ export declare function resolveBuildCommitSha(
2
+ cwd?: string,
3
+ env?: Record<string, string | undefined>
4
+ ): string | null
5
+
6
+ export declare function readDeployedPublicEnv(
7
+ appDir: string,
8
+ prefix: string,
9
+ environment?: string
10
+ ): Record<string, string>
11
+
12
+ export declare function publicEnvDefines(
13
+ env: Record<string, string>,
14
+ target?: string
15
+ ): Record<string, string>