create-expo-updates-server 0.4.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +4 -2
  2. package/dist/template/Dockerfile +4 -6
  3. package/dist/template/README.md +4 -9
  4. package/dist/template/app/api/admin/device-favorites/route.test.ts +125 -0
  5. package/dist/template/app/api/admin/device-favorites/route.ts +91 -0
  6. package/dist/template/app/api/admin/distribution-history/restore/route.ts +39 -0
  7. package/dist/template/app/api/admin/distribution-history/route.test.ts +55 -0
  8. package/dist/template/app/api/admin/distribution-history/route.ts +24 -0
  9. package/dist/template/app/api/admin/updates/[encodedKey]/deactivate/route.ts +2 -1
  10. package/dist/template/app/api/admin/updates/[encodedKey]/promote/route.ts +2 -1
  11. package/dist/template/app/api/admin/updates/[encodedKey]/rollback/route.ts +2 -1
  12. package/dist/template/app/api/admin/updates/[encodedKey]/route.ts +2 -1
  13. package/dist/template/app/api/admin/updates/route.test.ts +21 -0
  14. package/dist/template/app/api/admin/updates/route.ts +12 -1
  15. package/dist/template/app/globals.css +65 -68
  16. package/dist/template/app/login/page.tsx +66 -42
  17. package/dist/template/app/updates/[encodedKey]/page.tsx +375 -263
  18. package/dist/template/app/updates/devices/page.tsx +188 -152
  19. package/dist/template/app/updates/embedded/page.tsx +63 -29
  20. package/dist/template/app/updates/emergency-redirects/page.tsx +93 -58
  21. package/dist/template/app/updates/layout.tsx +2 -1
  22. package/dist/template/app/updates/page.tsx +381 -283
  23. package/dist/template/app/updates/releases.test.tsx +156 -0
  24. package/dist/template/components/admin/admin-role.ts +5 -0
  25. package/dist/template/components/admin/admin-shell.tsx +166 -101
  26. package/dist/template/components/admin/confirm-action.tsx +123 -0
  27. package/dist/template/components/admin/language-switcher.tsx +25 -17
  28. package/dist/template/components/admin/release-badges.test.tsx +50 -0
  29. package/dist/template/components/admin/release-badges.tsx +101 -0
  30. package/dist/template/components/ui/alert.tsx +10 -3
  31. package/dist/template/components/ui/avatar.tsx +108 -0
  32. package/dist/template/components/ui/badge.tsx +2 -2
  33. package/dist/template/components/ui/breadcrumb.tsx +108 -0
  34. package/dist/template/components/ui/button.tsx +5 -5
  35. package/dist/template/components/ui/card.tsx +2 -2
  36. package/dist/template/components/ui/chart.tsx +1 -1
  37. package/dist/template/components/ui/collapsible.tsx +7 -0
  38. package/dist/template/components/ui/empty.tsx +103 -0
  39. package/dist/template/components/ui/field.tsx +248 -0
  40. package/dist/template/components/ui/input-group.tsx +170 -0
  41. package/dist/template/components/ui/input.tsx +1 -1
  42. package/dist/template/components/ui/native-select.tsx +1 -1
  43. package/dist/template/components/ui/radio-group.tsx +41 -0
  44. package/dist/template/components/ui/status-tones.ts +15 -0
  45. package/dist/template/components/ui/table.tsx +1 -1
  46. package/dist/template/components/ui/textarea.tsx +1 -1
  47. package/dist/template/docs/admin-ui.md +7 -3
  48. package/dist/template/docs/device-targeting.md +2 -7
  49. package/dist/template/docs/doctor.md +2 -2
  50. package/dist/template/docs/expo-app-setup.md +9 -27
  51. package/dist/template/docs/getting-started.md +3 -4
  52. package/dist/template/docs/installation-telemetry.md +2 -8
  53. package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +5 -0
  54. package/dist/template/docs/migrations/2026-11-25-device-favorites.sql +53 -0
  55. package/dist/template/docs/migrations/2026-11-25-download-on-postpone.sql +5 -0
  56. package/dist/template/docs/migrations/2026-11-25-public-distribution-history.sql +283 -0
  57. package/dist/template/docs/migrations/schema.sql +349 -0
  58. package/dist/template/docs/npm-installer.md +3 -3
  59. package/dist/template/docs/operations-guide.md +8 -6
  60. package/dist/template/docs/ota-client-lifecycle.md +30 -68
  61. package/dist/template/docs/ota-update-policy.md +9 -20
  62. package/dist/template/docs/ru/admin-ui.md +7 -3
  63. package/dist/template/docs/ru/device-targeting.md +2 -2
  64. package/dist/template/docs/ru/doctor.md +2 -2
  65. package/dist/template/docs/ru/expo-app-setup.md +9 -9
  66. package/dist/template/docs/ru/getting-started.md +3 -3
  67. package/dist/template/docs/ru/installation-telemetry.md +2 -2
  68. package/dist/template/docs/ru/npm-installer.md +3 -3
  69. package/dist/template/docs/ru/operations-guide.md +8 -3
  70. package/dist/template/docs/ru/ota-client-lifecycle.md +30 -35
  71. package/dist/template/docs/ru/ota-update-policy.md +9 -7
  72. package/dist/template/docs/ru/publishing-npm-installer.md +2 -2
  73. package/dist/template/docs/uk/admin-ui.md +7 -3
  74. package/dist/template/docs/uk/device-targeting.md +2 -2
  75. package/dist/template/docs/uk/doctor.md +2 -2
  76. package/dist/template/docs/uk/expo-app-setup.md +9 -9
  77. package/dist/template/docs/uk/getting-started.md +3 -3
  78. package/dist/template/docs/uk/installation-telemetry.md +2 -2
  79. package/dist/template/docs/uk/npm-installer.md +3 -3
  80. package/dist/template/docs/uk/operations-guide.md +8 -3
  81. package/dist/template/docs/uk/ota-client-lifecycle.md +30 -35
  82. package/dist/template/docs/uk/ota-update-policy.md +9 -7
  83. package/dist/template/docs/uk/publishing-npm-installer.md +2 -2
  84. package/dist/template/lib/audience-ids.ts +4 -0
  85. package/dist/template/package-lock.json +46 -0
  86. package/dist/template/package.json +3 -1
  87. package/dist/template/scripts/configure-expo-app.mjs +3 -3
  88. package/dist/template/scripts/create-access-token.mjs +1 -1
  89. package/dist/template/scripts/lib/doctor.mjs +10 -7
  90. package/dist/template/scripts/lib/doctor.test.mjs +7 -5
  91. package/dist/template/scripts/lib/embedded-update-registrar.test.ts +22 -7
  92. package/dist/template/scripts/lib/expo-app-configurator.mjs +25 -22
  93. package/dist/template/scripts/lib/expo-app-configurator.test.ts +37 -2
  94. package/dist/template/scripts/lib/ota-client-configurator.mjs +152 -55
  95. package/dist/template/scripts/lib/ota-client-configurator.test.ts +60 -20
  96. package/dist/template/scripts/lib/ota-client-package.mjs +25 -0
  97. package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +90 -32
  98. package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +49 -6
  99. package/dist/template/scripts/tests/device-analytics-migrations.mjs +12 -1
  100. package/dist/template/scripts/tests/device-targeting-activation.mjs +2 -3
  101. package/dist/template/scripts/tests/e2e/client-lifecycle.mjs +161 -0
  102. package/dist/template/scripts/tests/e2e/client-lifecycle.scenario.jsx +465 -0
  103. package/dist/template/scripts/tests/e2e/client-vitest.mts +18 -0
  104. package/dist/template/scripts/tests/e2e/console.mjs +86 -0
  105. package/dist/template/scripts/tests/e2e/delivery.mjs +296 -0
  106. package/dist/template/scripts/tests/e2e/device-favorites.mjs +309 -0
  107. package/dist/template/scripts/tests/e2e/installations.mjs +132 -0
  108. package/dist/template/scripts/tests/e2e/policy.mjs +253 -0
  109. package/dist/template/scripts/tests/e2e/registrar-token.mjs +59 -0
  110. package/dist/template/scripts/tests/e2e/release-matrix.mjs +303 -0
  111. package/dist/template/scripts/tests/e2e/releases.mjs +162 -0
  112. package/dist/template/scripts/tests/e2e/run.mjs +224 -0
  113. package/dist/template/scripts/tests/manifest-identity.sql +7 -5
  114. package/dist/template/scripts/tests/public-distribution-history.mjs +102 -0
  115. package/dist/template/src/client/admin-api.ts +45 -10
  116. package/dist/template/src/client/admin-types.ts +35 -1
  117. package/dist/template/src/client/devices/analytics.tsx +168 -231
  118. package/dist/template/src/client/devices/cohorts.tsx +181 -0
  119. package/dist/template/src/client/devices/device-name.tsx +37 -23
  120. package/dist/template/src/client/devices/favorite-targets.tsx +381 -0
  121. package/dist/template/src/client/devices/registry.tsx +258 -245
  122. package/dist/template/src/client/devices/use-devices-report.test.tsx +98 -0
  123. package/dist/template/src/client/devices/use-devices-report.ts +53 -82
  124. package/dist/template/src/client/devices/version-adoption-chart.tsx +47 -49
  125. package/dist/template/src/client/distribution-control.tsx +89 -57
  126. package/dist/template/src/client/distribution-history.tsx +353 -0
  127. package/dist/template/src/client/guard-action-catalog.tsx +183 -0
  128. package/dist/template/src/client/guard-action-combobox.test.ts +16 -22
  129. package/dist/template/src/client/guard-action-combobox.tsx +133 -239
  130. package/dist/template/src/client/guard-action-options.ts +4 -6
  131. package/dist/template/src/client/i18n/en.json +133 -2
  132. package/dist/template/src/client/i18n/language-switching.test.tsx +12 -3
  133. package/dist/template/src/client/i18n/ru.json +133 -2
  134. package/dist/template/src/client/i18n/uk.json +133 -2
  135. package/dist/template/src/client/logout-button.tsx +3 -3
  136. package/dist/template/src/client/policy-draft.ts +138 -0
  137. package/dist/template/src/client/update-audience-editor.tsx +597 -206
  138. package/dist/template/src/client/update-policy-editor.test.ts +101 -29
  139. package/dist/template/src/client/update-policy-editor.tsx +454 -320
  140. package/dist/template/src/client/use-filtered-results.ts +55 -0
  141. package/dist/template/src/server/controllers/manifest.test.ts +25 -3
  142. package/dist/template/src/server/controllers/manifest.ts +1 -2
  143. package/dist/template/src/server/devices/audience.ts +9 -5
  144. package/dist/template/src/server/lib/admin-audience-activation.test.ts +37 -90
  145. package/dist/template/src/server/lib/admin-release-history.test.ts +138 -0
  146. package/dist/template/src/server/lib/admin-updates.ts +160 -534
  147. package/dist/template/src/server/lib/distribution-history.ts +97 -0
  148. package/dist/template/src/server/lib/supabase.js +24 -0
  149. package/dist/template/src/server/lib/supabase.test.ts +38 -1
  150. package/dist/template/src/server/lib/update-policy.test.ts +20 -0
  151. package/dist/template/src/server/lib/update-policy.ts +23 -10
  152. package/dist/template/src/server/manifest/manifest-repository.ts +2 -2
  153. package/dist/template/src/server/manifest/manifest-values.test.ts +2 -0
  154. package/dist/template/src/server/manifest/manifest-values.ts +21 -13
  155. package/dist/template/templates/expo-app/scripts/ota-publish/api/database-client.mjs +7 -30
  156. package/dist/template/templates/expo-app/scripts/ota-register-embedded/index.mjs +2 -1
  157. package/dist/template/tsconfig.json +2 -2
  158. package/dist/template-manifest.json +445 -300
  159. package/package.json +1 -1
  160. package/dist/template/scripts/lib/device-identity.test.ts +0 -29
  161. package/dist/template/scripts/lib/ota-client.test.ts +0 -55
  162. package/dist/template/scripts/lib/ota-update-controller.test.ts +0 -232
  163. package/dist/template/scripts/lib/ota-updates-ui.test.tsx +0 -154
  164. package/dist/template/scripts/tests/ota-client-types.mjs +0 -69
  165. package/dist/template/templates/expo-app/ota-client/README.md +0 -73
  166. package/dist/template/templates/expo-app/ota-client/controller.ts +0 -107
  167. package/dist/template/templates/expo-app/ota-client/device-identity.ts +0 -48
  168. package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +0 -61
  169. package/dist/template/templates/expo-app/ota-client/index.ts +0 -16
  170. package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.ts +0 -97
  171. package/dist/template/templates/expo-app/ota-client/model/update-controller.ts +0 -293
  172. package/dist/template/templates/expo-app/ota-client/runtime.ts +0 -153
  173. package/dist/template/templates/expo-app/ota-client/types.ts +0 -85
  174. package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.tsx +0 -25
  175. package/dist/template/templates/expo-app/ota-client/ui/ota-updates.tsx +0 -196
@@ -0,0 +1,248 @@
1
+ "use client";
2
+
3
+ import { useMemo } from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+ import { cn } from "@/lib/utils";
6
+
7
+ import { Label } from "@/components/ui/label";
8
+ import { Separator } from "@/components/ui/separator";
9
+
10
+ function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
11
+ return (
12
+ <fieldset
13
+ data-slot="field-set"
14
+ className={cn(
15
+ "flex flex-col gap-6",
16
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ function FieldLegend({
25
+ className,
26
+ variant = "legend",
27
+ ...props
28
+ }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
29
+ return (
30
+ <legend
31
+ data-slot="field-legend"
32
+ data-variant={variant}
33
+ className={cn(
34
+ "mb-3 font-medium",
35
+ "data-[variant=legend]:text-base",
36
+ "data-[variant=label]:text-sm",
37
+ className,
38
+ )}
39
+ {...props}
40
+ />
41
+ );
42
+ }
43
+
44
+ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
45
+ return (
46
+ <div
47
+ data-slot="field-group"
48
+ className={cn(
49
+ "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
50
+ className,
51
+ )}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ const fieldVariants = cva(
58
+ "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
59
+ {
60
+ variants: {
61
+ orientation: {
62
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
63
+ horizontal: [
64
+ "flex-row items-center",
65
+ "[&>[data-slot=field-label]]:flex-auto",
66
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
67
+ ],
68
+ responsive: [
69
+ "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
70
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
71
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
72
+ ],
73
+ },
74
+ },
75
+ defaultVariants: {
76
+ orientation: "vertical",
77
+ },
78
+ },
79
+ );
80
+
81
+ function Field({
82
+ className,
83
+ orientation = "vertical",
84
+ ...props
85
+ }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
86
+ return (
87
+ <div
88
+ role="group"
89
+ data-slot="field"
90
+ data-orientation={orientation}
91
+ className={cn(fieldVariants({ orientation }), className)}
92
+ {...props}
93
+ />
94
+ );
95
+ }
96
+
97
+ function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
98
+ return (
99
+ <div
100
+ data-slot="field-content"
101
+ className={cn(
102
+ "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
103
+ className,
104
+ )}
105
+ {...props}
106
+ />
107
+ );
108
+ }
109
+
110
+ function FieldLabel({
111
+ className,
112
+ ...props
113
+ }: React.ComponentProps<typeof Label>) {
114
+ return (
115
+ <Label
116
+ data-slot="field-label"
117
+ className={cn(
118
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
119
+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
120
+ "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",
121
+ className,
122
+ )}
123
+ {...props}
124
+ />
125
+ );
126
+ }
127
+
128
+ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
129
+ return (
130
+ <div
131
+ data-slot="field-label"
132
+ className={cn(
133
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
134
+ className,
135
+ )}
136
+ {...props}
137
+ />
138
+ );
139
+ }
140
+
141
+ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
142
+ return (
143
+ <p
144
+ data-slot="field-description"
145
+ className={cn(
146
+ "text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
147
+ "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
148
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
149
+ className,
150
+ )}
151
+ {...props}
152
+ />
153
+ );
154
+ }
155
+
156
+ function FieldSeparator({
157
+ children,
158
+ className,
159
+ ...props
160
+ }: React.ComponentProps<"div"> & {
161
+ children?: React.ReactNode;
162
+ }) {
163
+ return (
164
+ <div
165
+ data-slot="field-separator"
166
+ data-content={!!children}
167
+ className={cn(
168
+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
169
+ className,
170
+ )}
171
+ {...props}
172
+ >
173
+ <Separator className="absolute inset-0 top-1/2" />
174
+ {children && (
175
+ <span
176
+ className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"
177
+ data-slot="field-separator-content"
178
+ >
179
+ {children}
180
+ </span>
181
+ )}
182
+ </div>
183
+ );
184
+ }
185
+
186
+ function FieldError({
187
+ className,
188
+ children,
189
+ errors,
190
+ ...props
191
+ }: React.ComponentProps<"div"> & {
192
+ errors?: Array<{ message?: string } | undefined>;
193
+ }) {
194
+ const content = useMemo(() => {
195
+ if (children) {
196
+ return children;
197
+ }
198
+
199
+ if (!errors?.length) {
200
+ return null;
201
+ }
202
+
203
+ const uniqueErrors = [
204
+ ...new Map(errors.map((error) => [error?.message, error])).values(),
205
+ ];
206
+
207
+ if (uniqueErrors?.length == 1) {
208
+ return uniqueErrors[0]?.message;
209
+ }
210
+
211
+ return (
212
+ <ul className="ml-4 flex list-disc flex-col gap-1">
213
+ {uniqueErrors.map(
214
+ (error, index) =>
215
+ error?.message && <li key={index}>{error.message}</li>,
216
+ )}
217
+ </ul>
218
+ );
219
+ }, [children, errors]);
220
+
221
+ if (!content) {
222
+ return null;
223
+ }
224
+
225
+ return (
226
+ <div
227
+ role="alert"
228
+ data-slot="field-error"
229
+ className={cn("text-sm font-normal text-destructive", className)}
230
+ {...props}
231
+ >
232
+ {content}
233
+ </div>
234
+ );
235
+ }
236
+
237
+ export {
238
+ Field,
239
+ FieldLabel,
240
+ FieldDescription,
241
+ FieldError,
242
+ FieldGroup,
243
+ FieldLegend,
244
+ FieldSeparator,
245
+ FieldSet,
246
+ FieldContent,
247
+ FieldTitle,
248
+ };
@@ -0,0 +1,170 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
+ import { cn } from "@/lib/utils";
6
+
7
+ import { Button } from "@/components/ui/button";
8
+ import { Input } from "@/components/ui/input";
9
+ import { Textarea } from "@/components/ui/textarea";
10
+
11
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
12
+ return (
13
+ <div
14
+ data-slot="input-group"
15
+ role="group"
16
+ className={cn(
17
+ "group/input-group relative flex w-full items-center rounded-md border border-input bg-card transition-[color,box-shadow] outline-none",
18
+ "h-9 min-w-0 has-[>textarea]:h-auto",
19
+
20
+ // Variants based on alignment.
21
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
22
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
23
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
24
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
25
+
26
+ // Focus state.
27
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
28
+
29
+ // Error state.
30
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
31
+
32
+ className,
33
+ )}
34
+ {...props}
35
+ />
36
+ );
37
+ }
38
+
39
+ const inputGroupAddonVariants = cva(
40
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
41
+ {
42
+ variants: {
43
+ align: {
44
+ "inline-start":
45
+ "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
46
+ "inline-end":
47
+ "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
48
+ "block-start":
49
+ "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
50
+ "block-end":
51
+ "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
52
+ },
53
+ },
54
+ defaultVariants: {
55
+ align: "inline-start",
56
+ },
57
+ },
58
+ );
59
+
60
+ function InputGroupAddon({
61
+ className,
62
+ align = "inline-start",
63
+ ...props
64
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
65
+ return (
66
+ <div
67
+ role="group"
68
+ data-slot="input-group-addon"
69
+ data-align={align}
70
+ className={cn(inputGroupAddonVariants({ align }), className)}
71
+ onClick={(e) => {
72
+ if ((e.target as HTMLElement).closest("button")) {
73
+ return;
74
+ }
75
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
76
+ }}
77
+ {...props}
78
+ />
79
+ );
80
+ }
81
+
82
+ const inputGroupButtonVariants = cva(
83
+ "flex items-center gap-2 text-sm shadow-none",
84
+ {
85
+ variants: {
86
+ size: {
87
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
88
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
89
+ "icon-xs":
90
+ "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
91
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
92
+ },
93
+ },
94
+ defaultVariants: {
95
+ size: "xs",
96
+ },
97
+ },
98
+ );
99
+
100
+ function InputGroupButton({
101
+ className,
102
+ type = "button",
103
+ variant = "ghost",
104
+ size = "xs",
105
+ ...props
106
+ }: Omit<React.ComponentProps<typeof Button>, "size"> &
107
+ VariantProps<typeof inputGroupButtonVariants>) {
108
+ return (
109
+ <Button
110
+ type={type}
111
+ data-size={size}
112
+ variant={variant}
113
+ className={cn(inputGroupButtonVariants({ size }), className)}
114
+ {...props}
115
+ />
116
+ );
117
+ }
118
+
119
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
120
+ return (
121
+ <span
122
+ className={cn(
123
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
124
+ className,
125
+ )}
126
+ {...props}
127
+ />
128
+ );
129
+ }
130
+
131
+ function InputGroupInput({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<"input">) {
135
+ return (
136
+ <Input
137
+ data-slot="input-group-control"
138
+ className={cn(
139
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
140
+ className,
141
+ )}
142
+ {...props}
143
+ />
144
+ );
145
+ }
146
+
147
+ function InputGroupTextarea({
148
+ className,
149
+ ...props
150
+ }: React.ComponentProps<"textarea">) {
151
+ return (
152
+ <Textarea
153
+ data-slot="input-group-control"
154
+ className={cn(
155
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
156
+ className,
157
+ )}
158
+ {...props}
159
+ />
160
+ );
161
+ }
162
+
163
+ export {
164
+ InputGroup,
165
+ InputGroupAddon,
166
+ InputGroupButton,
167
+ InputGroupText,
168
+ InputGroupInput,
169
+ InputGroupTextarea,
170
+ };
@@ -7,7 +7,7 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
7
7
  type={type}
8
8
  data-slot="input"
9
9
  className={cn(
10
- "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
10
+ "h-9 w-full min-w-0 rounded-md border border-input bg-card px-3 py-1 text-base transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
11
11
  "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
12
12
  "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
13
13
  className,
@@ -16,7 +16,7 @@ function NativeSelect({
16
16
  data-slot="native-select"
17
17
  data-size={size}
18
18
  className={cn(
19
- "h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 dark:bg-input/30 dark:hover:bg-input/50",
19
+ "h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-card px-3 py-2 pr-9 text-sm transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1 hover:border-muted-foreground hover:bg-muted",
20
20
  "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
21
21
  "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
22
22
  className,
@@ -0,0 +1,41 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { CircleIcon } from "lucide-react";
5
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function RadioGroup({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
12
+ return (
13
+ <RadioGroupPrimitive.Root
14
+ data-slot="radio-group"
15
+ className={cn("grid gap-3", className)}
16
+ {...props}
17
+ />
18
+ );
19
+ }
20
+
21
+ function RadioGroupItem({
22
+ className,
23
+ ...props
24
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
25
+ return (
26
+ <RadioGroupPrimitive.Item
27
+ data-slot="radio-group-item"
28
+ className={cn(
29
+ "aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",
30
+ className,
31
+ )}
32
+ {...props}
33
+ >
34
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
35
+ <CircleIcon className="size-2 fill-current" />
36
+ </RadioGroupPrimitive.Indicator>
37
+ </RadioGroupPrimitive.Item>
38
+ );
39
+ }
40
+
41
+ export { RadioGroup, RadioGroupItem };
@@ -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-transparent px-3 py-2 text-base shadow-xs 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:bg-input/30 dark:aria-invalid:ring-destructive/40",
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}
@@ -4,14 +4,18 @@ The admin panel uses a shared shadcn/ui (Radix) UI kit, Tailwind CSS 4, Lucide a
4
4
 
5
5
  ## Navigation and data {#навигация-и-данные}
6
6
 
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.
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
9
  - **Embedded builds** and **Emergency redirects** retain the existing role restrictions and management actions.
10
10
 
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.
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
+ 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
+
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
+
15
19
  ## Interface verification {#проверка-интерфеиса}
16
20
 
17
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.
@@ -80,12 +80,7 @@ repeatable and do not change the audience or active state of existing releases.
80
80
  The targeting migration removes the single-active-release index because a targeted
81
81
  release must coexist with its public fallback. Existing releases have audience `all`.
82
82
 
83
- Activation, rollback and promotion of a targeted release preserve other active releases.
84
- Normal public activation keeps the previous behavior of disabling older releases.
85
- Widening an already-active targeted release leaves the prior public fallback eligible;
86
- the newer release wins selection. Disabling the targeted release restores fallback selection.
87
- Explicit rollback has priority, subject to the same audience and compatibility checks.
88
- 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.
89
84
 
90
85
  Admin API:
91
86
 
@@ -116,7 +111,7 @@ CAS, global block and reinstall tests. Fixtures are rolled back. Device reinstal
116
111
  behavior additionally requires physical-device testing with the native build.
117
112
 
118
113
  Activation and audience changes are serialized in PostgreSQL. Public activation disables
119
- other active releases in the same scope within the same statement; a failed activation
114
+ the previous public release in the same scope within the same statement; a failed activation
120
115
  cannot partially disable the previous public release. This also covers the existing
121
116
  `update-meta.json` editor. Targeted activation preserves other audiences. During a global
122
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, installed client dependencies, implementation files, URL/channel/runtime, native check mode, identity namespace and telemetry URL |
79
- | Root | Recognized root hook/gate wiring and generated bootstrap metadata; custom roots need manual verification |
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 command patches `app.json` and `package.json`, copies the public
32
- certificate, installs `expo-updates` and the identity/telemetry dependencies, adds the portable publisher and runs
33
- `expo prebuild`. It supports npm, pnpm, Yarn and Bun lockfiles.
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 files, dependencies, root wiring and controls. `--force` permits generated
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/` | Public API, nested model/UI files and public `config.json` |
117
- | Root `_layout` / `App` | One unconditional hook and a gate; existing navigation/providers retained |
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
- Before building, add the
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 the generated `<OtaUpdates />` component beside navigation in the root
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.