create-expo-updates-server 0.3.0 → 0.6.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.
- package/README.md +4 -2
- package/dist/template/Dockerfile +4 -6
- package/dist/template/README.md +5 -10
- package/dist/template/app/api/admin/device-favorites/route.test.ts +125 -0
- package/dist/template/app/api/admin/device-favorites/route.ts +91 -0
- package/dist/template/app/api/admin/distribution-history/restore/route.ts +39 -0
- package/dist/template/app/api/admin/distribution-history/route.test.ts +55 -0
- package/dist/template/app/api/admin/distribution-history/route.ts +24 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/deactivate/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/promote/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/rollback/route.ts +2 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/route.ts +2 -1
- package/dist/template/app/api/admin/updates/route.test.ts +21 -0
- package/dist/template/app/api/admin/updates/route.ts +12 -1
- package/dist/template/app/globals.css +65 -68
- package/dist/template/app/login/page.tsx +66 -42
- package/dist/template/app/updates/[encodedKey]/page.tsx +382 -248
- package/dist/template/app/updates/devices/page.tsx +187 -145
- package/dist/template/app/updates/embedded/page.tsx +80 -34
- package/dist/template/app/updates/emergency-redirects/page.tsx +138 -71
- package/dist/template/app/updates/layout.tsx +2 -1
- package/dist/template/app/updates/page.tsx +385 -274
- package/dist/template/app/updates/releases.test.tsx +156 -0
- package/dist/template/components/admin/admin-role.ts +5 -0
- package/dist/template/components/admin/admin-shell.tsx +166 -95
- package/dist/template/components/admin/confirm-action.tsx +123 -0
- package/dist/template/components/admin/language-switcher.tsx +27 -16
- package/dist/template/components/admin/release-badges.test.tsx +50 -0
- package/dist/template/components/admin/release-badges.tsx +101 -0
- package/dist/template/components/ui/alert.tsx +10 -3
- package/dist/template/components/ui/avatar.tsx +108 -0
- package/dist/template/components/ui/badge.tsx +2 -2
- package/dist/template/components/ui/breadcrumb.tsx +108 -0
- package/dist/template/components/ui/button.tsx +5 -5
- package/dist/template/components/ui/card.tsx +2 -2
- package/dist/template/components/ui/chart.tsx +1 -1
- package/dist/template/components/ui/collapsible.tsx +7 -0
- package/dist/template/components/ui/dialog.tsx +13 -4
- package/dist/template/components/ui/empty.tsx +103 -0
- package/dist/template/components/ui/field.tsx +248 -0
- package/dist/template/components/ui/input-group.tsx +170 -0
- package/dist/template/components/ui/input.tsx +1 -1
- package/dist/template/components/ui/native-select.tsx +1 -1
- package/dist/template/components/ui/radio-group.tsx +41 -0
- package/dist/template/components/ui/sheet.tsx +6 -2
- package/dist/template/components/ui/sidebar.tsx +62 -17
- package/dist/template/components/ui/status-tones.ts +15 -0
- package/dist/template/components/ui/table.tsx +1 -1
- package/dist/template/components/ui/textarea.tsx +1 -1
- package/dist/template/docs/admin-ui.md +22 -24
- package/dist/template/docs/device-targeting.md +6 -12
- package/dist/template/docs/doctor.md +2 -2
- package/dist/template/docs/expo-app-setup.md +9 -27
- package/dist/template/docs/getting-started.md +3 -4
- package/dist/template/docs/getting-started.ru.md +11 -544
- package/dist/template/docs/index.md +1 -1
- package/dist/template/docs/installation-telemetry.md +6 -12
- package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +5 -0
- package/dist/template/docs/migrations/2026-11-25-device-favorites.sql +53 -0
- package/dist/template/docs/migrations/2026-11-25-download-on-postpone.sql +5 -0
- package/dist/template/docs/migrations/2026-11-25-public-distribution-history.sql +283 -0
- package/dist/template/docs/migrations/schema.sql +349 -0
- package/dist/template/docs/npm-installer.md +3 -3
- package/dist/template/docs/operations-guide.md +9 -7
- package/dist/template/docs/ota-client-lifecycle.md +30 -68
- package/dist/template/docs/ota-emergency-recovery.md +34 -57
- package/dist/template/docs/ota-update-policy.md +9 -20
- package/dist/template/docs/ru/admin-ui.md +33 -0
- package/dist/template/docs/ru/device-targeting.md +59 -0
- package/dist/template/docs/ru/doctor.md +98 -0
- package/dist/template/docs/ru/expo-app-setup.md +497 -0
- package/dist/template/docs/ru/getting-started.md +391 -0
- package/dist/template/docs/ru/index.md +50 -0
- package/dist/template/docs/ru/installation-telemetry.md +125 -0
- package/dist/template/docs/ru/npm-installer.md +71 -0
- package/dist/template/docs/ru/operations-guide.md +322 -0
- package/dist/template/docs/ru/ota-client-lifecycle.md +162 -0
- package/dist/template/docs/ru/ota-emergency-recovery.md +108 -0
- package/dist/template/docs/ru/ota-update-policy.md +69 -0
- package/dist/template/docs/ru/publishing-npm-installer.md +49 -0
- package/dist/template/docs/ru/supabase-setup.md +120 -0
- package/dist/template/docs/uk/admin-ui.md +33 -0
- package/dist/template/docs/uk/device-targeting.md +59 -0
- package/dist/template/docs/uk/doctor.md +98 -0
- package/dist/template/docs/uk/expo-app-setup.md +497 -0
- package/dist/template/docs/uk/getting-started.md +391 -0
- package/dist/template/docs/uk/index.md +50 -0
- package/dist/template/docs/uk/installation-telemetry.md +125 -0
- package/dist/template/docs/uk/npm-installer.md +71 -0
- package/dist/template/docs/uk/operations-guide.md +322 -0
- package/dist/template/docs/uk/ota-client-lifecycle.md +162 -0
- package/dist/template/docs/uk/ota-emergency-recovery.md +108 -0
- package/dist/template/docs/uk/ota-update-policy.md +69 -0
- package/dist/template/docs/uk/publishing-npm-installer.md +49 -0
- package/dist/template/docs/uk/supabase-setup.md +120 -0
- package/dist/template/lib/audience-ids.ts +4 -0
- package/dist/template/package-lock.json +46 -0
- package/dist/template/package.json +4 -1
- package/dist/template/scripts/configure-expo-app.mjs +3 -3
- package/dist/template/scripts/create-access-token.mjs +1 -1
- package/dist/template/scripts/lib/doctor.mjs +10 -7
- package/dist/template/scripts/lib/doctor.test.mjs +7 -5
- package/dist/template/scripts/lib/embedded-update-registrar.test.ts +22 -7
- package/dist/template/scripts/lib/expo-app-configurator.mjs +25 -22
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +37 -2
- package/dist/template/scripts/lib/ota-client-configurator.mjs +152 -55
- package/dist/template/scripts/lib/ota-client-configurator.test.ts +60 -20
- package/dist/template/scripts/lib/ota-client-package.mjs +25 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +90 -32
- package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +49 -6
- package/dist/template/scripts/tests/device-analytics-migrations.mjs +12 -1
- package/dist/template/scripts/tests/device-targeting-activation.mjs +2 -3
- package/dist/template/scripts/tests/e2e/client-lifecycle.mjs +161 -0
- package/dist/template/scripts/tests/e2e/client-lifecycle.scenario.jsx +465 -0
- package/dist/template/scripts/tests/e2e/client-vitest.mts +18 -0
- package/dist/template/scripts/tests/e2e/console.mjs +86 -0
- package/dist/template/scripts/tests/e2e/delivery.mjs +296 -0
- package/dist/template/scripts/tests/e2e/device-favorites.mjs +309 -0
- package/dist/template/scripts/tests/e2e/installations.mjs +132 -0
- package/dist/template/scripts/tests/e2e/policy.mjs +253 -0
- package/dist/template/scripts/tests/e2e/registrar-token.mjs +59 -0
- package/dist/template/scripts/tests/e2e/release-matrix.mjs +307 -0
- package/dist/template/scripts/tests/e2e/releases.mjs +162 -0
- package/dist/template/scripts/tests/e2e/run.mjs +224 -0
- package/dist/template/scripts/tests/manifest-identity.sql +7 -5
- package/dist/template/scripts/tests/public-distribution-history.mjs +102 -0
- package/dist/template/src/client/admin-api.ts +45 -10
- package/dist/template/src/client/admin-types.ts +35 -1
- package/dist/template/src/client/devices/analytics.tsx +169 -219
- package/dist/template/src/client/devices/cohorts.tsx +181 -0
- package/dist/template/src/client/devices/device-name.tsx +37 -21
- package/dist/template/src/client/devices/favorite-targets.tsx +381 -0
- package/dist/template/src/client/devices/registry.tsx +265 -233
- package/dist/template/src/client/devices/use-devices-report.test.tsx +98 -0
- package/dist/template/src/client/devices/use-devices-report.ts +53 -82
- package/dist/template/src/client/devices/version-adoption-chart.tsx +48 -38
- package/dist/template/src/client/distribution-control.tsx +98 -53
- package/dist/template/src/client/distribution-history.tsx +353 -0
- package/dist/template/src/client/guard-action-catalog.tsx +183 -0
- package/dist/template/src/client/guard-action-combobox.test.ts +16 -22
- package/dist/template/src/client/guard-action-combobox.tsx +134 -234
- package/dist/template/src/client/guard-action-options.ts +4 -6
- package/dist/template/src/client/i18n/en.json +335 -2
- package/dist/template/src/client/i18n/language-switching.test.tsx +233 -0
- package/dist/template/src/client/i18n/messages.test.ts +102 -19
- package/dist/template/src/client/i18n/messages.ts +31 -16
- package/dist/template/src/client/i18n/provider.tsx +6 -3
- package/dist/template/src/client/i18n/ru.json +619 -0
- package/dist/template/src/client/i18n/uk.json +619 -0
- package/dist/template/src/client/i18n/use-formatters.ts +5 -0
- package/dist/template/src/client/logout-button.tsx +3 -3
- package/dist/template/src/client/policy-draft.ts +138 -0
- package/dist/template/src/client/update-audience-editor.tsx +597 -199
- package/dist/template/src/client/update-policy-editor.test.ts +101 -29
- package/dist/template/src/client/update-policy-editor.tsx +466 -307
- package/dist/template/src/client/use-filtered-results.ts +55 -0
- package/dist/template/src/server/controllers/manifest.test.ts +23 -3
- package/dist/template/src/server/controllers/manifest.ts +15 -1
- package/dist/template/src/server/devices/audience.ts +9 -5
- package/dist/template/src/server/lib/admin-audience-activation.test.ts +37 -90
- package/dist/template/src/server/lib/admin-release-history.test.ts +138 -0
- package/dist/template/src/server/lib/admin-updates.ts +160 -534
- package/dist/template/src/server/lib/distribution-history.ts +97 -0
- package/dist/template/src/server/lib/supabase.js +24 -0
- package/dist/template/src/server/lib/supabase.test.ts +38 -1
- package/dist/template/src/server/lib/update-policy.test.ts +20 -0
- package/dist/template/src/server/lib/update-policy.ts +23 -10
- package/dist/template/src/server/manifest/manifest-repository.ts +11 -3
- package/dist/template/src/server/manifest/manifest-values.test.ts +2 -0
- package/dist/template/src/server/manifest/manifest-values.ts +21 -13
- package/dist/template/templates/expo-app/scripts/ota-publish/api/database-client.mjs +7 -30
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/index.mjs +2 -1
- package/dist/template/tsconfig.json +2 -2
- package/dist/template-manifest.json +571 -271
- package/package.json +1 -1
- package/dist/template/scripts/lib/device-identity.test.ts +0 -29
- package/dist/template/scripts/lib/ota-client.test.ts +0 -55
- package/dist/template/scripts/lib/ota-update-controller.test.ts +0 -232
- package/dist/template/scripts/lib/ota-updates-ui.test.tsx +0 -154
- package/dist/template/scripts/tests/ota-client-types.mjs +0 -69
- package/dist/template/templates/expo-app/ota-client/README.md +0 -73
- package/dist/template/templates/expo-app/ota-client/controller.ts +0 -107
- package/dist/template/templates/expo-app/ota-client/device-identity.ts +0 -48
- package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +0 -61
- package/dist/template/templates/expo-app/ota-client/index.ts +0 -16
- package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.ts +0 -97
- package/dist/template/templates/expo-app/ota-client/model/update-controller.ts +0 -293
- package/dist/template/templates/expo-app/ota-client/runtime.ts +0 -153
- package/dist/template/templates/expo-app/ota-client/types.ts +0 -85
- package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.tsx +0 -25
- package/dist/template/templates/expo-app/ota-client/ui/ota-updates.tsx +0 -196
|
@@ -44,7 +44,9 @@ type SidebarContextProps = {
|
|
|
44
44
|
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
const SidebarContext = React.createContext<SidebarContextProps | 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
|
|
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
|
-
[
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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:
|
|
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(
|
|
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(
|
|
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({
|
|
692
|
+
function SidebarMenuSub({
|
|
693
|
+
className,
|
|
694
|
+
...props
|
|
695
|
+
}: React.ComponentProps<"ul">) {
|
|
651
696
|
return (
|
|
652
697
|
<ul
|
|
653
698
|
data-slot="sidebar-menu-sub"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Explicit foreground/surface pairs keep small labels legible on both themes.
|
|
2
|
+
export const statusTones = {
|
|
3
|
+
neutral:
|
|
4
|
+
"border-[#cdd5df] bg-[#eef1f5] text-[#3c4b60] dark:border-[#425065] dark:bg-[#28313e] dark:text-[#d0dae7]",
|
|
5
|
+
positive:
|
|
6
|
+
"border-[#a6d9bd] bg-[#e5f6eb] text-[#165837] dark:border-[#31634b] dark:bg-[#18382b] dark:text-[#94e0b1]",
|
|
7
|
+
info: "border-[#b3d1f1] bg-[#e8f2fe] text-[#1c4e82] dark:border-[#345b81] dark:bg-[#20344c] dark:text-[#aad2ff]",
|
|
8
|
+
warning:
|
|
9
|
+
"border-[#e6c38b] bg-[#fff3dc] text-[#754210] dark:border-[#765b34] dark:bg-[#40311e] dark:text-[#f5cd8d]",
|
|
10
|
+
destructive:
|
|
11
|
+
"border-[#e5b3b8] bg-[#fcebed] text-[#942c40] dark:border-[#82404e] dark:bg-[#42232c] dark:text-[#ffb7bf]",
|
|
12
|
+
violet:
|
|
13
|
+
"border-[#ccbdec] bg-[#f2ebfc] text-[#5f3988] dark:border-[#60507a] dark:bg-[#342a44] dark:text-[#dbc3fb]",
|
|
14
|
+
teal: "border-[#a1d6d1] bg-[#e0f4f2] text-[#155957] dark:border-[#396462] dark:bg-[#193a3a] dark:text-[#95ded7]",
|
|
15
|
+
} as const;
|
|
@@ -69,7 +69,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
69
69
|
<th
|
|
70
70
|
data-slot="table-head"
|
|
71
71
|
className={cn(
|
|
72
|
-
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
72
|
+
"h-10 px-2 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
73
73
|
className,
|
|
74
74
|
)}
|
|
75
75
|
{...props}
|
|
@@ -6,7 +6,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
|
6
6
|
<textarea
|
|
7
7
|
data-slot="textarea"
|
|
8
8
|
className={cn(
|
|
9
|
-
"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-
|
|
9
|
+
"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-card px-3 py-2 text-base transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:ring-destructive/40",
|
|
10
10
|
className,
|
|
11
11
|
)}
|
|
12
12
|
{...props}
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Admin panel {#панель-управления}
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
-
|
|
8
|
-
- **
|
|
9
|
-
- **Embedded
|
|
7
|
+
- **Releases** (`/updates`) opens after sign-in. Search all releases by ID, comment, channel or version. Combine platform, channel, runtime, status and audience filters before paging. Open a release to review its delivery scope, edit the audience and policy, activate, roll back or promote. Metadata has its own tab. The global distribution switch appears above the list.
|
|
8
|
+
- **Installations** (`/updates/devices`) has Overview, Versions, Cohorts and Registry tabs. Shared filters apply across tabs. Daily values distinguish missing history, zero activity and a partial UTC day. Version shares use the installations in each displayed platform and channel.
|
|
9
|
+
- **Embedded builds** and **Emergency redirects** retain the existing role restrictions and management actions.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Changing a selection or resetting filters updates results immediately. Text search updates after a short pause in typing. 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
|
-
|
|
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
|
+
Publication creates an inactive draft. Choose an audience and a delivery policy before manually activating the release. In **Selected devices**, save an installation or device to your personal favorites to reuse it for smoke tests. **Public delivery** shows current and previous public releases for each runtime, channel and platform. Restore requires confirmation. On an existing database, apply `2026-11-25-device-favorites.sql` and `2026-11-25-public-distribution-history.sql` after the device-targeting migrations. Public history starts with the current public release at installation. Older activation dates and predecessors are unknown.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Under **Selected recipients**, choose a device from the registry, add a favorite, or paste IDs. Review the list before saving. A Device ID targets the device across reinstalls. An Installation ID targets one installation.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Interface verification {#проверка-интерфеиса}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
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.
|
|
22
22
|
|
|
23
|
-
|
|
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
|
+
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.
|
|
29
24
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
## Interface language {#interface-language}
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
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
|
|
15
|
-
|
|
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
|
|
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
|
|
@@ -81,12 +80,7 @@ repeatable and do not change the audience or active state of existing releases.
|
|
|
81
80
|
The targeting migration removes the single-active-release index because a targeted
|
|
82
81
|
release must coexist with its public fallback. Existing releases have audience `all`.
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
Normal public activation keeps the previous behavior of disabling older releases.
|
|
86
|
-
Widening an already-active targeted release leaves the prior public fallback eligible;
|
|
87
|
-
the newer release wins selection. Disabling the targeted release restores fallback selection.
|
|
88
|
-
Explicit rollback has priority, subject to the same audience and compatibility checks.
|
|
89
|
-
Emergency pinned redirects still fail closed when the selected artifact differs.
|
|
83
|
+
Targeted smoke releases can coexist with a public release. Activating a public release, or widening an active smoke release to all devices, retires the previously public release in that runtime, channel and platform. Stopping the public release leaves public delivery stopped. Use **Releases → Public delivery → Restore** to resume the previous eligible public release manually. Drafts and device-only activations do not enter public history.
|
|
90
84
|
|
|
91
85
|
Admin API:
|
|
92
86
|
|
|
@@ -117,7 +111,7 @@ CAS, global block and reinstall tests. Fixtures are rolled back. Device reinstal
|
|
|
117
111
|
behavior additionally requires physical-device testing with the native build.
|
|
118
112
|
|
|
119
113
|
Activation and audience changes are serialized in PostgreSQL. Public activation disables
|
|
120
|
-
|
|
114
|
+
the previous public release in the same scope within the same statement; a failed activation
|
|
121
115
|
cannot partially disable the previous public release. This also covers the existing
|
|
122
116
|
`update-meta.json` editor. Targeted activation preserves other audiences. During a global
|
|
123
117
|
stop, deactivation can repair stale pointers to the remaining active fallback; activating,
|
|
@@ -75,8 +75,8 @@ mismatch with the selected env file.
|
|
|
75
75
|
| PostgreSQL | Connection, read access to core OTA/telemetry/targeting columns, required table/function signatures and enabled audience-activation trigger |
|
|
76
76
|
| Supabase | Read access to core REST tables/columns and storage bucket; SQL function bodies are not inspected |
|
|
77
77
|
| Storage | Existing accessible bucket via S3 HEAD or Supabase bucket GET; no writes |
|
|
78
|
-
| Expo app | Static config,
|
|
79
|
-
| Root | Recognized
|
|
78
|
+
| Expo app | Static config, client package, native dependencies, URL/channel/runtime, native check mode, identity namespace and telemetry URL |
|
|
79
|
+
| Root | Recognized `OtaUpdates` mount and generated bootstrap metadata; custom roots need manual verification |
|
|
80
80
|
| Publisher/registrar | Presence and basic shape of `.env.ota` credentials, publisher command, channel and registration URL consistency |
|
|
81
81
|
|
|
82
82
|
Without `--app`, app checks are skipped. Without an app certificate or an explicit
|
|
@@ -28,20 +28,9 @@ npm run configure-app -- \
|
|
|
28
28
|
--runtime-version 1.0.0
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The
|
|
32
|
-
|
|
33
|
-
`expo
|
|
34
|
-
|
|
35
|
-
It also generates `ota-client/` and starts identity/installation telemetry from
|
|
36
|
-
`ota-entry.js`, preserving the original application entry. For Expo Router,
|
|
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`
|
|
40
|
-
entry components are supported too, including platform variants. No manual
|
|
41
|
-
Installation ID, Device ID, or heartbeat wiring is needed. The component starts with automatic checks and manual download/restart prompts;
|
|
42
|
-
customized options are preserved on later configurations. See the generated
|
|
43
|
-
[OTA client lifecycle](./ota-client-lifecycle.md) for update modes and the hook API.
|
|
44
|
-
If generation is unavailable, follow [manual hook integration](./ota-client-lifecycle.md#manual-integration).
|
|
31
|
+
The configurator runs `expo install` for `expo-updates-server-client@0.1.0` and its native dependencies. It updates `app.json` and `package.json`, copies the public signing certificate, installs the publisher and runs `expo prebuild`. It supports npm, pnpm, Yarn and Bun lockfiles.
|
|
32
|
+
|
|
33
|
+
It writes the public settings to `ota-client/config.json`. The generated `ota-entry.js` calls `initializeOtaClient(config)` and `start()` before loading the original entry. In a supported root, the configurator adds an import from `expo-updates-server-client` and mounts `<OtaUpdates />` beside navigation. It recognizes Expo Router’s `src/app/_layout` or `app/_layout`, and standard `App` components, including platform variants. The component checks automatically and prompts the user to download or restart. You can change its options in the root. See the [client lifecycle guide](./ota-client-lifecycle.md).
|
|
45
34
|
|
|
46
35
|
The source patch uses syntax-tree locations and keeps existing imports, comments,
|
|
47
36
|
directives, component code and nested callbacks. Unsupported root exports
|
|
@@ -51,9 +40,6 @@ function identifier to make the patch possible. A custom entry whose root
|
|
|
51
40
|
cannot be identified keeps its existing startup behavior and prints a warning
|
|
52
41
|
that update orchestration still needs integration in its root component;
|
|
53
42
|
identity and telemetry remain connected through the generated bootstrap.
|
|
54
|
-
An existing `useOtaUpdates` import must use a relative path to `ota-client`.
|
|
55
|
-
Unresolved aliases such as `@/ota-client` stop the patch before writing, so a
|
|
56
|
-
second hook cannot silently override an existing automation configuration.
|
|
57
43
|
|
|
58
44
|
Options:
|
|
59
45
|
|
|
@@ -66,7 +52,7 @@ Options:
|
|
|
66
52
|
The CLI intentionally refuses dynamic `app.config.*` projects and refuses to
|
|
67
53
|
replace generated files unless `--force` is provided. The sections below
|
|
68
54
|
document native configuration; [manual hook integration](./ota-client-lifecycle.md#manual-integration)
|
|
69
|
-
covers client
|
|
55
|
+
covers the client package, dependencies, root wiring and controls. `--force` permits generated
|
|
70
56
|
file replacement; it does not bypass unsupported dynamic configs or root shapes.
|
|
71
57
|
`--server-env` selects the local server environment used to prepare publisher settings.
|
|
72
58
|
For an isolated test stand, explicitly pass its `.env.ota-test`.
|
|
@@ -113,15 +99,11 @@ Inspect the resulting diff before building:
|
|
|
113
99
|
| `app.json` | Correct HTTPS URL, certificate, runtime, channel; native automatic checks disabled |
|
|
114
100
|
| `package.json` | Client dependencies, `main: "ota-entry.js"`, publisher and selected platform build scripts |
|
|
115
101
|
| `ota-client-entry.json` | Original application entry retained |
|
|
116
|
-
| `ota-client
|
|
117
|
-
| Root `_layout` / `App` |
|
|
102
|
+
| `ota-client/config.json` | Public channel, heartbeat URL and identity namespace |
|
|
103
|
+
| Root `_layout` / `App` | Import from `expo-updates-server-client` and one `<OtaUpdates />` beside navigation |
|
|
118
104
|
| `.env.ota` | Local publisher/build credentials; ignored by Git, never imported by app code |
|
|
119
105
|
|
|
120
|
-
|
|
121
|
-
[manual controls example](./ota-client-lifecycle.md#_3-add-manual-update-controls)
|
|
122
|
-
to a test screen, or explicitly enable download/reload automation through the hook
|
|
123
|
-
options. The default root only checks; a stock Expo template has no OTA test buttons.
|
|
124
|
-
These controls/options must be in the binary you install so it can receive the first OTA.
|
|
106
|
+
The default component offers download and restart controls. To test a custom UI, add the [manual controls example](./ota-client-lifecycle.md#_3-add-manual-update-controls) before building the binary.
|
|
125
107
|
|
|
126
108
|
From the **application directory**, run:
|
|
127
109
|
|
|
@@ -167,7 +149,7 @@ missing manual setup steps.
|
|
|
167
149
|
For manual setup, install Expo-compatible versions of all client dependencies:
|
|
168
150
|
|
|
169
151
|
```bash
|
|
170
|
-
npx expo install expo-updates expo-application expo-crypto expo-secure-store @react-native-async-storage/async-storage
|
|
152
|
+
npx expo install expo-updates-server-client@0.1.0 expo-updates expo-application expo-crypto expo-secure-store @react-native-async-storage/async-storage
|
|
171
153
|
```
|
|
172
154
|
|
|
173
155
|
The application does not send an admin access token when checking for an
|
|
@@ -452,7 +434,7 @@ expected URL, runtime, channel and certificate.
|
|
|
452
434
|
|
|
453
435
|
## 5. Check and install updates in the application
|
|
454
436
|
|
|
455
|
-
Render
|
|
437
|
+
Render `<OtaUpdates />` component beside navigation in the root
|
|
456
438
|
layout. `configure-app` inserts this integration automatically. If the files or root
|
|
457
439
|
patch are missing, follow [manual integration](./ota-client-lifecycle.md#manual-integration),
|
|
458
440
|
including the complete Router example and manual controls.
|
|
@@ -13,7 +13,7 @@ SDK or macOS/Xcode. The server's Docker image does not provide the mobile toolch
|
|
|
13
13
|
Create the server files, or use an existing source checkout:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx create-expo-updates-server@
|
|
16
|
+
npx create-expo-updates-server@0.6.0 my-server
|
|
17
17
|
cd my-server
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -350,8 +350,7 @@ npm run configure-app
|
|
|
350
350
|
```
|
|
351
351
|
|
|
352
352
|
Select the app directory, certificate, public URL, channel, runtime and platform.
|
|
353
|
-
The CLI installs dependencies
|
|
354
|
-
and telemetry client, inserts the standalone root component, installs publisher/registration
|
|
353
|
+
The CLI installs `expo-updates-server-client@0.1.0` and the native dependencies with `expo install`, configures native updates, adds the client bootstrap and mounts `<OtaUpdates />` in the root, installs publisher/registration
|
|
355
354
|
scripts and runs prebuild. Review its summary before applying changes.
|
|
356
355
|
|
|
357
356
|
For flags, supported root components and reruns, see
|
|
@@ -384,7 +383,7 @@ a server running directly with npm. See [embedded registration](./expo-app-setup
|
|
|
384
383
|
|
|
385
384
|
Before building, choose how the app will download and apply updates.
|
|
386
385
|
|
|
387
|
-
The
|
|
386
|
+
The `<OtaUpdates />` component checks automatically and offers download,
|
|
388
387
|
restart and Later actions. To download ordinary updates automatically, set
|
|
389
388
|
`autoUpdate` on the component; use `autoReload` only if automatic restarts suit the app.
|
|
390
389
|
Custom screen controls are optional. See [hook options](./ota-client-lifecycle.md).
|