@coffre/ui 0.1.13 → 0.1.14

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 (96) hide show
  1. package/dist/client/_coffre/assets/{account-DHSs5h2f.js → account-DGGcVkqt.js} +1 -1
  2. package/dist/client/_coffre/assets/{account-CyJDFhek.js → account-DqjL4kP9.js} +2 -2
  3. package/dist/client/_coffre/assets/{affordances-BQD5B421.js → affordances-B9nFwqIv.js} +1 -1
  4. package/dist/client/_coffre/assets/{audit-rMy9mU9Q.js → audit-CcQmaSan.js} +1 -1
  5. package/dist/client/_coffre/assets/audit-XwuBA4r9.js +2 -0
  6. package/dist/client/_coffre/assets/{auth.device-DuvaComb.js → auth.device-CFCn1DXA.js} +1 -1
  7. package/dist/client/_coffre/assets/{auth.device-yBt_sLZW.js → auth.device-CHHcm089.js} +2 -2
  8. package/dist/client/_coffre/assets/{directory-C4BMGC7-.js → directory-skRBmF1Y.js} +1 -1
  9. package/dist/client/_coffre/assets/{dist-BNkBTkxj.js → dist-BHhATf1q.js} +1 -1
  10. package/dist/client/_coffre/assets/globals-DCrHjrpD.css +1 -0
  11. package/dist/client/_coffre/assets/{grants-CyDW25eX.js → grants-BEmVXYg5.js} +1 -1
  12. package/dist/client/_coffre/assets/{icons-BRl8DlXW.js → icons-BFziRUf9.js} +1 -1
  13. package/dist/client/_coffre/assets/index-Bo6udWLL.js +12 -0
  14. package/dist/client/_coffre/assets/{link-CqlAJWBd.js → link-Bg_PHv45.js} +1 -1
  15. package/dist/client/_coffre/assets/{login-B73b6bsJ.js → login-GV0ZjCQy.js} +1 -1
  16. package/dist/client/_coffre/assets/login-pzHGDqU5.js +2 -0
  17. package/dist/client/_coffre/assets/{offboarding--5vSKNHv.js → offboarding-CXV0KyMt.js} +1 -1
  18. package/dist/client/_coffre/assets/{page-Dngv8FMr.js → page-CDuo3uft.js} +1 -1
  19. package/dist/client/_coffre/assets/{preload-helper-DBha3tys.js → preload-helper-CYFH1xAV.js} +1 -1
  20. package/dist/client/_coffre/assets/{principal-page-C4qDD-d8.js → principal-page-BmgkTnAl.js} +1 -1
  21. package/dist/client/_coffre/assets/projects._project._environment-5PA9NHET.js +2 -0
  22. package/dist/client/_coffre/assets/{projects._project._environment-or_AX6o5.js → projects._project._environment-B-5I0ZFP.js} +1 -1
  23. package/dist/client/_coffre/assets/projects._project.index-BzJQojbd.js +2 -0
  24. package/dist/client/_coffre/assets/{projects._project.index-iynQgenH.js → projects._project.index-wjtfc8E6.js} +1 -1
  25. package/dist/client/_coffre/assets/{projects.index-CGW8mRil.js → projects.index-dl7dfnGW.js} +1 -1
  26. package/dist/client/_coffre/assets/{row-state-BlarvG7E.js → row-state-BzGdu73b.js} +1 -1
  27. package/dist/client/_coffre/assets/{settings-D-7RJIDf.js → settings-DnENNWn8.js} +1 -1
  28. package/dist/client/_coffre/assets/{suspense-q_eJaZ18.js → suspense-Cnh1cNc1.js} +1 -1
  29. package/dist/client/_coffre/assets/{tokens._token-C53NqScg.js → tokens._token-BJiMX2TJ.js} +1 -1
  30. package/dist/client/_coffre/assets/tokens._token-C2s6HHWK.js +2 -0
  31. package/dist/client/_coffre/assets/{tokens.index-DBZTLnbi.js → tokens.index-D4HYaFJl.js} +1 -1
  32. package/dist/client/_coffre/assets/{ui-BPWFJNz7.js → ui-Ch0beQy-.js} +1 -1
  33. package/dist/client/_coffre/assets/{unregistered-CLhgtwUt.js → unregistered-wV1yqr9t.js} +1 -1
  34. package/dist/client/_coffre/assets/{use-action-LULgF26O.js → use-action-cgaBRBBH.js} +1 -1
  35. package/dist/client/_coffre/assets/{use-change-Bd6NZJj9.js → use-change-DIpkq9iI.js} +1 -1
  36. package/dist/client/_coffre/assets/{use-shell-Dx92Huhb.js → use-shell-BJwawvkh.js} +1 -1
  37. package/dist/client/_coffre/assets/useQuery-BHCBwHtH.js +1 -0
  38. package/dist/client/_coffre/assets/{useSuspenseQuery-tP9HFZ8w.js → useSuspenseQuery-BfnNEmf7.js} +1 -1
  39. package/dist/client/_coffre/assets/users._user--OY2srG0.js +1 -0
  40. package/dist/client/_coffre/assets/users._user-Cj4NY0p5.js +2 -0
  41. package/dist/client/_coffre/assets/{users.index-Cs9tibIv.js → users.index-C7_aZ0jb.js} +1 -1
  42. package/dist/server/.vite/manifest.json +155 -155
  43. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-C-_y9u60.js +162 -0
  44. package/dist/server/_coffre/assets/{account-BUhhOS5-.js → account-BJtaf5d7.js} +5 -5
  45. package/dist/server/_coffre/assets/{account-B_h55GCs.js → account-CL3AX6kY.js} +2 -2
  46. package/dist/server/_coffre/assets/{audit-B8Ck358-.js → audit-BtjuffEH.js} +4 -4
  47. package/dist/server/_coffre/assets/{audit-DFsXfeAQ.js → audit-DiHTzVVe.js} +2 -2
  48. package/dist/server/_coffre/assets/{auth.device-cqjWACvB.js → auth.device-8RMD0nyz.js} +2 -2
  49. package/dist/server/_coffre/assets/{auth.device-BXf_JjT7.js → auth.device-dUMx6Srl.js} +2 -2
  50. package/dist/server/_coffre/assets/{directory-C9SfNgpM.js → directory-9Jc5MEra.js} +2 -2
  51. package/dist/server/_coffre/assets/globals-DCrHjrpD.css +1 -0
  52. package/dist/server/_coffre/assets/{grants--315KmXu.js → grants-D5-q8fXB.js} +2 -2
  53. package/dist/server/_coffre/assets/{login-LBpXXfsQ.js → login-C80ImEsO.js} +1 -1
  54. package/dist/server/_coffre/assets/{login-CQSkYW_D.js → login-DmpfrcPB.js} +3 -3
  55. package/dist/server/_coffre/assets/{offboarding-CykelNis.js → offboarding-CXIgvZbO.js} +2 -2
  56. package/dist/server/_coffre/assets/{page-BGeDoQO5.js → page-x4nICC9d.js} +2 -0
  57. package/dist/server/_coffre/assets/{principal-page-CRdoAQOq.js → principal-page-BO6Ijpqv.js} +8 -8
  58. package/dist/server/_coffre/assets/{projects._project._environment-BrDqn8kW.js → projects._project._environment-BMqZsCfi.js} +6 -6
  59. package/dist/server/_coffre/assets/{projects._project._environment-BXU1Mee5.js → projects._project._environment-BeXpetmJ.js} +2 -2
  60. package/dist/server/_coffre/assets/{projects._project.index-CAxBU4tY.js → projects._project.index-B74-XdI3.js} +9 -9
  61. package/dist/server/_coffre/assets/{projects._project.index-CYyUVTCl.js → projects._project.index-DZ1KZvHR.js} +2 -2
  62. package/dist/server/_coffre/assets/{projects.index-D6ZoDE_0.js → projects.index-D7F7hiVe.js} +4 -4
  63. package/dist/server/_coffre/assets/{router-Bu2qtyqw.js → router-fxr2e6Ht.js} +70 -22
  64. package/dist/server/_coffre/assets/{settings-ByeF6hBa.js → settings-DO8wvTmo.js} +3 -3
  65. package/dist/server/_coffre/assets/{suspense-beD01bb8.js → suspense-WsBv84ga.js} +1 -1
  66. package/dist/server/_coffre/assets/{tokens._token-D2E4P3Qc.js → tokens._token-CVWTFOM-.js} +7 -7
  67. package/dist/server/_coffre/assets/{tokens._token-CM01QPCq.js → tokens._token-DhcJxsf3.js} +2 -2
  68. package/dist/server/_coffre/assets/{tokens.index-Cmrgn3mU.js → tokens.index-hvPM5IjY.js} +5 -5
  69. package/dist/server/_coffre/assets/{unregistered-DSArejP9.js → unregistered-DKdzrjVr.js} +2 -2
  70. package/dist/server/_coffre/assets/{use-action-C2wz34kq.js → use-action-D6KlY-sv.js} +2 -2
  71. package/dist/server/_coffre/assets/{use-change-CJpGSNIq.js → use-change-CAcOZo-a.js} +2 -2
  72. package/dist/server/_coffre/assets/{use-shell-C3iYcyP1.js → use-shell-C-yuQ1hA.js} +2 -2
  73. package/dist/server/_coffre/assets/{useQuery-ChxaQ4Cb.js → useQuery-MqmaAeUF.js} +2 -2
  74. package/dist/server/_coffre/assets/{useSuspenseQuery-BjAmlGZl.js → useSuspenseQuery-BDvlOPB7.js} +2 -2
  75. package/dist/server/_coffre/assets/{users._user-BVeR9fZP.js → users._user-dCIYuxyZ.js} +2 -2
  76. package/dist/server/_coffre/assets/{users._user-Cih2Etf4.js → users._user-pLdzKe1F.js} +2 -2
  77. package/dist/server/_coffre/assets/{users.index-Bo2_a95G.js → users.index-CDCDlQxN.js} +5 -5
  78. package/dist/server/index.js +2 -2
  79. package/package.json +3 -3
  80. package/src/components/shell.tsx +26 -2
  81. package/src/lib/instance.ts +13 -0
  82. package/src/lib/queries.ts +2 -0
  83. package/src/routes/__root.tsx +2 -1
  84. package/src/styles/globals.css +5 -0
  85. package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +0 -2
  86. package/dist/client/_coffre/assets/globals-BJkzu6T5.css +0 -1
  87. package/dist/client/_coffre/assets/index-CA1mtrIx.js +0 -12
  88. package/dist/client/_coffre/assets/login-BO1KAGPU.js +0 -2
  89. package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +0 -2
  90. package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +0 -2
  91. package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +0 -2
  92. package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +0 -1
  93. package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +0 -2
  94. package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +0 -1
  95. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +0 -162
  96. package/dist/server/_coffre/assets/globals-BJkzu6T5.css +0 -1
@@ -4,23 +4,23 @@ import { C as createNonReactiveReadonlyStore, S as createNonReactiveMutableStore
4
4
  import { a as redirect, r as isRedirect } from "./matchContext-qLfYbC6_.js";
5
5
  import { t as Link } from "./link-42ZWdjzZ.js";
6
6
  import { a as useStructuralSharing, i as useNavigate, n as createFileRoute, r as createRootRouteWithContext, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
7
- import { H as createClient, N as noop, a as Tile, f as loadShell, h as queries, l as loadDirectory, n as ClosedDoor, s as createQueryClient } from "./page-BGeDoQO5.js";
8
- import { d as QueryClientProvider } from "./suspense-beD01bb8.js";
9
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
7
+ import { H as createClient, N as noop, a as Tile, f as loadShell, h as queries, l as loadDirectory, n as ClosedDoor, s as createQueryClient } from "./page-x4nICC9d.js";
8
+ import { d as QueryClientProvider } from "./suspense-WsBv84ga.js";
9
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
10
10
  import { t as Toaster } from "./dist-CnnV3t2g.js";
11
- import { S as composeRefs, _ as DialogContent, b as useId, f as TooltipProvider, g as Dialog, h as dropdown_menu_exports, m as dialog_exports, u as Tip, v as DialogOverlay, x as Primitive, y as DialogPortal } from "./ui-DvlGkmaH.js";
11
+ import { S as composeRefs, _ as DialogContent, b as useId, f as TooltipProvider, g as Dialog, h as dropdown_menu_exports, m as dialog_exports, s as Notice, u as Tip, v as DialogOverlay, x as Primitive, y as DialogPortal } from "./ui-DvlGkmaH.js";
12
12
  import { n as isActiveAccessibleEnvironment } from "./project-environments-lEzFHUt4.js";
13
13
  import { a as hasAdministrationItems, t as AdministrationItems } from "./affordances-CKANXDTG.js";
14
14
  import { C as Mark, E as Moon, G as markSvg, H as UserCog, I as SignOut, L as SlashCircle, N as Search, O as PanelLeft, P as Settings, R as Sun, T as Monitor, U as Users, W as X$1, a as Check, b as Ledger, c as ChevronsUpDown, m as GitHub, p as Folder, r as AlertTriangle, v as Key, w as Menu, y as Layers } from "./icons-CWsTEfpn.js";
15
- import { a as setTheme, i as ThemeToggle, o as themeBootScript, r as ThemeMenuItems, t as Route$8 } from "./account-B_h55GCs.js";
15
+ import { a as setTheme, i as ThemeToggle, o as themeBootScript, r as ThemeMenuItems, t as Route$8 } from "./account-CL3AX6kY.js";
16
16
  import { n as LiveRegion } from "./row-state-CAItu3n_.js";
17
- import { t as Route$9 } from "./audit-DFsXfeAQ.js";
18
- import { t as Route$10 } from "./login-LBpXXfsQ.js";
19
- import { t as Route$11 } from "./auth.device-BXf_JjT7.js";
20
- import { t as Route$12 } from "./tokens._token-CM01QPCq.js";
21
- import { t as Route$13 } from "./users._user-BVeR9fZP.js";
22
- import { t as Route$14 } from "./projects._project.index-CYyUVTCl.js";
23
- import { t as Route$15 } from "./projects._project._environment-BXU1Mee5.js";
17
+ import { t as Route$9 } from "./audit-DiHTzVVe.js";
18
+ import { t as Route$10 } from "./login-C80ImEsO.js";
19
+ import { t as Route$11 } from "./auth.device-dUMx6Srl.js";
20
+ import { t as Route$12 } from "./tokens._token-DhcJxsf3.js";
21
+ import { t as Route$13 } from "./users._user-dCIYuxyZ.js";
22
+ import { t as Route$14 } from "./projects._project.index-DZ1KZvHR.js";
23
+ import { t as Route$15 } from "./projects._project._environment-BeXpetmJ.js";
24
24
  //#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.18_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/@tanstack/react-router/dist/esm/routerStores.js
25
25
  var getStoreFactory = (opts) => {
26
26
  return {
@@ -647,7 +647,19 @@ function setupRouterSsrQueryIntegration(opts) {
647
647
  }
648
648
  //#endregion
649
649
  //#region src/styles/globals.css?url
650
- var globals_default = "/_coffre/assets/globals-BJkzu6T5.css";
650
+ var globals_default = "/_coffre/assets/globals-DCrHjrpD.css";
651
+ //#endregion
652
+ //#region src/lib/instance.ts
653
+ /** Where an owner reads how to upgrade: update the CLI, deploy, then migrate. */
654
+ var UPGRADE_DOC = "https://github.com/erwinkn/coffre/blob/main/docs/deploy.md#upgrading";
655
+ /**
656
+ * The migrations this instance's code ships and its database lacks. Only
657
+ * owners and root admins are told an instance's state; for anyone else it
658
+ * is null, and nothing is pending as far as they can tell.
659
+ */
660
+ function pendingMigrations(instance) {
661
+ return instance === null ? [] : instance.migrations.known.slice(instance.migrations.applied);
662
+ }
651
663
  //#endregion
652
664
  //#region ../../node_modules/.pnpm/cmdk@1.1.1_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/cmdk/dist/chunk-NZJY6EH4.mjs
653
665
  var U = 1;
@@ -1414,6 +1426,41 @@ function roleLabel(principal, instanceRole) {
1414
1426
  if (instanceRole === "owner") return "Owner";
1415
1427
  return "Member";
1416
1428
  }
1429
+ /**
1430
+ * Above every page, for owners and root admins, while the database is behind
1431
+ * the code this instance runs: what to run, and where the steps are.
1432
+ */
1433
+ function MigrationBanner({ instance }) {
1434
+ const pending = pendingMigrations(instance);
1435
+ if (pending.length === 0) return null;
1436
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1437
+ className: "migration-banner",
1438
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Notice, {
1439
+ tone: "info",
1440
+ children: [
1441
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "Database migrations pending:" }),
1442
+ " run ",
1443
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: "coffre migrate" }),
1444
+ " to apply",
1445
+ " ",
1446
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
1447
+ className: "mono",
1448
+ children: pending.join(", ")
1449
+ }),
1450
+ ", which coffre ",
1451
+ instance?.version,
1452
+ " ships.",
1453
+ " ",
1454
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
1455
+ href: UPGRADE_DOC,
1456
+ target: "_blank",
1457
+ rel: "noreferrer",
1458
+ children: "How to upgrade"
1459
+ })
1460
+ ]
1461
+ })
1462
+ });
1463
+ }
1417
1464
  /** The product's mark and name, for the pages you see before signing in. */
1418
1465
  function Brand() {
1419
1466
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
@@ -1435,7 +1482,7 @@ function Brand() {
1435
1482
  * navigation lives outside the pages themselves. Everywhere else the page's
1436
1483
  * own title says where you are, so the bar leaves it out rather than repeat it.
1437
1484
  */
1438
- function Shell({ projects, principal, instanceRole, capabilities, children }) {
1485
+ function Shell({ projects, principal, instanceRole, capabilities, instance, children }) {
1439
1486
  const pathname = useRouterState({ select: (state) => state.location.pathname });
1440
1487
  const [drawerOpen, setDrawerOpen] = (0, import_react.useState)(false);
1441
1488
  const [collapsed, toggleSidebar] = useSidebarCollapsed();
@@ -1532,10 +1579,10 @@ function Shell({ projects, principal, instanceRole, capabilities, children }) {
1532
1579
  })]
1533
1580
  })
1534
1581
  ]
1535
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", {
1582
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", {
1536
1583
  className: "content",
1537
1584
  id: "content",
1538
- children
1585
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MigrationBanner, { instance }), children]
1539
1586
  })]
1540
1587
  })]
1541
1588
  });
@@ -1966,7 +2013,7 @@ function Toasts() {
1966
2013
  });
1967
2014
  }
1968
2015
  function RootComponent() {
1969
- const { principal, instanceRole, projects, capabilities } = useShell();
2016
+ const { principal, instanceRole, projects, capabilities, instance } = useShell();
1970
2017
  const pathname = useRouterState({ select: (state) => state.location.pathname });
1971
2018
  if (pathname === "/login" || pathname === "/unregistered" || pathname === "/auth/device") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TooltipProvider, { children: [
1972
2019
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -1995,6 +2042,7 @@ function RootComponent() {
1995
2042
  principal,
1996
2043
  instanceRole,
1997
2044
  capabilities,
2045
+ instance,
1998
2046
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Outlet, {})
1999
2047
  }),
2000
2048
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toasts, {}),
@@ -2026,7 +2074,7 @@ var Route$5 = createFileRoute("/access")({ beforeLoad: () => {
2026
2074
  } });
2027
2075
  //#endregion
2028
2076
  //#region src/routes/settings.tsx
2029
- var $$splitComponentImporter$4 = () => import("./settings-ByeF6hBa.js");
2077
+ var $$splitComponentImporter$4 = () => import("./settings-DO8wvTmo.js");
2030
2078
  /** The instance's settings. Your own are under Account, at the sidebar's foot. */
2031
2079
  var Route$4 = createFileRoute("/settings")({
2032
2080
  loader: ({ context: { client, queryClient } }) => loadDirectory(queryClient, client),
@@ -2034,7 +2082,7 @@ var Route$4 = createFileRoute("/settings")({
2034
2082
  });
2035
2083
  //#endregion
2036
2084
  //#region src/routes/unregistered.tsx
2037
- var $$splitComponentImporter$3 = () => import("./unregistered-DSArejP9.js");
2085
+ var $$splitComponentImporter$3 = () => import("./unregistered-DKdzrjVr.js");
2038
2086
  var Route$3 = createFileRoute("/unregistered")({ component: lazyRouteComponent($$splitComponentImporter$3, "component") });
2039
2087
  /**
2040
2088
  * Cloudflare Access has authenticated this person, but Coffre has not
@@ -2043,7 +2091,7 @@ var Route$3 = createFileRoute("/unregistered")({ component: lazyRouteComponent($
2043
2091
  */
2044
2092
  //#endregion
2045
2093
  //#region src/routes/projects.index.tsx
2046
- var $$splitComponentImporter$2 = () => import("./projects.index-D6ZoDE_0.js");
2094
+ var $$splitComponentImporter$2 = () => import("./projects.index-D7F7hiVe.js");
2047
2095
  var Route$2 = createFileRoute("/projects/")({
2048
2096
  loader: ({ context: { client, queryClient } }) => queryClient.fetchQuery(queries.projects(client)),
2049
2097
  component: lazyRouteComponent($$splitComponentImporter$2, "component")
@@ -2054,14 +2102,14 @@ var Route$2 = createFileRoute("/projects/")({
2054
2102
  */
2055
2103
  //#endregion
2056
2104
  //#region src/routes/tokens.index.tsx
2057
- var $$splitComponentImporter$1 = () => import("./tokens.index-Cmrgn3mU.js");
2105
+ var $$splitComponentImporter$1 = () => import("./tokens.index-hvPM5IjY.js");
2058
2106
  var Route$1 = createFileRoute("/tokens/")({
2059
2107
  loader: ({ context: { client, queryClient } }) => loadDirectory(queryClient, client),
2060
2108
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
2061
2109
  });
2062
2110
  //#endregion
2063
2111
  //#region src/routes/users.index.tsx
2064
- var $$splitComponentImporter = () => import("./users.index-Bo2_a95G.js");
2112
+ var $$splitComponentImporter = () => import("./users.index-CDCDlQxN.js");
2065
2113
  var Route = createFileRoute("/users/")({
2066
2114
  loader: ({ context: { client, queryClient } }) => loadDirectory(queryClient, client),
2067
2115
  component: lazyRouteComponent($$splitComponentImporter, "component")
@@ -1,8 +1,8 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
2
  import { t as Link } from "./link-42ZWdjzZ.js";
3
- import { C as useCoffre, h as queries, i as PageHeader, r as Fact, t as Card } from "./page-BGeDoQO5.js";
4
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
5
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
3
+ import { C as useCoffre, h as queries, i as PageHeader, r as Fact, t as Card } from "./page-x4nICC9d.js";
4
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
5
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
6
6
  //#region src/routes/settings.tsx?tsr-split=component
7
7
  var import_jsx_runtime = require_jsx_runtime();
8
8
  /** The instance's settings. Your own are under Account, at the sidebar's foot. */
@@ -1,5 +1,5 @@
1
1
  import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { A as isServer, B as timeoutManager, D as notifyManager, E as fetchState, I as resolveQueryValue, L as shallowEqualObjects, M as isValidTimeout, N as noop, O as focusManager, P as replaceData, R as shouldThrowError, k as Subscribable, z as timeUntilStale } from "./page-BGeDoQO5.js";
2
+ import { A as isServer, B as timeoutManager, D as notifyManager, E as fetchState, I as resolveQueryValue, L as shallowEqualObjects, M as isValidTimeout, N as noop, O as focusManager, P as replaceData, R as shouldThrowError, k as Subscribable, z as timeUntilStale } from "./page-x4nICC9d.js";
3
3
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.103.1_react@19.2.7/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js
4
4
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
5
5
  var import_jsx_runtime = require_jsx_runtime();
@@ -1,14 +1,14 @@
1
1
  import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, b as memberRef, h as queries, o as affects, t as Card } from "./page-BGeDoQO5.js";
3
- import { n as useChangeStatus, t as useChange, y as revokeCredential } from "./use-change-CJpGSNIq.js";
4
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
5
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
2
+ import { C as useCoffre, b as memberRef, h as queries, o as affects, t as Card } from "./page-x4nICC9d.js";
3
+ import { n as useChangeStatus, t as useChange, y as revokeCredential } from "./use-change-CAcOZo-a.js";
4
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
5
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
6
6
  import { a as ErrorLine, c as Spinner, i as EmptyState, l as Timestamp, o as Modal, r as CopyButton, s as Notice, t as ConfirmButton } from "./ui-DvlGkmaH.js";
7
7
  import { A as Plus, W as X, v as Key } from "./icons-CWsTEfpn.js";
8
8
  import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CAItu3n_.js";
9
- import { t as Route } from "./tokens._token-CM01QPCq.js";
10
- import { t as useAction } from "./use-action-C2wz34kq.js";
11
- import { t as PrincipalPage } from "./principal-page-CRdoAQOq.js";
9
+ import { t as Route } from "./tokens._token-DhcJxsf3.js";
10
+ import { t as useAction } from "./use-action-D6KlY-sv.js";
11
+ import { t as PrincipalPage } from "./principal-page-BO6Ijpqv.js";
12
12
  //#region src/components/service-tokens.tsx
13
13
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
14
14
  var import_jsx_runtime = require_jsx_runtime();
@@ -1,7 +1,7 @@
1
1
  import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
2
- import { u as loadPrincipal } from "./page-BGeDoQO5.js";
2
+ import { u as loadPrincipal } from "./page-x4nICC9d.js";
3
3
  //#region src/routes/tokens.$token.tsx
4
- var $$splitComponentImporter = () => import("./tokens._token-D2E4P3Qc.js");
4
+ var $$splitComponentImporter = () => import("./tokens._token-CVWTFOM-.js");
5
5
  var Route = createFileRoute("/tokens/$token")({
6
6
  loader: ({ context: { client, queryClient }, params }) => loadPrincipal(queryClient, client, "service", params.token),
7
7
  component: lazyRouteComponent($$splitComponentImporter, "component")
@@ -1,10 +1,10 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-BGeDoQO5.js";
3
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
4
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
2
+ import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-x4nICC9d.js";
3
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
5
5
  import { v as Key } from "./icons-CWsTEfpn.js";
6
- import { n as DirectoryTable, t as AddPrincipal } from "./directory-C9SfNgpM.js";
7
- import { n as RemovedList } from "./offboarding-CykelNis.js";
6
+ import { n as DirectoryTable, t as AddPrincipal } from "./directory-9Jc5MEra.js";
7
+ import { n as RemovedList } from "./offboarding-CXIgvZbO.js";
8
8
  //#region src/routes/tokens.index.tsx?tsr-split=component
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  function TokensPage() {
@@ -1,6 +1,6 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { n as ClosedDoor } from "./page-BGeDoQO5.js";
3
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
2
+ import { n as ClosedDoor } from "./page-x4nICC9d.js";
3
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
4
  import { V as User } from "./icons-CWsTEfpn.js";
5
5
  //#region src/routes/unregistered.tsx?tsr-split=component
6
6
  var import_jsx_runtime = require_jsx_runtime();
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { g as refresh, y as failureMessage } from "./page-BGeDoQO5.js";
3
- import { f as useQueryClient } from "./suspense-beD01bb8.js";
2
+ import { g as refresh, y as failureMessage } from "./page-x4nICC9d.js";
3
+ import { f as useQueryClient } from "./suspense-WsBv84ga.js";
4
4
  //#region src/lib/use-action.ts
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, R as shouldThrowError, T as getDefaultState, b as memberRef, c as keys, g as refresh, j as hashKey, k as Subscribable, o as affects, v as Refusal, y as failureMessage } from "./page-BGeDoQO5.js";
3
- import { f as useQueryClient } from "./suspense-beD01bb8.js";
2
+ import { D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, R as shouldThrowError, T as getDefaultState, b as memberRef, c as keys, g as refresh, j as hashKey, k as Subscribable, o as affects, v as Refusal, y as failureMessage } from "./page-x4nICC9d.js";
3
+ import { f as useQueryClient } from "./suspense-WsBv84ga.js";
4
4
  import { o as announce } from "./row-state-CAItu3n_.js";
5
5
  //#region ../../node_modules/.pnpm/@tanstack+query-core@5.103.1/node_modules/@tanstack/query-core/build/modern/mutationObserver.js
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, _ as shellOf, h as queries, k as Subscribable } from "./page-BGeDoQO5.js";
3
- import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-beD01bb8.js";
2
+ import { C as useCoffre, D as notifyManager, F as replaceEqualDeep, L as shallowEqualObjects, N as noop, _ as shellOf, h as queries, k as Subscribable } from "./page-x4nICC9d.js";
3
+ import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-WsBv84ga.js";
4
4
  //#region ../../node_modules/.pnpm/@tanstack+query-core@5.103.1/node_modules/@tanstack/query-core/build/modern/queriesObserver.js
5
5
  function difference(array1, array2) {
6
6
  const excludeSet = new Set(array2);
@@ -1,5 +1,5 @@
1
- import { u as QueryObserver } from "./suspense-beD01bb8.js";
2
- import { n as useBaseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
1
+ import { u as QueryObserver } from "./suspense-WsBv84ga.js";
2
+ import { n as useBaseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
3
3
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.103.1_react@19.2.7/node_modules/@tanstack/react-query/build/modern/useQuery.js
4
4
  function useQuery(options, queryClient) {
5
5
  return useBaseQuery(options, QueryObserver, queryClient);
@@ -1,6 +1,6 @@
1
1
  import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
2
- import { D as notifyManager, N as noop } from "./page-BGeDoQO5.js";
3
- import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-beD01bb8.js";
2
+ import { D as notifyManager, N as noop } from "./page-x4nICC9d.js";
3
+ import { a as ensurePreventErrorBoundaryRetry, c as useQueryErrorResetBoundary, f as useQueryClient, i as shouldSuspend, l as useIsRestoring, n as ensureSuspenseTimers, o as getHasError, r as fetchOptimistic, s as useClearResetErrorBoundary, t as defaultThrowOnError, u as QueryObserver } from "./suspense-WsBv84ga.js";
4
4
  //#region ../../node_modules/.pnpm/@tanstack+react-query@5.103.1_react@19.2.7/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
6
  function useBaseQuery(options, Observer, queryClient) {
@@ -1,7 +1,7 @@
1
1
  import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
2
- import { u as loadPrincipal } from "./page-BGeDoQO5.js";
2
+ import { u as loadPrincipal } from "./page-x4nICC9d.js";
3
3
  //#region src/routes/users.$user.tsx
4
- var $$splitComponentImporter = () => import("./users._user-Cih2Etf4.js");
4
+ var $$splitComponentImporter = () => import("./users._user-pLdzKe1F.js");
5
5
  var Route = createFileRoute("/users/$user")({
6
6
  loader: ({ context: { client, queryClient }, params }) => loadPrincipal(queryClient, client, "user", params.user),
7
7
  component: lazyRouteComponent($$splitComponentImporter, "component")
@@ -1,6 +1,6 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { t as Route } from "./users._user-BVeR9fZP.js";
3
- import { t as PrincipalPage } from "./principal-page-CRdoAQOq.js";
2
+ import { t as Route } from "./users._user-dCIYuxyZ.js";
3
+ import { t as PrincipalPage } from "./principal-page-BO6Ijpqv.js";
4
4
  //#region src/routes/users.$user.tsx?tsr-split=component
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
6
  function UserPage() {
@@ -1,10 +1,10 @@
1
1
  import { r as require_jsx_runtime } from "./useRouter-CaUSUNsw.js";
2
- import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-BGeDoQO5.js";
3
- import { t as useShell } from "./use-shell-C3iYcyP1.js";
4
- import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
2
+ import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-x4nICC9d.js";
3
+ import { t as useShell } from "./use-shell-C-yuQ1hA.js";
4
+ import { t as useSuspenseQuery } from "./useSuspenseQuery-BDvlOPB7.js";
5
5
  import { U as Users } from "./icons-CWsTEfpn.js";
6
- import { n as DirectoryTable, t as AddPrincipal } from "./directory-C9SfNgpM.js";
7
- import { n as RemovedList } from "./offboarding-CykelNis.js";
6
+ import { n as DirectoryTable, t as AddPrincipal } from "./directory-9Jc5MEra.js";
7
+ import { n as RemovedList } from "./offboarding-CXIgvZbO.js";
8
8
  //#region src/routes/users.index.tsx?tsr-split=component
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  function UsersPage() {
@@ -12381,7 +12381,7 @@ var HEADERS = { TSS_SHELL: "X-TSS_SHELL" };
12381
12381
  * the dev styles URL for route-scoped CSS collection.
12382
12382
  */
12383
12383
  async function getStartManifest(matchedRoutes) {
12384
- const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js");
12384
+ const { tsrStartManifest } = await import("./_coffre/assets/_tanstack-start-manifest_v-C-_y9u60.js");
12385
12385
  const startManifest = tsrStartManifest();
12386
12386
  let routes = startManifest.routes;
12387
12387
  routes[rootRouteId];
@@ -13508,7 +13508,7 @@ var getBaseManifest = getProdBaseManifest;
13508
13508
  var createEarlyHintsForRequest = createEarlyHintsCollector;
13509
13509
  async function loadEntries() {
13510
13510
  const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
13511
- import("./_coffre/assets/router-Bu2qtyqw.js"),
13511
+ import("./_coffre/assets/router-fxr2e6Ht.js"),
13512
13512
  import("./_coffre/assets/start-DR3rN0St.js"),
13513
13513
  import("./_coffre/assets/empty-plugin-adapters-Cq4--YW-.js")
13514
13514
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/ui",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "coffre's pages: a prebuilt TanStack Start handler and its static files.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@coffre/client": "0.1.13"
31
+ "@coffre/client": "0.1.14"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@cloudflare/vite-plugin": "1.50.0",
@@ -53,7 +53,7 @@
53
53
  "typescript": "5.9.3",
54
54
  "vite": "8.1.5",
55
55
  "wrangler": "4.118.0",
56
- "@coffre/core": "0.1.13"
56
+ "@coffre/core": "0.1.14"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "vite build && rm dist/server/wrangler.json && tsdown && node ../../scripts/check-client-bundle.mjs",
@@ -1,14 +1,16 @@
1
1
  import { useCallback, useEffect, useState, type ReactNode } from 'react';
2
2
  import { Link, useNavigate, useRouterState } from '@tanstack/react-router';
3
3
  import { Dialog, DropdownMenu } from 'radix-ui';
4
+ import type { InstanceState } from '@coffre/client';
4
5
  import type { ProjectSummary } from '../shared/models';
6
+ import { pendingMigrations, UPGRADE_DOC } from '../lib/instance';
5
7
  import type { UiCapabilities } from '../lib/capabilities';
6
8
  import { isActiveAccessibleEnvironment } from '../lib/project-environments';
7
9
  import { AdministrationItems } from './affordances';
8
10
  import { CommandPalette } from './command-palette';
9
11
  import { ThemeMenuItems } from './theme';
10
12
  import { Tile } from './tile';
11
- import { Tip } from './ui';
13
+ import { Notice, Tip } from './ui';
12
14
  import {
13
15
  Check,
14
16
  ChevronsUpDown,
@@ -34,6 +36,7 @@ type ShellProps = {
34
36
  principal: Principal;
35
37
  instanceRole: InstanceRole;
36
38
  capabilities: UiCapabilities;
39
+ instance: InstanceState | null;
37
40
  children: ReactNode;
38
41
  };
39
42
 
@@ -92,6 +95,26 @@ function roleLabel(principal: Principal, instanceRole: InstanceRole): string {
92
95
  return 'Member';
93
96
  }
94
97
 
98
+ /**
99
+ * Above every page, for owners and root admins, while the database is behind
100
+ * the code this instance runs: what to run, and where the steps are.
101
+ */
102
+ function MigrationBanner({ instance }: { instance: InstanceState | null }) {
103
+ const pending = pendingMigrations(instance);
104
+ if (pending.length === 0) return null;
105
+ return (
106
+ <div className="migration-banner">
107
+ <Notice tone="info">
108
+ <strong>Database migrations pending:</strong> run <code>coffre migrate</code> to apply{' '}
109
+ <span className="mono">{pending.join(', ')}</span>, which coffre {instance?.version} ships.{' '}
110
+ <a href={UPGRADE_DOC} target="_blank" rel="noreferrer">
111
+ How to upgrade
112
+ </a>
113
+ </Notice>
114
+ </div>
115
+ );
116
+ }
117
+
95
118
  /** The product's mark and name, for the pages you see before signing in. */
96
119
  export function Brand() {
97
120
  return (
@@ -113,7 +136,7 @@ export function Brand() {
113
136
  * navigation lives outside the pages themselves. Everywhere else the page's
114
137
  * own title says where you are, so the bar leaves it out rather than repeat it.
115
138
  */
116
- export function Shell({ projects, principal, instanceRole, capabilities, children }: ShellProps) {
139
+ export function Shell({ projects, principal, instanceRole, capabilities, instance, children }: ShellProps) {
117
140
  const pathname = useRouterState({ select: (state) => state.location.pathname });
118
141
  const [drawerOpen, setDrawerOpen] = useState(false);
119
142
  const [collapsed, toggleSidebar] = useSidebarCollapsed();
@@ -223,6 +246,7 @@ export function Shell({ projects, principal, instanceRole, capabilities, childre
223
246
  </header>
224
247
 
225
248
  <main className="content" id="content">
249
+ <MigrationBanner instance={instance} />
226
250
  {children}
227
251
  </main>
228
252
  </div>
@@ -0,0 +1,13 @@
1
+ import type { InstanceState } from '@coffre/client';
2
+
3
+ /** Where an owner reads how to upgrade: update the CLI, deploy, then migrate. */
4
+ export const UPGRADE_DOC = 'https://github.com/erwinkn/coffre/blob/main/docs/deploy.md#upgrading';
5
+
6
+ /**
7
+ * The migrations this instance's code ships and its database lacks. Only
8
+ * owners and root admins are told an instance's state; for anyone else it
9
+ * is null, and nothing is pending as far as they can tell.
10
+ */
11
+ export function pendingMigrations(instance: InstanceState | null): string[] {
12
+ return instance === null ? [] : instance.migrations.known.slice(instance.migrations.applied);
13
+ }
@@ -268,6 +268,8 @@ export function shellOf(
268
268
  projects: listed,
269
269
  capabilities: deriveUiCapabilities(member, listed),
270
270
  registrationRequired: me !== null && !me.registered,
271
+ /** The deployment's version and migrations: told to owners and root admins only. */
272
+ instance: member?.instance ?? null,
271
273
  /** A member the vault refuses: their record failed its integrity check. */
272
274
  accessTampered: me?.tampered === true,
273
275
  };
@@ -118,7 +118,7 @@ function Toasts() {
118
118
  }
119
119
 
120
120
  function RootComponent() {
121
- const { principal, instanceRole, projects, capabilities } = useShell();
121
+ const { principal, instanceRole, projects, capabilities, instance } = useShell();
122
122
  const pathname = useRouterState({ select: (state) => state.location.pathname });
123
123
 
124
124
  // Sign-in gets no navigation. Every destination in the sidebar and the
@@ -156,6 +156,7 @@ function RootComponent() {
156
156
  principal={principal}
157
157
  instanceRole={instanceRole}
158
158
  capabilities={capabilities}
159
+ instance={instance}
159
160
  >
160
161
  <Outlet />
161
162
  </Shell>
@@ -439,6 +439,11 @@ kbd {
439
439
  text-decoration: none;
440
440
  }
441
441
 
442
+ /* Above every page while the database is behind the code (owners only). */
443
+ .migration-banner {
444
+ margin-bottom: 1.25rem;
445
+ }
446
+
442
447
  .main {
443
448
  min-width: 0;
444
449
  display: flex;
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/audit-rMy9mU9Q.js","_coffre/assets/page-Dngv8FMr.js","_coffre/assets/link-CqlAJWBd.js","_coffre/assets/useSuspenseQuery-tP9HFZ8w.js","_coffre/assets/suspense-q_eJaZ18.js","_coffre/assets/useQuery-BIIZz1CB.js","_coffre/assets/ui-BPWFJNz7.js","_coffre/assets/icons-BRl8DlXW.js"])))=>i.map(i=>d[i]);
2
- import{h as e}from"./page-Dngv8FMr.js";import{n as t,r as n,t as r}from"./preload-helper-DBha3tys.js";var i=n(`/audit`)({validateSearch:e=>({decision:e.decision===`deny`?`deny`:void 0,actorId:typeof e.actorId==`string`&&e.actorId!==``?e.actorId:void 0,detail:e.detail===`1`||e.detail===1?`1`:void 0}),loaderDeps:({search:e})=>e,loader:({context:{client:t,queryClient:n},deps:r})=>n.fetchQuery(e.auditEntries(t,r)),component:t(()=>r(()=>import(`./audit-rMy9mU9Q.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)});export{i as t};