create-expo-updates-server 0.1.3 → 0.1.5
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/dist/template/.env.docker.example +1 -0
- package/dist/template/.env.example +2 -0
- package/dist/template/README.md +16 -8
- package/dist/template/app/api/admin/distribution-control/route.test.ts +153 -0
- package/dist/template/app/api/admin/distribution-control/route.ts +111 -0
- package/dist/template/app/api/admin/embedded-updates/route.test.ts +36 -1
- package/dist/template/app/api/admin/guard-actions/[id]/route.test.ts +60 -0
- package/dist/template/app/api/admin/guard-actions/[id]/route.ts +32 -0
- package/dist/template/app/api/admin/guard-actions/route.test.ts +123 -0
- package/dist/template/app/api/admin/guard-actions/route.ts +66 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/deactivate/route.ts +4 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/policy/route.test.ts +171 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/policy/route.ts +75 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/promote/route.ts +4 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/rollback/route.ts +4 -1
- package/dist/template/app/api/admin/updates/[encodedKey]/route.ts +4 -1
- package/dist/template/app/api/admin/updates/route.test.ts +29 -1
- package/dist/template/app/updates/[encodedKey]/page.tsx +74 -6
- package/dist/template/app/updates/embedded/page.tsx +6 -2
- package/dist/template/app/updates/page.tsx +28 -3
- package/dist/template/docs/expo-app-setup.md +14 -3
- package/dist/template/docs/getting-started.md +13 -7
- package/dist/template/docs/getting-started.ru.md +15 -7
- package/dist/template/docs/migrations/2026-09-01-app-version-columns.sql +23 -0
- package/dist/template/docs/migrations/2026-09-01-ota-update-policy.sql +108 -0
- package/dist/template/docs/migrations/2026-09-01-p1-guard-actions.sql +19 -0
- package/dist/template/docs/migrations/2026-09-01-p2-simplify-ota-guard-policy.sql +69 -0
- package/dist/template/docs/migrations/2026-09-01-policy-publication-correction.sql +44 -0
- package/dist/template/docs/migrations/2026-09-02-ota-distribution-control.sql +377 -0
- package/dist/template/docs/migrations/schema.sql +561 -2
- package/dist/template/docs/operations-guide.md +52 -1
- package/dist/template/docs/ota-emergency-recovery.md +22 -0
- package/dist/template/docs/ota-update-policy.md +89 -0
- package/dist/template/docs/supabase-setup.md +2 -1
- package/dist/template/package-lock.json +2 -2
- package/dist/template/package.json +1 -1
- package/dist/template/scripts/configure-expo-app.mjs +6 -0
- package/dist/template/scripts/lib/embedded-update-registrar.test.ts +383 -3
- package/dist/template/scripts/lib/expo-app-configurator.mjs +165 -9
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +658 -9
- package/dist/template/src/client/admin-api.ts +80 -1
- package/dist/template/src/client/admin-types.ts +52 -2
- package/dist/template/src/client/distribution-control.tsx +231 -0
- package/dist/template/src/client/guard-action-combobox.test.ts +26 -0
- package/dist/template/src/client/guard-action-combobox.tsx +267 -0
- package/dist/template/src/client/guard-action-options.test.ts +62 -0
- package/dist/template/src/client/guard-action-options.ts +70 -0
- package/dist/template/src/client/update-policy-editor.test.ts +36 -0
- package/dist/template/src/client/update-policy-editor.tsx +436 -0
- package/dist/template/src/server/controllers/assets.test.ts +87 -0
- package/dist/template/src/server/controllers/assets.ts +26 -0
- package/dist/template/src/server/controllers/manifest.test.ts +413 -2
- package/dist/template/src/server/controllers/manifest.ts +103 -38
- package/dist/template/src/server/lib/admin-distribution-guard.test.ts +61 -0
- package/dist/template/src/server/lib/admin-embedded-updates.test.ts +57 -0
- package/dist/template/src/server/lib/admin-embedded-updates.ts +42 -25
- package/dist/template/src/server/lib/admin-update-policy.test.ts +176 -0
- package/dist/template/src/server/lib/admin-updates.test.ts +133 -0
- package/dist/template/src/server/lib/admin-updates.ts +174 -9
- package/dist/template/src/server/lib/distribution-control-migration.test.ts +94 -0
- package/dist/template/src/server/lib/distribution-control.test.ts +160 -0
- package/dist/template/src/server/lib/distribution-control.ts +250 -0
- package/dist/template/src/server/lib/guard-actions-migration.test.ts +56 -0
- package/dist/template/src/server/lib/guard-actions.test.ts +142 -0
- package/dist/template/src/server/lib/guard-actions.ts +106 -0
- package/dist/template/src/server/lib/ota-policy-migrations.test.ts +64 -0
- package/dist/template/src/server/lib/simple-policy-migration.test.ts +97 -0
- package/dist/template/src/server/lib/supabase.js +95 -8
- package/dist/template/src/server/lib/supabase.test.ts +194 -0
- package/dist/template/src/server/lib/update-policy.test.ts +98 -0
- package/dist/template/src/server/lib/update-policy.ts +171 -0
- package/dist/template/src/server/manifest/manifest-repository.ts +10 -1
- package/dist/template/src/server/manifest/manifest-response.ts +0 -16
- package/dist/template/src/server/manifest/manifest-values.test.ts +54 -0
- package/dist/template/src/server/manifest/manifest-values.ts +145 -0
- package/dist/template/templates/expo-app/ci_scripts/ci_post_xcodebuild.sh +23 -1
- package/dist/template/templates/expo-app/plugins/with-ota-embedded-registration.js +13 -4
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/index.mjs +53 -7
- package/dist/template/templates/expo-app/scripts/ota-register-embedded/register-ios.sh +87 -0
- package/dist/template/tsconfig.json +4 -1
- package/dist/template-manifest.json +283 -88
- package/package.json +1 -1
- package/dist/template/templates/expo-app/ci_scripts/register-embedded-update.sh +0 -36
- /package/dist/template/templates/expo-app/scripts/ota-register-embedded/{android-register-embedded-update.sh → register-android.sh} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -eu
|
|
4
|
+
|
|
5
|
+
if [ "${CONFIGURATION:-Release}" = "Debug" ]; then
|
|
6
|
+
exit 0
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
fail_registration() {
|
|
10
|
+
echo "Embedded update registration failed: $1" >&2
|
|
11
|
+
if [ "${OTA_EMBEDDED_REGISTER_STRICT:-false}" = "true" ]; then
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
exit 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname "$0")" && pwd)" ||
|
|
18
|
+
fail_registration "unable to resolve the registration script directory."
|
|
19
|
+
PROJECT_ROOT="$(CDPATH= cd -- "$SCRIPT_DIR/../.." && pwd)" ||
|
|
20
|
+
fail_registration "unable to resolve the Expo project root."
|
|
21
|
+
REGISTRAR_PATH="$PROJECT_ROOT/scripts/ota-register-embedded/index.mjs"
|
|
22
|
+
MANIFEST_PATH=""
|
|
23
|
+
NODE_EXECUTABLE=""
|
|
24
|
+
|
|
25
|
+
if [ -f "$PROJECT_ROOT/ios/.xcode.env" ]; then
|
|
26
|
+
set +u
|
|
27
|
+
. "$PROJECT_ROOT/ios/.xcode.env"
|
|
28
|
+
set -u
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [ -f "$PROJECT_ROOT/ios/.xcode.env.local" ]; then
|
|
32
|
+
set +u
|
|
33
|
+
. "$PROJECT_ROOT/ios/.xcode.env.local"
|
|
34
|
+
set -u
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
if [ -n "${NODE_BINARY:-}" ] && [ -x "$NODE_BINARY" ]; then
|
|
38
|
+
NODE_EXECUTABLE="$NODE_BINARY"
|
|
39
|
+
else
|
|
40
|
+
NODE_FROM_PATH="$(command -v node 2>/dev/null || true)"
|
|
41
|
+
if [ -n "$NODE_FROM_PATH" ] && [ -x "$NODE_FROM_PATH" ]; then
|
|
42
|
+
NODE_EXECUTABLE="$NODE_FROM_PATH"
|
|
43
|
+
elif [ -x "/opt/homebrew/bin/node" ]; then
|
|
44
|
+
NODE_EXECUTABLE="/opt/homebrew/bin/node"
|
|
45
|
+
elif [ -x "/usr/local/bin/node" ]; then
|
|
46
|
+
NODE_EXECUTABLE="/usr/local/bin/node"
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
if [ -z "$NODE_EXECUTABLE" ]; then
|
|
51
|
+
fail_registration "Node.js executable was not found. Set NODE_BINARY to an absolute executable path in $PROJECT_ROOT/ios/.xcode.env.local (for example: export NODE_BINARY=/absolute/path/to/node)."
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
if [ ! -f "$REGISTRAR_PATH" ]; then
|
|
55
|
+
fail_registration "registrar was not found at $REGISTRAR_PATH."
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
if [ -n "${TARGET_BUILD_DIR:-}" ] &&
|
|
59
|
+
[ -n "${UNLOCALIZED_RESOURCES_FOLDER_PATH:-}" ] &&
|
|
60
|
+
[ -f "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/app.manifest" ]; then
|
|
61
|
+
MANIFEST_PATH="$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/app.manifest"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
if [ -z "$MANIFEST_PATH" ] && [ -n "${CI_ARCHIVE_PATH:-}" ]; then
|
|
65
|
+
for candidate in "$CI_ARCHIVE_PATH"/Products/Applications/*.app/app.manifest; do
|
|
66
|
+
if [ -f "$candidate" ]; then
|
|
67
|
+
MANIFEST_PATH="$candidate"
|
|
68
|
+
break
|
|
69
|
+
fi
|
|
70
|
+
done
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
if [ -z "$MANIFEST_PATH" ] && [ -n "${TARGET_BUILD_DIR:-}" ]; then
|
|
74
|
+
MANIFEST_PATH="$(find "$TARGET_BUILD_DIR" -type f -name app.manifest 2>/dev/null | head -n 1 || true)"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
if [ -z "$MANIFEST_PATH" ]; then
|
|
78
|
+
fail_registration "iOS app.manifest was not found."
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if ! "$NODE_EXECUTABLE" "$REGISTRAR_PATH" \
|
|
82
|
+
--manifest "$MANIFEST_PATH" \
|
|
83
|
+
--platform ios; then
|
|
84
|
+
if [ "${OTA_EMBEDDED_REGISTER_STRICT:-false}" = "true" ]; then
|
|
85
|
+
exit 1
|
|
86
|
+
fi
|
|
87
|
+
fi
|