create-expo-updates-server 0.2.1 → 0.4.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 (103) hide show
  1. package/dist/template/README.md +1 -1
  2. package/dist/template/app/updates/[encodedKey]/page.tsx +55 -33
  3. package/dist/template/app/updates/devices/page.tsx +13 -7
  4. package/dist/template/app/updates/embedded/page.tsx +25 -13
  5. package/dist/template/app/updates/emergency-redirects/page.tsx +70 -38
  6. package/dist/template/app/updates/page.tsx +33 -20
  7. package/dist/template/components/admin/admin-shell.tsx +11 -5
  8. package/dist/template/components/admin/language-switcher.tsx +5 -2
  9. package/dist/template/components/ui/dialog.tsx +13 -4
  10. package/dist/template/components/ui/sheet.tsx +6 -2
  11. package/dist/template/components/ui/sidebar.tsx +62 -17
  12. package/dist/template/docs/admin-ui.md +18 -24
  13. package/dist/template/docs/device-targeting.md +4 -5
  14. package/dist/template/docs/expo-app-setup.md +8 -12
  15. package/dist/template/docs/getting-started.md +5 -5
  16. package/dist/template/docs/getting-started.ru.md +11 -544
  17. package/dist/template/docs/index.md +1 -1
  18. package/dist/template/docs/installation-telemetry.md +4 -4
  19. package/dist/template/docs/operations-guide.md +1 -1
  20. package/dist/template/docs/ota-client-lifecycle.md +46 -42
  21. package/dist/template/docs/ota-emergency-recovery.md +34 -57
  22. package/dist/template/docs/ru/admin-ui.md +29 -0
  23. package/dist/template/docs/ru/device-targeting.md +59 -0
  24. package/dist/template/docs/ru/doctor.md +98 -0
  25. package/dist/template/docs/ru/expo-app-setup.md +497 -0
  26. package/dist/template/docs/ru/getting-started.md +391 -0
  27. package/dist/template/docs/ru/index.md +50 -0
  28. package/dist/template/docs/ru/installation-telemetry.md +125 -0
  29. package/dist/template/docs/ru/npm-installer.md +71 -0
  30. package/dist/template/docs/ru/operations-guide.md +317 -0
  31. package/dist/template/docs/ru/ota-client-lifecycle.md +167 -0
  32. package/dist/template/docs/ru/ota-emergency-recovery.md +108 -0
  33. package/dist/template/docs/ru/ota-update-policy.md +67 -0
  34. package/dist/template/docs/ru/publishing-npm-installer.md +49 -0
  35. package/dist/template/docs/ru/supabase-setup.md +120 -0
  36. package/dist/template/docs/uk/admin-ui.md +29 -0
  37. package/dist/template/docs/uk/device-targeting.md +59 -0
  38. package/dist/template/docs/uk/doctor.md +98 -0
  39. package/dist/template/docs/uk/expo-app-setup.md +497 -0
  40. package/dist/template/docs/uk/getting-started.md +391 -0
  41. package/dist/template/docs/uk/index.md +50 -0
  42. package/dist/template/docs/uk/installation-telemetry.md +125 -0
  43. package/dist/template/docs/uk/npm-installer.md +71 -0
  44. package/dist/template/docs/uk/operations-guide.md +317 -0
  45. package/dist/template/docs/uk/ota-client-lifecycle.md +167 -0
  46. package/dist/template/docs/uk/ota-emergency-recovery.md +108 -0
  47. package/dist/template/docs/uk/ota-update-policy.md +67 -0
  48. package/dist/template/docs/uk/publishing-npm-installer.md +49 -0
  49. package/dist/template/docs/uk/supabase-setup.md +120 -0
  50. package/dist/template/package-lock.json +589 -0
  51. package/dist/template/package.json +2 -0
  52. package/dist/template/scripts/lib/device-identity.test.ts +2 -2
  53. package/dist/template/scripts/lib/doctor.mjs +3 -3
  54. package/dist/template/scripts/lib/doctor.test.mjs +1 -1
  55. package/dist/template/scripts/lib/ota-client-configurator.mjs +116 -34
  56. package/dist/template/scripts/lib/ota-client-configurator.test.ts +210 -61
  57. package/dist/template/scripts/lib/ota-client.test.ts +1 -1
  58. package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +435 -118
  59. package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +243 -86
  60. package/dist/template/scripts/lib/ota-update-controller.test.ts +10 -9
  61. package/dist/template/scripts/lib/ota-updates-ui.test.tsx +154 -0
  62. package/dist/template/scripts/tests/fixtures/react-native-ui.tsx +34 -0
  63. package/dist/template/scripts/tests/ota-client-types.mjs +69 -0
  64. package/dist/template/src/client/devices/analytics.tsx +21 -8
  65. package/dist/template/src/client/devices/device-name.tsx +3 -1
  66. package/dist/template/src/client/devices/registry.tsx +38 -19
  67. package/dist/template/src/client/devices/version-adoption-chart.tsx +22 -10
  68. package/dist/template/src/client/distribution-control.tsx +27 -14
  69. package/dist/template/src/client/guard-action-combobox.test.ts +1 -1
  70. package/dist/template/src/client/guard-action-combobox.tsx +16 -10
  71. package/dist/template/src/client/i18n/en.json +203 -1
  72. package/dist/template/src/client/i18n/language-switching.test.tsx +224 -0
  73. package/dist/template/src/client/i18n/messages.test.ts +102 -19
  74. package/dist/template/src/client/i18n/messages.ts +31 -16
  75. package/dist/template/src/client/i18n/provider.tsx +6 -3
  76. package/dist/template/src/client/i18n/ru.json +488 -0
  77. package/dist/template/src/client/i18n/uk.json +488 -0
  78. package/dist/template/src/client/i18n/use-formatters.ts +5 -0
  79. package/dist/template/src/client/update-audience-editor.tsx +18 -11
  80. package/dist/template/src/client/update-policy-editor.tsx +64 -39
  81. package/dist/template/templates/expo-app/ota-client/README.md +16 -2
  82. package/dist/template/templates/expo-app/ota-client/controller.ts +107 -0
  83. package/dist/template/templates/expo-app/ota-client/device-identity.ts +48 -0
  84. package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +18 -9
  85. package/dist/template/templates/expo-app/ota-client/index.ts +16 -0
  86. package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.ts +97 -0
  87. package/dist/template/templates/expo-app/ota-client/model/update-controller.ts +293 -0
  88. package/dist/template/templates/expo-app/ota-client/runtime.ts +153 -0
  89. package/dist/template/templates/expo-app/ota-client/types.ts +85 -0
  90. package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.tsx +25 -0
  91. package/dist/template/templates/expo-app/ota-client/ui/ota-updates.tsx +196 -0
  92. package/dist/template/tsconfig.json +3 -1
  93. package/dist/template/vitest.config.mts +3 -0
  94. package/dist/template-manifest.json +302 -127
  95. package/package.json +1 -1
  96. package/dist/template/templates/expo-app/ota-client/controller.js +0 -60
  97. package/dist/template/templates/expo-app/ota-client/device-identity.js +0 -26
  98. package/dist/template/templates/expo-app/ota-client/index.d.ts +0 -47
  99. package/dist/template/templates/expo-app/ota-client/index.js +0 -3
  100. package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.js +0 -48
  101. package/dist/template/templates/expo-app/ota-client/model/update-controller.js +0 -182
  102. package/dist/template/templates/expo-app/ota-client/runtime.js +0 -112
  103. package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.js +0 -56
@@ -65,7 +65,9 @@ export default function UpdatesPage() {
65
65
 
66
66
  const hasRollbackActive = items.some((item) => item.isRollbackActive);
67
67
  const hasIgnoredUpdates = items.some((item) => item.isIgnoredByRollback);
68
- const lockedScopes = rollbackScopes.filter((scope) => scope.rollbackActive);
68
+ const lockedScopes = rollbackScopes.filter(
69
+ (scope) => scope.rollbackActive,
70
+ );
69
71
 
70
72
  const loadUpdates = useCallback(async () => {
71
73
  setLoading(true);
@@ -83,7 +85,9 @@ export default function UpdatesPage() {
83
85
  setTotalPages(response.totalPages);
84
86
  setTotal(response.total);
85
87
  } catch (loadError: unknown) {
86
- setError((loadError as Error).message || "Не удалось загрузить список");
88
+ setError(
89
+ (loadError as Error).message || "Не удалось загрузить список",
90
+ );
87
91
  } finally {
88
92
  setLoading(false);
89
93
  }
@@ -97,7 +101,9 @@ export default function UpdatesPage() {
97
101
  <div className="mx-auto max-w-[1600px] space-y-6 p-4 md:p-8">
98
102
  <header className="flex flex-wrap items-start justify-between gap-4">
99
103
  <div className="space-y-1">
100
- <h1 className="text-2xl font-semibold tracking-tight">OTA Updates</h1>
104
+ <h1 className="text-2xl font-semibold tracking-tight">
105
+ {t("OTA Updates")}
106
+ </h1>
101
107
  <p className="text-sm text-muted-foreground">
102
108
  {t("Публикации, версии и управление доставкой обновлений.")}
103
109
  </p>
@@ -138,7 +144,7 @@ export default function UpdatesPage() {
138
144
  )}
139
145
  {lockedScopes.length > 0 && (
140
146
  <p className="text-xs text-muted-foreground">
141
- Rollback lock:{" "}
147
+ {t("Rollback lock:")}{" "}
142
148
  {lockedScopes
143
149
  .map(
144
150
  (scope) =>
@@ -187,7 +193,7 @@ export default function UpdatesPage() {
187
193
  }
188
194
  >
189
195
  <ArrowDownUp />
190
- {order === "asc" ? "ASC" : "DESC"}
196
+ {order === "asc" ? t("Ascending") : t("Descending")}
191
197
  </Button>
192
198
  </div>
193
199
  </div>
@@ -195,12 +201,14 @@ export default function UpdatesPage() {
195
201
  <TableHeader>
196
202
  <TableRow className="bg-muted/40 hover:bg-muted/40">
197
203
  <TableHead className="pl-5">{t("Обновление")}</TableHead>
198
- <TableHead>Runtime / App</TableHead>
204
+ <TableHead>{t("Runtime / App")}</TableHead>
199
205
  <TableHead>{t("Платформа / канал")}</TableHead>
200
206
  <TableHead>{t("Состояние")}</TableHead>
201
207
  <TableHead>{t("Доставка")}</TableHead>
202
- <TableHead>Assets</TableHead>
203
- <TableHead className="pr-5 text-right">{t("Создано")}</TableHead>
208
+ <TableHead>{t("Assets")}</TableHead>
209
+ <TableHead className="pr-5 text-right">
210
+ {t("Создано")}
211
+ </TableHead>
204
212
  </TableRow>
205
213
  </TableHeader>
206
214
  <TableBody>
@@ -221,7 +229,9 @@ export default function UpdatesPage() {
221
229
  <Package className="mx-auto mb-3 size-8 text-muted-foreground/50" />
222
230
  <p className="font-medium">{t("Обновлений пока нет")}</p>
223
231
  <p className="mt-1 text-sm text-muted-foreground">
224
- {t("Опубликуйте OTA, чтобы управлять его доставкой здесь.")}
232
+ {t(
233
+ "Опубликуйте OTA, чтобы управлять его доставкой здесь.",
234
+ )}
225
235
  </p>
226
236
  </TableCell>
227
237
  </TableRow>
@@ -253,7 +263,7 @@ export default function UpdatesPage() {
253
263
  <TableCell>
254
264
  <p className="font-medium">{item.runtimeVersion}</p>
255
265
  <p className="mt-1 text-xs text-muted-foreground">
256
- App {item.appVersion || "—"}
266
+ {t("App")} {item.appVersion || "—"}
257
267
  </p>
258
268
  </TableCell>
259
269
  <TableCell>
@@ -276,9 +286,11 @@ export default function UpdatesPage() {
276
286
  : ""
277
287
  }
278
288
  >
279
- {item.status}
289
+ {t(item.status)}
280
290
  </Badge>
281
- {item.isLatest && <Badge variant="outline">Latest</Badge>}
291
+ {item.isLatest && (
292
+ <Badge variant="outline">{t("Latest")}</Badge>
293
+ )}
282
294
  {item.audienceMode === "devices" && (
283
295
  <Badge variant="outline">
284
296
  {t("Выбранные устройства")}
@@ -293,29 +305,30 @@ export default function UpdatesPage() {
293
305
  <div className="flex flex-wrap gap-1.5">
294
306
  <Badge variant="outline">
295
307
  {item.deliveryMode === "background"
296
- ? "Background"
297
- : "Manual"}
308
+ ? t("Background")
309
+ : t("Manual")}
298
310
  </Badge>
299
311
  {item.hasGuard && (
300
- <Badge variant="secondary">Guard</Badge>
312
+ <Badge variant="secondary">{t("Guard")}</Badge>
301
313
  )}
302
314
  </div>
303
315
  <p
304
316
  className={`mt-1.5 text-xs ${item.isRollbackActive ? "text-amber-600" : "text-muted-foreground"}`}
305
317
  >
306
318
  {item.isRollbackActive
307
- ? "Rollback"
319
+ ? t("Rollback")
308
320
  : item.isIgnoredByRollback
309
- ? "Ignored by rollback"
310
- : "Scope open"}
321
+ ? t("Ignored by rollback")
322
+ : t("Scope open")}
311
323
  </p>
312
324
  </TableCell>
313
325
  <TableCell className="tabular-nums text-muted-foreground">
314
326
  {item.assetsCount}
315
327
  </TableCell>
316
328
  <TableCell className="pr-5 text-right text-xs tabular-nums text-muted-foreground">
317
- {new Date(item.createdAt).toLocaleString(formatLocale) ||
318
- item.createdAtPath}
329
+ {new Date(item.createdAt).toLocaleString(
330
+ formatLocale,
331
+ ) || item.createdAtPath}
319
332
  </TableCell>
320
333
  </TableRow>
321
334
  ))}
@@ -101,7 +101,9 @@ export function AdminShell({
101
101
  }
102
102
  }
103
103
  return (
104
- <SidebarProvider style={{ "--sidebar-width": "14rem" } as CSSProperties}>
104
+ <SidebarProvider
105
+ style={{ "--sidebar-width": "14rem" } as CSSProperties}
106
+ >
105
107
  <a
106
108
  href="#main-content"
107
109
  className="sr-only focus:not-sr-only focus:fixed focus:left-4 focus:top-4 focus:z-50 focus:rounded focus:bg-card focus:p-3"
@@ -120,7 +122,7 @@ export function AdminShell({
120
122
  <span>
121
123
  OTA Console
122
124
  <span className="block text-[10px] font-medium uppercase tracking-[.18em] text-muted-foreground">
123
- Release workspace
125
+ {t("Release workspace")}
124
126
  </span>
125
127
  </span>
126
128
  </Link>
@@ -142,7 +144,9 @@ export function AdminShell({
142
144
  <p className="truncate text-sm font-medium text-foreground">
143
145
  {session.username}
144
146
  </p>
145
- <p className="text-xs text-muted-foreground">{session.role}</p>
147
+ <p className="text-xs text-muted-foreground">
148
+ {t(session.role)}
149
+ </p>
146
150
  </div>
147
151
  </div>
148
152
  {error && (
@@ -164,8 +168,10 @@ export function AdminShell({
164
168
  <SidebarInset className="min-w-0 bg-background">
165
169
  <header className="flex h-16 shrink-0 items-center justify-between gap-4 border-b bg-card/80 px-4 md:px-8">
166
170
  <div className="flex items-center gap-3">
167
- <SidebarTrigger aria-label={t("Открыть или скрыть навигацию")} />
168
- <span className="text-sm text-muted-foreground">
171
+ <SidebarTrigger
172
+ aria-label={t("Открыть или скрыть навигацию")}
173
+ />
174
+ <span className="hidden text-sm text-muted-foreground sm:inline">
169
175
  {t("Управление обновлениями")}
170
176
  </span>
171
177
  </div>
@@ -4,8 +4,8 @@ import { useI18n } from "@/src/client/i18n/provider";
4
4
  import { resolveLocale } from "@/src/client/i18n/messages";
5
5
 
6
6
  export function LanguageSwitcher() {
7
- const { locale, setLocale } = useI18n();
8
- const label = locale === "en" ? "Interface language" : "Язык интерфейса";
7
+ const { locale, setLocale, t } = useI18n();
8
+ const label = t("Interface language");
9
9
  return (
10
10
  <select
11
11
  aria-label={label}
@@ -20,6 +20,9 @@ export function LanguageSwitcher() {
20
20
  <option value="ru" lang="ru">
21
21
  Русский
22
22
  </option>
23
+ <option value="uk" lang="uk">
24
+ Українська
25
+ </option>
23
26
  </select>
24
27
  );
25
28
  }
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { useI18n } from "@/src/client/i18n/provider";
2
3
 
3
4
  import * as React from "react";
4
5
  import { cn } from "@/lib/utils";
@@ -55,6 +56,7 @@ function DialogContent({
55
56
  }: React.ComponentProps<typeof DialogPrimitive.Content> & {
56
57
  showCloseButton?: boolean;
57
58
  }) {
59
+ const { t } = useI18n();
58
60
  return (
59
61
  <DialogPortal data-slot="dialog-portal">
60
62
  <DialogOverlay />
@@ -73,7 +75,7 @@ function DialogContent({
73
75
  className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
74
76
  >
75
77
  <XIcon />
76
- <span className="sr-only">Close</span>
78
+ <span className="sr-only">{t("Close")}</span>
77
79
  </DialogPrimitive.Close>
78
80
  )}
79
81
  </DialogPrimitive.Content>
@@ -81,11 +83,17 @@ function DialogContent({
81
83
  );
82
84
  }
83
85
 
84
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
86
+ function DialogHeader({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<"div">) {
85
90
  return (
86
91
  <div
87
92
  data-slot="dialog-header"
88
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
93
+ className={cn(
94
+ "flex flex-col gap-2 text-center sm:text-left",
95
+ className,
96
+ )}
89
97
  {...props}
90
98
  />
91
99
  );
@@ -99,6 +107,7 @@ function DialogFooter({
99
107
  }: React.ComponentProps<"div"> & {
100
108
  showCloseButton?: boolean;
101
109
  }) {
110
+ const { t } = useI18n();
102
111
  return (
103
112
  <div
104
113
  data-slot="dialog-footer"
@@ -111,7 +120,7 @@ function DialogFooter({
111
120
  {children}
112
121
  {showCloseButton && (
113
122
  <DialogPrimitive.Close asChild>
114
- <Button variant="outline">Close</Button>
123
+ <Button variant="outline">{t("Close")}</Button>
115
124
  </DialogPrimitive.Close>
116
125
  )}
117
126
  </div>
@@ -1,11 +1,14 @@
1
1
  "use client";
2
+ import { useI18n } from "@/src/client/i18n/provider";
2
3
 
3
4
  import * as React from "react";
4
5
  import { cn } from "@/lib/utils";
5
6
  import { XIcon } from "lucide-react";
6
7
  import { Dialog as SheetPrimitive } from "radix-ui";
7
8
 
8
- function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
9
+ function Sheet({
10
+ ...props
11
+ }: React.ComponentProps<typeof SheetPrimitive.Root>) {
9
12
  return <SheetPrimitive.Root data-slot="sheet" {...props} />;
10
13
  }
11
14
 
@@ -53,6 +56,7 @@ function SheetContent({
53
56
  side?: "top" | "right" | "bottom" | "left";
54
57
  showCloseButton?: boolean;
55
58
  }) {
59
+ const { t } = useI18n();
56
60
  return (
57
61
  <SheetPortal>
58
62
  <SheetOverlay />
@@ -76,7 +80,7 @@ function SheetContent({
76
80
  {showCloseButton && (
77
81
  <SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
78
82
  <XIcon className="size-4" />
79
- <span className="sr-only">Close</span>
83
+ <span className="sr-only">{t("Close")}</span>
80
84
  </SheetPrimitive.Close>
81
85
  )}
82
86
  </SheetPrimitive.Content>
@@ -44,7 +44,9 @@ type SidebarContextProps = {
44
44
  triggerRef: React.RefObject<HTMLButtonElement | null>;
45
45
  };
46
46
 
47
- const SidebarContext = React.createContext<SidebarContextProps | null>(null);
47
+ const SidebarContext = React.createContext<SidebarContextProps | null>(
48
+ null,
49
+ );
48
50
 
49
51
  function useSidebar() {
50
52
  const context = React.useContext(SidebarContext);
@@ -93,7 +95,9 @@ function SidebarProvider({
93
95
 
94
96
  // Helper to toggle the sidebar.
95
97
  const toggleSidebar = React.useCallback(() => {
96
- return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
98
+ return isMobile
99
+ ? setOpenMobile((open) => !open)
100
+ : setOpen((open) => !open);
97
101
  }, [isMobile, setOpen, setOpenMobile]);
98
102
 
99
103
  // Adds a keyboard shortcut to toggle the sidebar.
@@ -127,7 +131,15 @@ function SidebarProvider({
127
131
  toggleSidebar,
128
132
  triggerRef,
129
133
  }),
130
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],
134
+ [
135
+ state,
136
+ open,
137
+ setOpen,
138
+ isMobile,
139
+ openMobile,
140
+ setOpenMobile,
141
+ toggleSidebar,
142
+ ],
131
143
  );
132
144
 
133
145
  return (
@@ -270,6 +282,7 @@ function SidebarTrigger({
270
282
  onClick,
271
283
  ...props
272
284
  }: React.ComponentProps<typeof Button>) {
285
+ const { t } = useI18n();
273
286
  const { toggleSidebar, triggerRef } = useSidebar();
274
287
 
275
288
  return (
@@ -287,22 +300,26 @@ function SidebarTrigger({
287
300
  {...props}
288
301
  >
289
302
  <PanelLeftIcon />
290
- <span className="sr-only">Toggle Sidebar</span>
303
+ <span className="sr-only">{t("Toggle Sidebar")}</span>
291
304
  </Button>
292
305
  );
293
306
  }
294
307
 
295
- function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
308
+ function SidebarRail({
309
+ className,
310
+ ...props
311
+ }: React.ComponentProps<"button">) {
312
+ const { t } = useI18n();
296
313
  const { toggleSidebar } = useSidebar();
297
314
 
298
315
  return (
299
316
  <button
300
317
  data-sidebar="rail"
301
318
  data-slot="sidebar-rail"
302
- aria-label="Toggle Sidebar"
319
+ aria-label={t("Toggle Sidebar")}
303
320
  tabIndex={-1}
304
321
  onClick={toggleSidebar}
305
- title="Toggle Sidebar"
322
+ title={t("Toggle Sidebar")}
306
323
  className={cn(
307
324
  "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex",
308
325
  "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
@@ -317,7 +334,10 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
317
334
  );
318
335
  }
319
336
 
320
- function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
337
+ function SidebarInset({
338
+ className,
339
+ ...props
340
+ }: React.ComponentProps<"main">) {
321
341
  return (
322
342
  <main
323
343
  data-slot="sidebar-inset"
@@ -345,7 +365,10 @@ function SidebarInput({
345
365
  );
346
366
  }
347
367
 
348
- function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
368
+ function SidebarHeader({
369
+ className,
370
+ ...props
371
+ }: React.ComponentProps<"div">) {
349
372
  return (
350
373
  <div
351
374
  data-slot="sidebar-header"
@@ -356,7 +379,10 @@ function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
356
379
  );
357
380
  }
358
381
 
359
- function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
382
+ function SidebarFooter({
383
+ className,
384
+ ...props
385
+ }: React.ComponentProps<"div">) {
360
386
  return (
361
387
  <div
362
388
  data-slot="sidebar-footer"
@@ -381,7 +407,10 @@ function SidebarSeparator({
381
407
  );
382
408
  }
383
409
 
384
- function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
410
+ function SidebarContent({
411
+ className,
412
+ ...props
413
+ }: React.ComponentProps<"div">) {
385
414
  return (
386
415
  <div
387
416
  data-slot="sidebar-content"
@@ -395,7 +424,10 @@ function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
395
424
  );
396
425
  }
397
426
 
398
- function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
427
+ function SidebarGroup({
428
+ className,
429
+ ...props
430
+ }: React.ComponentProps<"div">) {
399
431
  return (
400
432
  <div
401
433
  data-slot="sidebar-group"
@@ -475,7 +507,10 @@ function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
475
507
  );
476
508
  }
477
509
 
478
- function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
510
+ function SidebarMenuItem({
511
+ className,
512
+ ...props
513
+ }: React.ComponentProps<"li">) {
479
514
  return (
480
515
  <li
481
516
  data-slot="sidebar-menu-item"
@@ -491,7 +526,8 @@ const sidebarMenuButtonVariants = cva(
491
526
  {
492
527
  variants: {
493
528
  variant: {
494
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
529
+ default:
530
+ "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
495
531
  outline:
496
532
  "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
497
533
  },
@@ -530,7 +566,10 @@ function SidebarMenuButton({
530
566
  data-sidebar="menu-button"
531
567
  data-size={size}
532
568
  data-active={isActive}
533
- className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
569
+ className={cn(
570
+ sidebarMenuButtonVariants({ variant, size }),
571
+ className,
572
+ )}
534
573
  {...props}
535
574
  />
536
575
  );
@@ -625,7 +664,10 @@ function SidebarMenuSkeleton({
625
664
  <div
626
665
  data-slot="sidebar-menu-skeleton"
627
666
  data-sidebar="menu-skeleton"
628
- className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
667
+ className={cn(
668
+ "flex h-8 items-center gap-2 rounded-md px-2",
669
+ className,
670
+ )}
629
671
  {...props}
630
672
  >
631
673
  {showIcon && (
@@ -647,7 +689,10 @@ function SidebarMenuSkeleton({
647
689
  );
648
690
  }
649
691
 
650
- function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
692
+ function SidebarMenuSub({
693
+ className,
694
+ ...props
695
+ }: React.ComponentProps<"ul">) {
651
696
  return (
652
697
  <ul
653
698
  data-slot="sidebar-menu-sub"
@@ -1,35 +1,29 @@
1
- # Панель управления
1
+ # Admin panel {#панель-управления}
2
2
 
3
- Админка использует общий UI kit shadcn/ui (Radix), Tailwind CSS 4, Lucide и Recharts. Исходники компонентов находятся в `components/ui`, тема — в `app/globals.css`, оболочка — в `components/admin`. Светлая и тёмная темы используют одни семантические токены. Новые страницы должны использовать эти компоненты и токены, сохраняя серверную проверку сессии в `app/updates/layout.tsx`.
3
+ The admin panel uses a shared shadcn/ui (Radix) UI kit, Tailwind CSS 4, Lucide and Recharts. Component sources live in `components/ui`, the theme in `app/globals.css`, and the shell in `components/admin`. Light and dark themes share semantic tokens. New pages must use these components and tokens while preserving server-side session validation in `app/updates/layout.tsx`.
4
4
 
5
- ## Навигация и данные
5
+ ## Navigation and data {#навигация-и-данные}
6
6
 
7
- - **Установки** (`/updates/devices`): общие серверные фильтры, KPI, дневная активность, распределение версий, когорты и реестр. Часть Installation ID можно использовать для поиска конкретной установки. Полные идентификаторы и диагностика доступны по нажатию на ID.
8
- - **OTA-обновления** (`/updates`): список публикаций, сортировка, пагинация и переход к редактированию. Аварийная остановка распространения находится в раскрываемой панели «Управление».
9
- - **Embedded-сборки** и **Аварийные маршруты** сохраняют существующие ограничения по ролям и действия управления.
7
+ - **Installations** (`/updates/devices`): shared server filters, KPIs, daily activity, version distribution, cohorts and registry. Search supports partial installation IDs. Select an ID for full identifiers and diagnostics.
8
+ - **OTA updates** (`/updates`): releases, sorting, pagination and editing. The emergency distribution stop is in the expandable Management panel.
9
+ - **Embedded builds** and **Emergency redirects** retain the existing role restrictions and management actions.
10
10
 
11
- Фильтры применяются кнопкой «Применить» ко всей выборке. Ошибка запроса оставляет предыдущий результат с явным сообщением. Если последняя страница исчезла при обновлении, реестр переходит на последнюю существующую страницу. Статистика считает установки, а не уникальных людей.
11
+ Apply filters to the entire selection with Apply. A failed request keeps the previous result with an explicit message. If the last page disappears after a refresh, the registry moves to the last available page. Analytics count installations, not unique people.
12
12
 
13
- Подробная семантика дневных данных, когорт, возвращаемости и миграция существующей базы: [Телеметрия установок](./installation-telemetry.md). Для существующей базы нужна миграция `2026-10-22-device-analytics.sql`; новая база получает её из канонического `schema.sql`.
13
+ For daily data, cohort and retention semantics and database migration, see [installation telemetry](./installation-telemetry.md). Existing databases require `2026-10-22-device-analytics.sql`; new databases receive it from the canonical `schema.sql`.
14
14
 
15
- ## Проверка интерфейса
15
+ ## Interface verification {#проверка-интерфеиса}
16
16
 
17
- При изменениях проверяйте ширины 1440 и 390 px, обе темы, фильтры с пустым результатом, сброс фильтров, раскрытие и копирование ID, клавиатурное закрытие боковых панелей с возвратом фокуса, повтор пагинации после ошибки и уменьшение числа записей на последней странице. Таблицы могут прокручиваться внутри карточки; горизонтальная прокрутка всей страницы не нужна. Историю до начала сбора нельзя заменять нулями или демонстрационными данными.
17
+ When making changes, check 1440px and 390px widths, both themes, empty filter results and reset, expanding and copying IDs, keyboard dismissal of side panels with focus restoration, pagination retry after failure, and a shrinking last page. Tables may scroll within their cards; the whole page should not scroll horizontally. Never replace history before collection with zeroes or demo data.
18
18
 
19
- Команды проверки: `npm run lint`, `npx tsc --noEmit`, `npm test`, `npm run build`, `npm run installer:check`. Новые папки UI включены в шаблон npm-инсталлятора, поэтому панель получает тот же интерфейс при установке из коробки.
19
+ Verification commands: `npm run lint`, `npx tsc --noEmit`, `npm test`, `npm run build`, `npm run installer:check`. New UI directories are included in the npm initializer template, so generated installations receive the same interface.
20
20
 
21
- ## Interface language
21
+ ## Interface language {#interface-language}
22
22
 
23
- The admin panel defaults to English, including when the browser prefers another
24
- language. Select **English** or **Русский** on the sign-in screen or in the admin
25
- header. The choice persists in the `ota-locale` cookie for one year and is applied
26
- on the server for the next page load. Unknown locale values fall back to English.
27
- Switching languages preserves filters and unsaved form data; number/date formatting
28
- follows the selected locale. Analytics date boundaries remain UTC.
23
+ The admin panel defaults to English regardless of browser language. Select **English**, **Русский** or **Українська** on the sign-in screen or in the header. The choice persists in the `ota-locale` cookie for a year and is applied on the server on the next load. Unknown locale values fall back to English.
29
24
 
30
- UI translations live in `src/client/i18n/`. Russian source messages are catalog keys
31
- and `en.json` supplies their English equivalents. Use `useI18n().t` for interface
32
- copy and `useFormatters()` for analytics values. Keep interpolation slots intact.
33
- Do not translate API enum values, IDs, JSON, device names or user-written messages.
34
- Adding a language requires an explicit supported locale, catalog and selector option;
35
- browser language detection is deliberately not used for the default.
25
+ Switching languages preserves filters and unsaved form data, and immediately translates existing notifications. Numbers and dates follow the selected locale. Analytics date boundaries remain UTC. All admin screens, including emergency recovery, delivery policies and the Guard catalog, use the same language.
26
+
27
+ Translations live in `src/client/i18n/`: `en.json`, `ru.json` and `uk.json` must have identical keys and interpolation slots. Existing keys are Russian or English source messages; English equivalents are also accepted for API errors and labels. Use `useI18n().t` for interface text and `useFormatters()` for analytics. Store notifications as a source key or a `TranslationMessage` with interpolation values, and translate when rendering so they follow language changes.
28
+
29
+ Translate enum display labels while preserving their API values. Do not translate IDs, JSON, device or channel names, or user-written messages. Unknown technical errors are displayed verbatim. Catalog and switching tests cover completeness, interpolation, saved preferences, forms and notifications. Adding a language requires an explicit supported value, catalog and selector option; browser language deliberately does not determine the default.
@@ -11,14 +11,13 @@ have to match. A force-update guard does not bypass the audience.
11
11
  is required. Existing generated files can be refreshed with `--force` (review local edits).
12
12
  2. Rebuild the native app after adding `expo-secure-store`; use a new runtime so older
13
13
  binaries cannot download JavaScript importing a missing native module.
14
- 3. Open the app. In **Установки → installation details**, copy its Device ID or name it
15
- **Мой телефон**. Older clients still report Installation ID and can be targeted by it.
14
+ 3. Open the app. In **Installations → installation details**, copy its Device ID or name it
15
+ **My phone**. Older clients still report Installation ID and can be targeted by it.
16
16
  4. Publish with the generated `npm run ota:publish -- --platform android --message "Smoke"`.
17
- Publishing creates a draft. In its detail page select **Аудитория обновления → Только
18
- выбранные устройства / установки**, choose your phone, and **save before activation**.
17
+ Publishing creates a draft. In its detail page select **Update audience → Selected devices / installations only**, choose your phone, and **save before activation**.
19
18
  5. Activate the draft. Your device gets it; other compatible devices get the previous
20
19
  eligible public update, or no update if one does not exist.
21
- 6. After testing, set the audience to **Все совместимые устройства** and save. The same
20
+ 6. After testing, set the audience to **All compatible devices** and save. The same
22
21
  artifact is now eligible for everyone. No second publish is needed.
23
22
 
24
23
  Changing an active audience affects future checks immediately. It does not uninstall or
@@ -34,11 +34,11 @@ certificate, installs `expo-updates` and the identity/telemetry dependencies, ad
34
34
 
35
35
  It also generates `ota-client/` and starts identity/installation telemetry from
36
36
  `ota-entry.js`, preserving the original application entry. For Expo Router,
37
- the configurator inserts `useOtaUpdates` into `src/app/_layout` (or `app/_layout`)
38
- and wraps the root's rendered content with `OtaUpdateGate`. Standard `App`
37
+ the configurator renders `<OtaUpdates />` beside navigation in `src/app/_layout`
38
+ (or `app/_layout`). The generated TypeScript component owns the hook internally;
39
+ it does not wrap the application or require context. Standard `App`
39
40
  entry components are supported too, including platform variants. No manual
40
- Installation ID, Device ID, or heartbeat wiring is needed. The initial hook
41
- options are `{ autoCheck: true, autoUpdate: false, autoReload: false }`;
41
+ Installation ID, Device ID, or heartbeat wiring is needed. The component starts with automatic checks and manual download/restart prompts;
42
42
  customized options are preserved on later configurations. See the generated
43
43
  [OTA client lifecycle](./ota-client-lifecycle.md) for update modes and the hook API.
44
44
  If generation is unavailable, follow [manual hook integration](./ota-client-lifecycle.md#manual-integration).
@@ -154,7 +154,7 @@ the installation to the new running version in analytics; the next launch heartb
154
154
  should. Confirm the Installation ID stays unchanged across the OTA restart.
155
155
 
156
156
  Finally, rerun the same configurator command. Check that it does not duplicate the
157
- hook/gate or replace the stored original entry. Change a hook option in the root
157
+ OTA component or replace the stored original entry. Change a component prop in the root
158
158
  and rerun to verify that the option survives. Use `--force` only when intentionally
159
159
  replacing changed generated files; it does not bypass unsupported root shapes.
160
160
  For the manual fallback test, use a separate clean copy and follow
@@ -452,7 +452,7 @@ expected URL, runtime, channel and certificate.
452
452
 
453
453
  ## 5. Check and install updates in the application
454
454
 
455
- Use the generated `useOtaUpdates` controller with `OtaUpdateGate` in the root
455
+ Render the generated `<OtaUpdates />` component beside navigation in the root
456
456
  layout. `configure-app` inserts this integration automatically. If the files or root
457
457
  patch are missing, follow [manual integration](./ota-client-lifecycle.md#manual-integration),
458
458
  including the complete Router example and manual controls.
@@ -460,14 +460,10 @@ including the complete Router example and manual controls.
460
460
  The root defaults to automatic checks and manual download/restart:
461
461
 
462
462
  ```tsx
463
- const ota = useOtaUpdates({
464
- autoCheck: true,
465
- autoUpdate: false,
466
- autoReload: false,
467
- });
463
+ <OtaUpdates autoCheck autoUpdate={false} autoReload={false} />
468
464
  ```
469
465
 
470
- Screens use `useOtaUpdates()` and its `check()`, `download()` and `reload()` methods.
466
+ Optional custom screens can use `useOtaUpdates()` and its `check()`, `download()` and `reload()` methods.
471
467
  Identity setup, telemetry and update policies share one controller. Do not replace
472
468
  these actions with direct `Updates.checkForUpdateAsync()`/`fetchUpdateAsync()` calls:
473
469
  those bypass hook orchestration. Keep native `checkAutomatically: "NEVER"`.