create-disposabl-app 0.20.24 → 0.21.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/dist/disposabl.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // ../cli/auth.ts
4
4
  import { lock } from "proper-lockfile";
5
5
  // ../cli/package.json
6
- var version = "0.20.24";
6
+ var version = "0.21.0";
7
7
  var package_default = {
8
8
  name: "@disposabl/cli",
9
9
  version,
@@ -799,6 +799,10 @@ async function configureDevelopment(directory, value) {
799
799
  throw new Error("Development URLs do not match the deployment.");
800
800
  if (value.productionConvexSiteUrl && !/^https:\/\/[a-z0-9-]+\.convex\.site$/.test(value.productionConvexSiteUrl))
801
801
  throw new Error("Unexpected production Convex site URL.");
802
+ for (const url of [value.publicSiteUrl, value.productionSiteUrl]) {
803
+ if (url !== undefined && !/^https:\/\/[a-z0-9]+(?:[a-z0-9-]*[a-z0-9])?\.disposabl\.xyz$/.test(url))
804
+ throw new Error("Unexpected public site URL.");
805
+ }
802
806
  if (config.features?.includes("analytics") && !value.analytics)
803
807
  throw new Error("Analytics setup is incomplete. Connect PostHog and retry app setup.");
804
808
  if (value.analytics && (!Number.isSafeInteger(value.analytics.projectId) || !value.analytics.projectToken.startsWith("phc_") || !["https://us.i.posthog.com", "https://eu.i.posthog.com"].includes(value.analytics.host)))
@@ -837,7 +841,9 @@ async function configureDevelopment(directory, value) {
837
841
  if (ignored.status !== 0 || tracked.status !== 1)
838
842
  throw new Error(`${file} must be untracked and ignored by Git.`);
839
843
  }
840
- if (value.productionConvexSiteUrl || value.analytics || config.analytics) {
844
+ if (value.productionConvexSiteUrl || value.productionSiteUrl || value.analytics || config.analytics) {
845
+ if (value.productionSiteUrl)
846
+ config.productionSiteUrl = value.productionSiteUrl;
841
847
  if (value.productionConvexSiteUrl)
842
848
  config.productionConvexSiteUrl = value.productionConvexSiteUrl;
843
849
  if (config.features?.includes("analytics"))
@@ -856,16 +862,17 @@ async function configureDevelopment(directory, value) {
856
862
  await updateEnv(join4(root, files[0]), {
857
863
  CONVEX_DEPLOY_KEY: value.deployKey,
858
864
  CONVEX_URL: value.convexUrl,
859
- CONVEX_SITE_URL: value.convexSiteUrl
860
- }, ["CONVEX_DEPLOYMENT"]);
865
+ CONVEX_SITE_URL: value.convexSiteUrl,
866
+ ...value.publicSiteUrl ? { PUBLIC_SITE_URL: value.publicSiteUrl } : {}
867
+ }, ["CONVEX_DEPLOYMENT", "PUBLIC_SITE_URL"]);
861
868
  await updateEnv(join4(root, files[1]), {
862
869
  VITE_CONVEX_URL: value.convexUrl,
863
- VITE_CONVEX_SITE_URL: value.convexSiteUrl
870
+ VITE_CONVEX_SITE_URL: value.publicSiteUrl ?? value.convexSiteUrl
864
871
  });
865
872
  if (files[2])
866
873
  await updateEnv(join4(root, files[2]), {
867
874
  EXPO_PUBLIC_CONVEX_URL: value.convexUrl,
868
- EXPO_PUBLIC_CONVEX_SITE_URL: value.convexSiteUrl
875
+ EXPO_PUBLIC_CONVEX_SITE_URL: value.publicSiteUrl ?? value.convexSiteUrl
869
876
  });
870
877
  }
871
878
  function formatPreview(preview) {
@@ -1005,7 +1012,12 @@ Waiting for connections. Press Ctrl+C to keep your files and finish later.`);
1005
1012
  console.log(JSON.stringify(await configureRepository(base, options.appId, value), null, 2));
1006
1013
  } else if (tokenCreate && options.configure) {
1007
1014
  await configureDevelopment(options.configure, value);
1008
- const { deployKey: _secret, ...details } = value;
1015
+ const {
1016
+ deployKey: _secret,
1017
+ convexSiteUrl: _provider,
1018
+ productionConvexSiteUrl: _productionProvider,
1019
+ ...details
1020
+ } = value;
1009
1021
  console.log(JSON.stringify({ ...details, configured: true }, null, 2));
1010
1022
  } else if (previewGet && !options.json)
1011
1023
  console.log(formatPreview(value));
package/dist/index.js CHANGED
@@ -1563,7 +1563,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
1563
1563
  import { Command, CommanderError } from "commander";
1564
1564
  import * as p2 from "@clack/prompts";
1565
1565
  // package.json
1566
- var version = "0.20.24";
1566
+ var version = "0.21.0";
1567
1567
 
1568
1568
  // ../cli/telemetry.ts
1569
1569
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
@@ -98,9 +98,9 @@ case "${1:?operation required}" in
98
98
  product_payments
99
99
  report building
100
100
  jq --arg channel "$CHANNEL" --arg number "$DISPOSABL_IOS_BUILD_NUMBER" \
101
- --arg url "$CONVEX_URL" --arg site "$CONVEX_SITE_URL" \
101
+ --arg url "$CONVEX_URL" --arg site "$CONVEX_SITE_URL" --arg publicSite "$EXPO_PUBLIC_CONVEX_SITE_URL" \
102
102
  --arg project "$EXPO_PROJECT_ID" --arg owner "${EXPO_OWNER:-}" --arg slug "${EXPO_SLUG:-}" \
103
- '.build["ios-production"].env += {DISPOSABL_MOBILE_CHANNEL: $channel, DISPOSABL_IOS_BUILD_NUMBER: $number, CONVEX_URL: $url, CONVEX_SITE_URL: $site, EXPO_PUBLIC_CONVEX_URL: $url, EXPO_PUBLIC_CONVEX_SITE_URL: $site, EXPO_PROJECT_ID: $project, EXPO_OWNER: $owner, EXPO_SLUG: $slug}' eas.json > "$RUNNER_TEMP/eas-production.json"
103
+ '.build["ios-production"].env += {DISPOSABL_MOBILE_CHANNEL: $channel, DISPOSABL_IOS_BUILD_NUMBER: $number, CONVEX_URL: $url, CONVEX_SITE_URL: $site, PUBLIC_SITE_URL: $publicSite, EXPO_PUBLIC_CONVEX_URL: $url, EXPO_PUBLIC_CONVEX_SITE_URL: $publicSite, EXPO_PROJECT_ID: $project, EXPO_OWNER: $owner, EXPO_SLUG: $slug}' eas.json > "$RUNNER_TEMP/eas-production.json"
104
104
  mv "$RUNNER_TEMP/eas-production.json" eas.json
105
105
  if [[ -n "${ASC_APP_ID:-}" ]]; then
106
106
  jq --arg id "$ASC_APP_ID" '.submit["ios-production"].ios.ascAppId = $id' eas.json > "$RUNNER_TEMP/eas-submit.json"
@@ -67,6 +67,18 @@ if (config.appId) {
67
67
  const result = await call("/github/token", {});
68
68
  console.log(`::add-mask::${result.token}`);
69
69
  await appendFile(process.env.GITHUB_ENV, `GH_TOKEN=${result.token}\n`);
70
+ } else if (command === "site") {
71
+ const { url } = await call("/github/site", {
72
+ convexSiteUrl: process.env.CONVEX_SITE_URL,
73
+ });
74
+ if (
75
+ typeof url !== "string" ||
76
+ !/^https:\/\/[a-z0-9]+(?:[a-z0-9-]*[a-z0-9])?\.disposabl\.xyz$/.test(url)
77
+ )
78
+ throw new Error("Unexpected public site URL.");
79
+ await appendFile(process.env.GITHUB_ENV, `PUBLIC_SITE_URL=${url}\n`);
80
+ await appendFile(process.env.GITHUB_OUTPUT, `PUBLIC_SITE_URL=${url}\n`);
81
+ console.log(`Public site: ${url}`);
70
82
  } else if (command === "report") {
71
83
  for (const name of platform
72
84
  .split(",")
@@ -74,10 +74,11 @@ bun -e '
74
74
  // Web and mobile use the same backend from this deployment.
75
75
  const backend = /^(?:EXPO_PUBLIC_|VITE_)?(CONVEX_(?:URL|SITE_URL))$/.exec(key);
76
76
  if (backend) {
77
- if (value !== process.env[backend[1]]) throw new Error(`EAS overrides the deployed backend: ${key}`);
77
+ const expected = backend[1] === "CONVEX_SITE_URL" ? process.env.PUBLIC_SITE_URL || process.env.CONVEX_SITE_URL : process.env.CONVEX_URL;
78
+ if (![process.env[backend[1]], expected].includes(value)) throw new Error(`EAS overrides the deployed backend: ${key}`);
78
79
  continue;
79
80
  }
80
- if (/^(GITHUB_|RUNNER_|GH_|DISPOSABL_|ANDROID_|UPDATE_POLICY$|BUN_|CI$|NODE_OPTIONS$|PATH$|HOME$|SOURCE(_PATH)?$|CHANNEL$|PLATFORM$|RELEASE_PREFIX$|MACOS_|EAS_(ENVIRONMENT|CLI)$|EXPO_(TOKEN|PROJECT_ID|OWNER|SLUG|NO_DOTENV)$)/.test(key)) throw new Error(`Reserved EAS variable: ${key}`);
81
+ if (/^(GITHUB_|RUNNER_|GH_|DISPOSABL_|ANDROID_|UPDATE_POLICY$|PUBLIC_SITE_URL$|BUN_|CI$|NODE_OPTIONS$|PATH$|HOME$|SOURCE(_PATH)?$|CHANNEL$|PLATFORM$|RELEASE_PREFIX$|MACOS_|EAS_(ENVIRONMENT|CLI)$|EXPO_(TOKEN|PROJECT_ID|OWNER|SLUG|NO_DOTENV)$)/.test(key)) throw new Error(`Reserved EAS variable: ${key}`);
81
82
  if (key === "EXPO_PUBLIC_DISPOSABL_ANALYTICS_ENABLED") continue;
82
83
  effectiveEnv[key] = value;
83
84
  const delimiter = crypto.randomUUID();
@@ -1 +1 @@
1
- {name: Pipeline,"on": {pull_request: {branches: [main]},push: {branches: [main]}},permissions: {contents: read,pull-requests: read},concurrency: {group: "${{ github.workflow }}-${{ github.ref }}",cancel-in-progress: "${{ github.event_name == 'pull_request' }}"},env: {CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_MOBILE_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",EAS_ENVIRONMENT: "${{ github.event_name == 'push' && 'production' || 'preview' }}",EAS_CLI: eas-cli@27.2.0,BUN_VERSION: 1.4.4,NODE_VERSION: "24",LINUX_RUNNER: ubuntu-24.04,WEB_RUNNER: ubuntu-24.04,WINDOWS_RUNNER: windows-2025,MACOS_RUNNER: macos-26,RELEASE_PREFIX: app,DISPOSABL_ANDROID_VERSION_CODE: "${{ github.run_number }}",DISPOSABL_IOS_BUILD_NUMBER: "${{ github.run_number }}",GH_TOKEN: "${{ github.token }}",GH_REPO: "${{ github.repository }}",SOURCE: "${{ github.event.pull_request.head.sha || github.sha }}",SOURCE_PATH: "${{ github.event_name == 'pull_request' && format('pulls/{0}', github.event.number) || 'git/ref/heads/main' }}",DISPOSABL_RELEASE_VERSION: "1.0.${{ github.run_number }}"},jobs: {changes: {name: Select work,if: "github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository",permissions: {contents: read,pull-requests: read,actions: read},runs-on: ubuntu-24.04,timeout-minutes: 30,outputs: {linux_runner: "${{ steps.platforms.outputs.linux_runner }}",android_runner: "${{ steps.platforms.outputs.android_runner }}",macos_runner: "${{ steps.platforms.outputs.macos_runner }}",changed: "${{ steps.platforms.outputs.changed }}",android: "${{ steps.platforms.outputs.android }}",ios: "${{ steps.platforms.outputs.ios }}",desktop: "${{ steps.platforms.outputs.desktop }}",packages: "${{ steps.platforms.outputs.packages }}"},steps: [&item0 {uses: actions/checkout@v6,with: {ref: "${{ env.SOURCE }}",persist-credentials: false}},{name: Select affected platforms,shell: bash,id: platforms,env: {PR: "${{ github.event.number }}",EXPO_CONNECTED: "${{ secrets.EXPO_TOKEN != '' }}",IOS_BUILDS_ENABLED: "${{ vars.IOS_BUILDS_ENABLED != 'false' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/platforms.sh\""}]},web: {name: Web,needs: changes,if: "needs.changes.outputs.changed == 'true'",permissions: &permissions {contents: read,pull-requests: read,id-token: write},timeout-minutes: 20,runs-on: "${{ needs.changes.outputs.linux_runner }}",outputs: {desktop: "${{ needs.changes.outputs.desktop }}",ios: "${{ needs.changes.outputs.ios }}",packages: "${{ needs.changes.outputs.packages }}",release: "${{ steps.artifacts.outcome == 'success' }}",android_build: "${{ steps.fingerprint.outputs.build }}",android_runtime: "${{ steps.fingerprint.outputs.runtime }}",convex_url: "${{ steps.deploy.outputs.CONVEX_URL }}",convex_site_url: "${{ steps.deploy.outputs.CONVEX_SITE_URL }}"},env: {PLATFORM: android,DISPOSABL_ANDROID_SIGNING: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",ANDROID_KEYSTORE_BASE64: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",ANDROID_KEYSTORE_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",ANDROID_KEY_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",ANDROID_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}",ANDROID_PLAY_SUBMIT: "${{ vars.ANDROID_PLAY_SUBMIT }}",EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,&item1 {uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},&item2 {uses: oven-sh/setup-bun@v2,with: {bun-version: 1.4.4}},&item3 {uses: actions/cache@v4,with: {path: ~/.bun/install/cache,key: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }}",restore-keys: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-"}},&item4 {run: "bun install --frozen-lockfile ${{ github.job == 'desktop' && '--filter \"*desktop*\" --filter @disposabl/backend' || (github.job == 'android' || startsWith(github.job, 'ios-')) && '--filter @disposabl/mobile' || '' }}"},{name: Report build start,run: "node .github/scripts/disposabl.mjs report web,api,mcp building\nif [[ -z \"$EXPO_TOKEN\" ]]; then node .github/scripts/disposabl.mjs report android blocked 'Connect Expo before building Android.'; fi\nif [[ '${{ github.event_name }}' == pull_request ]]; then node .github/scripts/disposabl.mjs report cli,typescript-sdk blocked 'Packages publish after merge to main.'; fi\n"},{name: Check,run: bun run check},{name: Build selected clients,run: "for package in cli sdk; do\n if test -f \"packages/$package/package.json\"; then bun run --cwd \"packages/$package\" build; fi\ndone\n"},{name: Deploy,id: deploy,timeout-minutes: 10,env: {TRUSTED: "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}",CONVEX_DEPLOY_KEY: "${{ secrets[github.event_name == 'push' && 'CONVEX_DEPLOY_KEY' || 'CONVEX_DEPLOY_KEY_PREVIEW'] }}"},run: "if [[ \"$TRUSTED\" != true ]]; then VITE_CONVEX_URL=https://ci.invalid VITE_CONVEX_SITE_URL=https://ci.invalid bun run build --filter=@disposabl/web; exit; fi\n: \"${CONVEX_DEPLOY_KEY:?Configure the Convex deployment secret for this repository}\"\ncd packages/backend\nexport AUTH_TARGET=--prod\ntarget=()\nif [[ \"$CHANNEL\" != production ]]; then export AUTH_TARGET=\"--preview-name $CHANNEL\"; target=(--preview-name \"$CHANNEL\"); fi\nbun x --no-install convex deploy --yes \"${target[@]}\" --cmd-url-env-var-name CONVEX_URL --cmd 'for name in CONVEX_URL CONVEX_SITE_URL; do value=$(printenv \"$name\"); test -n \"$value\" || exit 1; for prefix in \"\" VITE_ EXPO_PUBLIC_; do export \"$prefix$name=$value\"; printf \"%s=%s\\n\" \"$prefix$name\" \"$value\" | tee -a \"$GITHUB_ENV\" >> \"$GITHUB_OUTPUT\"; done; done; bun run --cwd ../.. build --filter=@disposabl/web'\nsetup_target=(--prod)\nif [[ \"$CHANNEL\" != production ]]; then setup_target=(\"${target[@]}\"); fi\nbun x --no-install convex run \"${setup_target[@]}\" billing:setup '{}'\nbun x --no-install static-hosting upload $AUTH_TARGET --no-spa --dist ../../apps/web/dist/client\n"},{name: Report web result,if: always(),run: "node .github/scripts/disposabl.mjs report web,api,mcp ${{ steps.deploy.outcome == 'success' && 'ready' || 'failed' }}"},{name: Expo,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Channel,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Fingerprint,id: fingerprint,if: "needs.changes.outputs.android == 'true'",env: {},working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-fingerprint"},{name: Update,if: "steps.fingerprint.outputs.build == 'false'",env: {TAG: "${{ steps.fingerprint.outputs.tag }}",SHA: "${{ steps.fingerprint.outputs.sha }}",RUNTIME: "${{ steps.fingerprint.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-update"},&item5 {name: Publish,if: "github.job == 'android' || (github.job == 'web' && hashFiles('dist/release/android.json') != '') || github.job == 'desktop'",shell: bash,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/release.sh\" verify-artifacts"},&item6 {name: Upload release artifacts,id: artifacts,if: "hashFiles('dist/release/*') != ''",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}}]},android: {name: Android,needs: [changes,web],if: "needs.web.outputs.android_build == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.android_runner }}",timeout-minutes: 30,env: {PLATFORM: android,EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",ANDROID_PLAY_SUBMIT: "${{ vars.ANDROID_PLAY_SUBMIT }}"},steps: [*item0,{name: Prepare Android disk space,run: bash .github/scripts/android-runner.sh prepare},*item1,*item2,*item3,*item4,{name: Report mobile build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Expo,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Java,uses: actions/setup-java@v5,with: {distribution: temurin,java-version: "17"}},{name: SDK,uses: android-actions/setup-android@v3,with: {packages: platform-tools}},{name: Gradle,uses: gradle/actions/setup-gradle@v4,with: {cache-read-only: false}},{name: Restore native compiler cache,if: "github.event_name == 'push'",id: native-cache,uses: actions/cache/restore@v4,with: {path: "${{ runner.temp }}/ccache",key: "android-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}"}},{name: Install native compiler cache,if: "github.event_name == 'push' && steps.native-cache.outputs.cache-hit == 'true'",run: "sudo apt-get update -qq\nsudo apt-get install -y ccache\nprintf 'CCACHE_DIR=%s\\nCCACHE_COMPILERCHECK=content\\nCMAKE_C_COMPILER_LAUNCHER=ccache\\nCMAKE_CXX_COMPILER_LAUNCHER=ccache\\n' \"$RUNNER_TEMP/ccache\" >> \"$GITHUB_ENV\"\n"},{name: Select Android bundle validation,id: bundletool-needed,env: {SIGNING_BUNDLE: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",SIGNING_STORE: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",SIGNING_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",SIGNING_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",SIGNING_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}"},run: "if [[ -n \"$SIGNING_BUNDLE$SIGNING_STORE$SIGNING_PASSWORD$SIGNING_ALIAS$SIGNING_KEY_PASSWORD\" ]]; then echo 'needed=true' >> \"$GITHUB_OUTPUT\"; fi\n"},{name: Download verified bundletool,if: "steps.bundletool-needed.outputs.needed == 'true'",run: "curl --fail --location --silent --show-error --retry 3 https://github.com/google/bundletool/releases/download/1.18.3/bundletool-all-1.18.3.jar --output \"$RUNNER_TEMP/bundletool.jar\"\necho 'a099cfa1543f55593bc2ed16a70a7c67fe54b1747bb7301f37fdfd6d91028e29 '\"$RUNNER_TEMP/bundletool.jar\" | sha256sum --check --status\n"},{name: Build,working-directory: apps/mobile,env: {RUNTIME: "${{ needs.web.outputs.android_runtime }}",BUNDLETOOL_JAR: "${{ runner.temp }}/bundletool.jar",DISPOSABL_ANDROID_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_ANDROID_SIGNING: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",ANDROID_KEYSTORE_BASE64: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",ANDROID_KEYSTORE_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",ANDROID_KEY_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",ANDROID_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" android-build"},*item5,*item6]},android-submit: {name: Android Play submission,needs: android,if: "github.event_name == 'push' && vars.ANDROID_PLAY_SUBMIT == 'true' && needs.android.result == 'success'",runs-on: ubuntu-24.04,timeout-minutes: 30,permissions: {contents: read},env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,*item1,*item2,{uses: actions/setup-java@v5,with: {distribution: temurin,java-version: "17"}},{uses: actions/download-artifact@v4,with: {name: release-android,path: dist/release}},{name: Submit Android bundle,working-directory: apps/mobile,env: {ANDROID_PLAY_SERVICE_ACCOUNT: "${{ secrets.ANDROID_PLAY_SERVICE_ACCOUNT }}",ANDROID_PLAY_TRACK: "${{ vars.ANDROID_PLAY_TRACK }}",ANDROID_PLAY_UPLOAD_CERT_SHA256: "${{ vars.ANDROID_PLAY_UPLOAD_CERT_SHA256 }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" android-submit"}]},android-failure: {name: Report Android failure,needs: android,if: "always() && (needs.android.result == 'failure' || needs.android.result == 'cancelled')",permissions: {contents: read,id-token: write},runs-on: ubuntu-24.04,timeout-minutes: 5,steps: [*item0,*item1,{run: "node .github/scripts/disposabl.mjs report android failed \"Android build failed or was cancelled; check the workflow log.\""}]},ios-preview: {name: iOS simulator preview,needs: [changes,web],if: "github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.macos_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report build,run: node .github/scripts/disposabl.mjs report ios building},{name: Load Expo environment,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Publish compatible iOS preview update,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Xcode toolchain,run: "xcodebuild -version\nxcrun swift --version\n"},{name: Build simulator archive,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" simulator"},{uses: actions/upload-artifact@v4,with: {name: ios-simulator,path: dist/apple/ios-simulator.zip,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report simulator archive,run: "echo 'iOS simulator archive is available in this workflow run’s artifacts; it is not a device or TestFlight build.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report ios ready 'Simulator archive available in workflow artifacts.'\n"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS simulator build failed; check the workflow log.'"}]},ios-production: {name: iOS production and TestFlight,needs: [changes,web],if: "github.event_name == 'push' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Check Expo connection,id: apple-prerequisites,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" prerequisites"},{name: Load Expo environment,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Select iOS update or native build,id: ios-plan,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota-plan"},{name: Publish compatible iOS production update,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {RUNTIME: "${{ steps.ios-plan.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Build and submit to TestFlight,if: "steps.ios-plan.outputs.action == 'build'",working-directory: apps/mobile,env: {ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" production"},{name: Reconcile delivery of the compatible native build,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {BUILD_ID: "${{ steps.ios-plan.outputs.build_id }}",ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" deliver"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS update, native build or submission failed; check the workflow log.'"}]},desktop: {needs: web,permissions: *permissions,name: "${{ matrix.platform }}",if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.desktop != '[]' && needs.web.outputs.desktop != ''",strategy: {fail-fast: false,matrix: {include: "${{ fromJSON(needs.web.outputs.desktop) }}"}},runs-on: "${{ matrix.runner }}",timeout-minutes: 20,env: {PLATFORM: "${{ matrix.platform }}",DISPOSABL_RELEASE_VERSION: "1.${{ github.run_number }}.${{ github.run_attempt }}",DISPOSABL_DESKTOP_PLATFORM: "${{ matrix.platform }}",DISPOSABL_DESKTOP_UPDATE_CHANNEL: production,CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",electron_config_cache: "${{ github.workspace }}/.cache/electron"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report desktop build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Electron,uses: actions/cache@v4,with: {path: .cache/electron,key: "electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock') }}"}},{name: Packages,if: "matrix.platform == 'linux'",run: "command -v fakeroot && command -v rpmbuild && command -v dpkg-deb || { sudo apt-get update && sudo apt-get install -y fakeroot dpkg rpm; }"},{name: Configure desktop update identity,shell: bash,run: "id=$(node -p \"require('./disposabl.json').desktopId || ''\")\nif [[ ! \"$id\" =~ ^[a-f0-9]{32}$ ]]; then echo 'Desktop identity missing; regenerate this app before its first installation.' >&2; exit 1; fi\necho \"DISPOSABL_DESKTOP_ID=$id\" >> \"$GITHUB_ENV\"\necho \"DISPOSABL_DESKTOP_UPDATE_URL=${CONVEX_SITE_URL}/desktop/updates/$id\" >> \"$GITHUB_ENV\"\n"},{name: Build,if: "matrix.platform != 'macos'",run: bun run --cwd apps/desktop preview},{name: Build macOS,if: "matrix.platform == 'macos'",shell: bash,env: {MACOS_SIGNING_CONFIG: "${{ secrets.MACOS_SIGNING_CONFIG }}"},run: bash .github/scripts/macos-release.sh},*item5,{name: Publish desktop update feed,if: "matrix.platform == 'windows' || (matrix.platform == 'macos' && env.MACOS_NOTARIZE == 'true')",shell: bash,env: {CONVEX_DEPLOY_KEY: "${{ secrets.CONVEX_DEPLOY_KEY }}"},run: "test \"$(gh api \"repos/$GH_REPO/git/ref/heads/main\" --jq .object.sha)\" = \"$SOURCE\"\nnode apps/desktop/publish-update.mjs\n"},{name: Upload desktop release artifacts,if: "matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true'",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Upload staged update feed,if: "matrix.platform != 'linux' && env.DISPOSABL_DESKTOP_UPDATE_URL != '' && (matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true')",uses: actions/upload-artifact@v4,with: {name: "desktop-update-${{ env.PLATFORM }}",path: dist/update/,retention-days: 3,if-no-files-found: error}},{name: Upload unsigned macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",uses: actions/upload-artifact@v4,with: {name: macos-unsigned,path: "dist/release/*.dmg\ndist/release/*.zip\n",retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",run: "echo 'macOS DMG is ad-hoc signed, not Developer ID signed or notarized. Download it from this workflow run’s artifacts.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report macos blocked 'Ad-hoc signed DMG available in workflow artifacts; Developer ID signing and notarization are not configured.'\n"},{name: Report desktop failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" failed"},{name: Clean up macOS signing,if: "always() && matrix.platform == 'macos'",shell: bash,run: bash .github/scripts/macos-release.sh cleanup}]},packages: {name: "Package / ${{ matrix.package }}",needs: [changes,web],if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.packages != '[]' && needs.web.outputs.packages != ''",runs-on: ubuntu-24.04,timeout-minutes: 15,permissions: {contents: write,id-token: write},concurrency: {group: "npm-${{ matrix.package }}",cancel-in-progress: false},strategy: {fail-fast: false,matrix: {package: "${{ fromJSON(needs.web.outputs.packages) }}"}},env: {PACKAGE: "${{ matrix.package }}"},steps: [{uses: actions/checkout@v6,with: {fetch-depth: 0,persist-credentials: false}},*item1,*item2,*item3,*item4,{name: Disposabl GitHub App token,run: node .github/scripts/disposabl.mjs token},{name: Publish package if configured,run: bash .github/scripts/release.sh package-release}]},publish: {needs: [changes,web,android,desktop],if: "always() && !cancelled() && needs.web.result == 'success' && (needs.web.outputs.release == 'true' || needs.android.result == 'success' || needs.desktop.result == 'success')",environment: publishing,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 15,permissions: {contents: write,actions: read,id-token: write},steps: [{uses: actions/checkout@v6,with: {ref: main,persist-credentials: false}},{uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},{name: Disposabl installation token,run: node .github/scripts/disposabl.mjs token},{name: Select release source,id: source,run: bash .github/scripts/release.sh release-source},{uses: actions/download-artifact@v4,if: "steps.source.outputs.current == 'true'",with: {pattern: release-*,path: artifacts}},{name: Publish verified build artifacts,if: "steps.source.outputs.current == 'true'",run: bash .github/scripts/release.sh release-publish}]}}}
1
+ {name: Pipeline,"on": {pull_request: {branches: [main]},push: {branches: [main]}},permissions: {contents: read,pull-requests: read},concurrency: {group: "${{ github.workflow }}-${{ github.ref }}",cancel-in-progress: "${{ github.event_name == 'pull_request' }}"},env: {CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_MOBILE_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",EAS_ENVIRONMENT: "${{ github.event_name == 'push' && 'production' || 'preview' }}",EAS_CLI: eas-cli@27.2.0,BUN_VERSION: 1.4.4,NODE_VERSION: "24",LINUX_RUNNER: ubuntu-24.04,WEB_RUNNER: ubuntu-24.04,WINDOWS_RUNNER: windows-2025,MACOS_RUNNER: macos-26,RELEASE_PREFIX: app,DISPOSABL_ANDROID_VERSION_CODE: "${{ github.run_number }}",DISPOSABL_IOS_BUILD_NUMBER: "${{ github.run_number }}",GH_TOKEN: "${{ github.token }}",GH_REPO: "${{ github.repository }}",SOURCE: "${{ github.event.pull_request.head.sha || github.sha }}",SOURCE_PATH: "${{ github.event_name == 'pull_request' && format('pulls/{0}', github.event.number) || 'git/ref/heads/main' }}",DISPOSABL_RELEASE_VERSION: "1.0.${{ github.run_number }}"},jobs: {changes: {name: Select work,if: "github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository",permissions: {contents: read,pull-requests: read,actions: read},runs-on: ubuntu-24.04,timeout-minutes: 30,outputs: {linux_runner: "${{ steps.platforms.outputs.linux_runner }}",android_runner: "${{ steps.platforms.outputs.android_runner }}",macos_runner: "${{ steps.platforms.outputs.macos_runner }}",changed: "${{ steps.platforms.outputs.changed }}",android: "${{ steps.platforms.outputs.android }}",ios: "${{ steps.platforms.outputs.ios }}",desktop: "${{ steps.platforms.outputs.desktop }}",packages: "${{ steps.platforms.outputs.packages }}"},steps: [&item0 {uses: actions/checkout@v6,with: {ref: "${{ env.SOURCE }}",persist-credentials: false}},{name: Select affected platforms,shell: bash,id: platforms,env: {PR: "${{ github.event.number }}",EXPO_CONNECTED: "${{ secrets.EXPO_TOKEN != '' }}",IOS_BUILDS_ENABLED: "${{ vars.IOS_BUILDS_ENABLED != 'false' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/platforms.sh\""}]},web: {name: Web,needs: changes,if: "needs.changes.outputs.changed == 'true'",permissions: &permissions {contents: read,pull-requests: read,id-token: write},timeout-minutes: 20,runs-on: "${{ needs.changes.outputs.linux_runner }}",outputs: {desktop: "${{ needs.changes.outputs.desktop }}",ios: "${{ needs.changes.outputs.ios }}",packages: "${{ needs.changes.outputs.packages }}",release: "${{ steps.artifacts.outcome == 'success' }}",android_build: "${{ steps.fingerprint.outputs.build }}",android_runtime: "${{ steps.fingerprint.outputs.runtime }}",convex_url: "${{ steps.deploy.outputs.CONVEX_URL }}",convex_site_url: "${{ steps.deploy.outputs.CONVEX_SITE_URL }}",public_site_url: "${{ steps.deploy.outputs.PUBLIC_SITE_URL }}"},env: {PLATFORM: android,DISPOSABL_ANDROID_SIGNING: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",ANDROID_KEYSTORE_BASE64: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",ANDROID_KEYSTORE_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",ANDROID_KEY_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",ANDROID_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}",ANDROID_PLAY_SUBMIT: "${{ vars.ANDROID_PLAY_SUBMIT }}",EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,&item1 {uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},&item2 {uses: oven-sh/setup-bun@v2,with: {bun-version: 1.4.4}},&item3 {uses: actions/cache@v4,with: {path: ~/.bun/install/cache,key: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-${{ hashFiles('bun.lock') }}",restore-keys: "bun-${{ github.job == 'desktop' && 'desktop-' || '' }}${{ runner.os }}-${{ runner.arch }}-${{ env.BUN_VERSION }}-"}},&item4 {run: "bun install --frozen-lockfile ${{ github.job == 'desktop' && '--filter \"*desktop*\" --filter @disposabl/backend' || (github.job == 'android' || startsWith(github.job, 'ios-')) && '--filter @disposabl/mobile' || '' }}"},{name: Report build start,run: "node .github/scripts/disposabl.mjs report web,api,mcp building\nif [[ -z \"$EXPO_TOKEN\" ]]; then node .github/scripts/disposabl.mjs report android blocked 'Connect Expo before building Android.'; fi\nif [[ '${{ github.event_name }}' == pull_request ]]; then node .github/scripts/disposabl.mjs report cli,typescript-sdk blocked 'Packages publish after merge to main.'; fi\n"},{name: Check,run: bun run check},{name: Build selected clients,run: "for package in cli sdk; do\n if test -f \"packages/$package/package.json\"; then bun run --cwd \"packages/$package\" build; fi\ndone\n"},{name: Deploy,id: deploy,timeout-minutes: 10,env: {TRUSTED: "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}",CONVEX_DEPLOY_KEY: "${{ secrets[github.event_name == 'push' && 'CONVEX_DEPLOY_KEY' || 'CONVEX_DEPLOY_KEY_PREVIEW'] }}"},run: "if [[ \"$TRUSTED\" != true ]]; then VITE_CONVEX_URL=https://ci.invalid VITE_CONVEX_SITE_URL=https://ci.invalid bun run build --filter=@disposabl/web; exit; fi\n: \"${CONVEX_DEPLOY_KEY:?Configure the Convex deployment secret for this repository}\"\ncd packages/backend\nexport AUTH_TARGET=--prod\ntarget=()\nif [[ \"$CHANNEL\" != production ]]; then export AUTH_TARGET=\"--preview-name $CHANNEL\"; target=(--preview-name \"$CHANNEL\"); fi\nbun x --no-install convex deploy --yes \"${target[@]}\" --cmd-url-env-var-name CONVEX_URL --cmd 'set -e; for name in CONVEX_URL CONVEX_SITE_URL; do value=$(printenv \"$name\"); test -n \"$value\"; printf \"%s=%s\\n\" \"$name\" \"$value\" | tee -a \"$GITHUB_ENV\" >> \"$GITHUB_OUTPUT\"; done; export VITE_CONVEX_URL=\"$CONVEX_URL\"; if node -e \"process.exit(require(\\\"../../disposabl.json\\\").appId ? 0 : 1)\"; then node ../../.github/scripts/disposabl.mjs site; PUBLIC_SITE_URL=$(sed -n \"s/^PUBLIC_SITE_URL=//p\" \"$GITHUB_OUTPUT\" | tail -1); export PUBLIC_SITE_URL; bun x --no-install convex env set $AUTH_TARGET PUBLIC_SITE_URL \"$PUBLIC_SITE_URL\"; else PUBLIC_SITE_URL=\"$CONVEX_SITE_URL\"; printf \"PUBLIC_SITE_URL=%s\\n\" \"$PUBLIC_SITE_URL\" | tee -a \"$GITHUB_ENV\" >> \"$GITHUB_OUTPUT\"; fi; for prefix in VITE_ EXPO_PUBLIC_; do export \"${prefix}CONVEX_URL=$CONVEX_URL\" \"${prefix}CONVEX_SITE_URL=$PUBLIC_SITE_URL\"; printf \"%sCONVEX_URL=%s\\n%sCONVEX_SITE_URL=%s\\n\" \"$prefix\" \"$CONVEX_URL\" \"$prefix\" \"$PUBLIC_SITE_URL\" >> \"$GITHUB_ENV\"; done; bun run --cwd ../.. build --filter=@disposabl/web'\nsetup_target=(--prod)\nif [[ \"$CHANNEL\" != production ]]; then setup_target=(\"${target[@]}\"); fi\nbun x --no-install convex run \"${setup_target[@]}\" billing:setup '{}'\nbun x --no-install static-hosting upload $AUTH_TARGET --no-spa --dist ../../apps/web/dist/client\n"},{name: Report web result,if: always(),run: "node .github/scripts/disposabl.mjs report web,api,mcp ${{ steps.deploy.outcome == 'success' && 'ready' || 'failed' }}"},{name: Expo,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Channel,if: "needs.changes.outputs.android == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Fingerprint,id: fingerprint,if: "needs.changes.outputs.android == 'true'",env: {},working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-fingerprint"},{name: Update,if: "steps.fingerprint.outputs.build == 'false'",env: {TAG: "${{ steps.fingerprint.outputs.tag }}",SHA: "${{ steps.fingerprint.outputs.sha }}",RUNTIME: "${{ steps.fingerprint.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-update"},&item5 {name: Publish,if: "github.job == 'android' || (github.job == 'web' && hashFiles('dist/release/android.json') != '') || github.job == 'desktop'",shell: bash,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/release.sh\" verify-artifacts"},&item6 {name: Upload release artifacts,id: artifacts,if: "hashFiles('dist/release/*') != ''",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}}]},android: {name: Android,needs: [changes,web],if: "needs.web.outputs.android_build == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.android_runner }}",timeout-minutes: 30,env: {PLATFORM: android,EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",PUBLIC_SITE_URL: "${{ needs.web.outputs.public_site_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.public_site_url }}",ANDROID_PLAY_SUBMIT: "${{ vars.ANDROID_PLAY_SUBMIT }}"},steps: [*item0,{name: Prepare Android disk space,run: bash .github/scripts/android-runner.sh prepare},*item1,*item2,*item3,*item4,{name: Report mobile build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Expo,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Java,uses: actions/setup-java@v5,with: {distribution: temurin,java-version: "17"}},{name: SDK,uses: android-actions/setup-android@v3,with: {packages: platform-tools}},{name: Gradle,uses: gradle/actions/setup-gradle@v4,with: {cache-read-only: false}},{name: Restore native compiler cache,if: "github.event_name == 'push'",id: native-cache,uses: actions/cache/restore@v4,with: {path: "${{ runner.temp }}/ccache",key: "android-ccache-v1-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}"}},{name: Install native compiler cache,if: "github.event_name == 'push' && steps.native-cache.outputs.cache-hit == 'true'",run: "sudo apt-get update -qq\nsudo apt-get install -y ccache\nprintf 'CCACHE_DIR=%s\\nCCACHE_COMPILERCHECK=content\\nCMAKE_C_COMPILER_LAUNCHER=ccache\\nCMAKE_CXX_COMPILER_LAUNCHER=ccache\\n' \"$RUNNER_TEMP/ccache\" >> \"$GITHUB_ENV\"\n"},{name: Select Android bundle validation,id: bundletool-needed,env: {SIGNING_BUNDLE: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",SIGNING_STORE: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",SIGNING_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",SIGNING_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",SIGNING_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}"},run: "if [[ -n \"$SIGNING_BUNDLE$SIGNING_STORE$SIGNING_PASSWORD$SIGNING_ALIAS$SIGNING_KEY_PASSWORD\" ]]; then echo 'needed=true' >> \"$GITHUB_OUTPUT\"; fi\n"},{name: Download verified bundletool,if: "steps.bundletool-needed.outputs.needed == 'true'",run: "curl --fail --location --silent --show-error --retry 3 https://github.com/google/bundletool/releases/download/1.18.3/bundletool-all-1.18.3.jar --output \"$RUNNER_TEMP/bundletool.jar\"\necho 'a099cfa1543f55593bc2ed16a70a7c67fe54b1747bb7301f37fdfd6d91028e29 '\"$RUNNER_TEMP/bundletool.jar\" | sha256sum --check --status\n"},{name: Build,working-directory: apps/mobile,env: {RUNTIME: "${{ needs.web.outputs.android_runtime }}",BUNDLETOOL_JAR: "${{ runner.temp }}/bundletool.jar",DISPOSABL_ANDROID_CHANNEL: "${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || 'production' }}",DISPOSABL_ANDROID_SIGNING: "${{ github.event_name == 'push' && secrets.DISPOSABL_ANDROID_SIGNING || '' }}",ANDROID_KEYSTORE_BASE64: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_BASE64 || '' }}",ANDROID_KEYSTORE_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEYSTORE_PASSWORD || '' }}",ANDROID_KEY_ALIAS: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_ALIAS || '' }}",ANDROID_KEY_PASSWORD: "${{ github.event_name == 'push' && secrets.ANDROID_KEY_PASSWORD || '' }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" android-build"},*item5,*item6]},android-submit: {name: Android Play submission,needs: android,if: "github.event_name == 'push' && vars.ANDROID_PLAY_SUBMIT == 'true' && needs.android.result == 'success'",runs-on: ubuntu-24.04,timeout-minutes: 30,permissions: {contents: read},env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,*item1,*item2,{uses: actions/setup-java@v5,with: {distribution: temurin,java-version: "17"}},{uses: actions/download-artifact@v4,with: {name: release-android,path: dist/release}},{name: Submit Android bundle,working-directory: apps/mobile,env: {ANDROID_PLAY_SERVICE_ACCOUNT: "${{ secrets.ANDROID_PLAY_SERVICE_ACCOUNT }}",ANDROID_PLAY_TRACK: "${{ vars.ANDROID_PLAY_TRACK }}",ANDROID_PLAY_UPLOAD_CERT_SHA256: "${{ vars.ANDROID_PLAY_UPLOAD_CERT_SHA256 }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" android-submit"}]},android-failure: {name: Report Android failure,needs: android,if: "always() && (needs.android.result == 'failure' || needs.android.result == 'cancelled')",permissions: {contents: read,id-token: write},runs-on: ubuntu-24.04,timeout-minutes: 5,steps: [*item0,*item1,{run: "node .github/scripts/disposabl.mjs report android failed \"Android build failed or was cancelled; check the workflow log.\""}]},ios-preview: {name: iOS simulator preview,needs: [changes,web],if: "github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.macos_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",PUBLIC_SITE_URL: "${{ needs.web.outputs.public_site_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.public_site_url }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report build,run: node .github/scripts/disposabl.mjs report ios building},{name: Load Expo environment,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Publish compatible iOS preview update,if: "env.EXPO_TOKEN != ''",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Xcode toolchain,run: "xcodebuild -version\nxcrun swift --version\n"},{name: Build simulator archive,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" simulator"},{uses: actions/upload-artifact@v4,with: {name: ios-simulator,path: dist/apple/ios-simulator.zip,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report simulator archive,run: "echo 'iOS simulator archive is available in this workflow run’s artifacts; it is not a device or TestFlight build.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report ios ready 'Simulator archive available in workflow artifacts.'\n"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS simulator build failed; check the workflow log.'"}]},ios-production: {name: iOS production and TestFlight,needs: [changes,web],if: "github.event_name == 'push' && needs.web.outputs.ios == 'true'",permissions: *permissions,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 20,env: {EXPO_TOKEN: "${{ secrets.EXPO_TOKEN }}",EXPO_PROJECT_ID: "${{ secrets.EXPO_PROJECT_ID || vars.EXPO_PROJECT_ID }}",EXPO_OWNER: "${{ secrets.EXPO_OWNER || vars.EXPO_OWNER }}",EXPO_SLUG: "${{ secrets.EXPO_SLUG || vars.EXPO_SLUG }}",EXPO_NO_DOTENV: "1",CONVEX_URL: "${{ needs.web.outputs.convex_url }}",CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",EXPO_PUBLIC_CONVEX_URL: "${{ needs.web.outputs.convex_url }}",PUBLIC_SITE_URL: "${{ needs.web.outputs.public_site_url }}",EXPO_PUBLIC_CONVEX_SITE_URL: "${{ needs.web.outputs.public_site_url }}"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Check Expo connection,id: apple-prerequisites,working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" prerequisites"},{name: Load Expo environment,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-env"},{name: Verify update channel,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/mobile.sh\" expo-channel"},{name: Select iOS update or native build,id: ios-plan,if: "steps.apple-prerequisites.outputs.ready == 'true'",working-directory: apps/mobile,run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota-plan"},{name: Publish compatible iOS production update,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {RUNTIME: "${{ steps.ios-plan.outputs.runtime }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" ota"},{name: Build and submit to TestFlight,if: "steps.ios-plan.outputs.action == 'build'",working-directory: apps/mobile,env: {ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" production"},{name: Reconcile delivery of the compatible native build,if: "steps.ios-plan.outputs.action == 'update'",working-directory: apps/mobile,env: {BUILD_ID: "${{ steps.ios-plan.outputs.build_id }}",ASC_APP_ID: "${{ secrets.ASC_APP_ID || vars.ASC_APP_ID }}"},run: "bash \"$GITHUB_WORKSPACE/.github/scripts/apple.sh\" deliver"},{name: Report failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report ios failed 'iOS update, native build or submission failed; check the workflow log.'"}]},desktop: {needs: web,permissions: *permissions,name: "${{ matrix.platform }}",if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.desktop != '[]' && needs.web.outputs.desktop != ''",strategy: {fail-fast: false,matrix: {include: "${{ fromJSON(needs.web.outputs.desktop) }}"}},runs-on: "${{ matrix.runner }}",timeout-minutes: 20,env: {PLATFORM: "${{ matrix.platform }}",DISPOSABL_RELEASE_VERSION: "1.${{ github.run_number }}.${{ github.run_attempt }}",DISPOSABL_DESKTOP_PLATFORM: "${{ matrix.platform }}",DISPOSABL_DESKTOP_UPDATE_CHANNEL: production,CONVEX_SITE_URL: "${{ needs.web.outputs.convex_site_url }}",electron_config_cache: "${{ github.workspace }}/.cache/electron"},steps: [*item0,*item1,*item2,*item3,*item4,{name: Report desktop build,run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" building"},{name: Electron,uses: actions/cache@v4,with: {path: .cache/electron,key: "electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock') }}"}},{name: Packages,if: "matrix.platform == 'linux'",run: "command -v fakeroot && command -v rpmbuild && command -v dpkg-deb || { sudo apt-get update && sudo apt-get install -y fakeroot dpkg rpm; }"},{name: Configure desktop update identity,shell: bash,run: "id=$(node -p \"require('./disposabl.json').desktopId || ''\")\nif [[ ! \"$id\" =~ ^[a-f0-9]{32}$ ]]; then echo 'Desktop identity missing; regenerate this app before its first installation.' >&2; exit 1; fi\necho \"DISPOSABL_DESKTOP_ID=$id\" >> \"$GITHUB_ENV\"\necho \"DISPOSABL_DESKTOP_UPDATE_URL=${CONVEX_SITE_URL}/desktop/updates/$id\" >> \"$GITHUB_ENV\"\n"},{name: Build,if: "matrix.platform != 'macos'",run: bun run --cwd apps/desktop preview},{name: Build macOS,if: "matrix.platform == 'macos'",shell: bash,env: {MACOS_SIGNING_CONFIG: "${{ secrets.MACOS_SIGNING_CONFIG }}"},run: bash .github/scripts/macos-release.sh},*item5,{name: Publish desktop update feed,if: "matrix.platform == 'windows' || (matrix.platform == 'macos' && env.MACOS_NOTARIZE == 'true')",shell: bash,env: {CONVEX_DEPLOY_KEY: "${{ secrets.CONVEX_DEPLOY_KEY }}"},run: "test \"$(gh api \"repos/$GH_REPO/git/ref/heads/main\" --jq .object.sha)\" = \"$SOURCE\"\nnode apps/desktop/publish-update.mjs\n"},{name: Upload desktop release artifacts,if: "matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true'",uses: actions/upload-artifact@v4,with: {name: "release-${{ env.PLATFORM }}",path: dist/release/,retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Upload staged update feed,if: "matrix.platform != 'linux' && env.DISPOSABL_DESKTOP_UPDATE_URL != '' && (matrix.platform != 'macos' || env.MACOS_NOTARIZE == 'true')",uses: actions/upload-artifact@v4,with: {name: "desktop-update-${{ env.PLATFORM }}",path: dist/update/,retention-days: 3,if-no-files-found: error}},{name: Upload unsigned macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",uses: actions/upload-artifact@v4,with: {name: macos-unsigned,path: "dist/release/*.dmg\ndist/release/*.zip\n",retention-days: 3,compression-level: 0,if-no-files-found: error}},{name: Report macOS artifact,if: "matrix.platform == 'macos' && env.MACOS_NOTARIZE != 'true'",run: "echo 'macOS DMG is ad-hoc signed, not Developer ID signed or notarized. Download it from this workflow run’s artifacts.' >> \"$GITHUB_STEP_SUMMARY\"\nnode .github/scripts/disposabl.mjs report macos blocked 'Ad-hoc signed DMG available in workflow artifacts; Developer ID signing and notarization are not configured.'\n"},{name: Report desktop failure,if: failure() || cancelled(),run: "node .github/scripts/disposabl.mjs report \"$PLATFORM\" failed"},{name: Clean up macOS signing,if: "always() && matrix.platform == 'macos'",shell: bash,run: bash .github/scripts/macos-release.sh cleanup}]},packages: {name: "Package / ${{ matrix.package }}",needs: [changes,web],if: "github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.web.outputs.packages != '[]' && needs.web.outputs.packages != ''",runs-on: ubuntu-24.04,timeout-minutes: 15,permissions: {contents: write,id-token: write},concurrency: {group: "npm-${{ matrix.package }}",cancel-in-progress: false},strategy: {fail-fast: false,matrix: {package: "${{ fromJSON(needs.web.outputs.packages) }}"}},env: {PACKAGE: "${{ matrix.package }}"},steps: [{uses: actions/checkout@v6,with: {fetch-depth: 0,persist-credentials: false}},*item1,*item2,*item3,*item4,{name: Disposabl GitHub App token,run: node .github/scripts/disposabl.mjs token},{name: Publish package if configured,run: bash .github/scripts/release.sh package-release}]},publish: {needs: [changes,web,android,desktop],if: "always() && !cancelled() && needs.web.result == 'success' && (needs.web.outputs.release == 'true' || needs.android.result == 'success' || needs.desktop.result == 'success')",environment: publishing,runs-on: "${{ needs.changes.outputs.linux_runner }}",timeout-minutes: 15,permissions: {contents: write,actions: read,id-token: write},steps: [{uses: actions/checkout@v6,with: {ref: main,persist-credentials: false}},{uses: actions/setup-node@v6,with: {node-version: "24",package-manager-cache: false}},{name: Disposabl installation token,run: node .github/scripts/disposabl.mjs token},{name: Select release source,id: source,run: bash .github/scripts/release.sh release-source},{uses: actions/download-artifact@v4,if: "steps.source.outputs.current == 'true'",with: {pattern: release-*,path: artifacts}},{name: Publish verified build artifacts,if: "steps.source.outputs.current == 'true'",run: bash .github/scripts/release.sh release-publish}]}}}
@@ -38,7 +38,9 @@ module.exports = ({ config }) => {
38
38
  throw new Error("Invalid DISPOSABL_IOS_BUILD_NUMBER");
39
39
  // Fail instead of exporting an update against another preview's backend.
40
40
  for (const name of ["CONVEX_URL", "CONVEX_SITE_URL"]) {
41
- const deployed = process.env[name];
41
+ const deployed =
42
+ (name === "CONVEX_SITE_URL" && process.env.PUBLIC_SITE_URL) ||
43
+ process.env[name];
42
44
  const exported = process.env[`EXPO_PUBLIC_${name}`];
43
45
  if (deployed && deployed !== exported) {
44
46
  throw new Error(
@@ -56,9 +56,18 @@ const config = defineConfig(({ mode }) => {
56
56
  )
57
57
  throw new Error("VITE_PUBLIC_SITE_URL must be an HTTP(S) origin");
58
58
  const siteUrl = publicUrl.origin;
59
- const indexable = isProductionSite(mode, url.origin, site);
59
+ const productionSite = (app as { productionSiteUrl?: string })
60
+ .productionSiteUrl;
61
+ const indexable = isProductionSite(
62
+ mode,
63
+ url.origin,
64
+ productionSite
65
+ ? { origin: productionSite, backendOrigin: productionSite }
66
+ : site,
67
+ );
60
68
  const prerenderFilter = createPrerenderFilter();
61
69
  const productionBackend =
70
+ productionSite ||
62
71
  (app as { productionConvexSiteUrl?: string }).productionConvexSiteUrl ||
63
72
  site.backendOrigin;
64
73
 
@@ -33,7 +33,9 @@ if (env.CONVEX_DEPLOY_KEY && !env.CONVEX_DEPLOY_KEY.startsWith("dev:"))
33
33
  );
34
34
  const url = env.CONVEX_URL;
35
35
  const site =
36
- env.CONVEX_SITE_URL || url?.replace(/\.convex\.cloud$/, ".convex.site");
36
+ env.PUBLIC_SITE_URL ||
37
+ env.CONVEX_SITE_URL ||
38
+ url?.replace(/\.convex\.cloud$/, ".convex.site");
37
39
  if (!url || !site)
38
40
  throw new Error(
39
41
  "Configure CONVEX_URL and CONVEX_SITE_URL in packages/backend/.env.local.",
@@ -28,11 +28,6 @@ import type { DataModel } from "./dataModel.js";
28
28
  * `convex.config.ts`.
29
29
  */
30
30
  type Env = {
31
- readonly R2_ACCOUNT_ID: string | undefined;
32
- readonly R2_BUCKET_NAME: string | undefined;
33
- readonly R2_ACCESS_KEY_ID: string | undefined;
34
- readonly R2_SECRET_ACCESS_KEY: string | undefined;
35
- readonly REVENUECAT_MANAGED_MONTHLY_ROUTES: string | undefined;
36
31
  readonly CONVEX_CLOUD_URL: string;
37
32
  readonly CONVEX_SITE_URL: string;
38
33
  readonly AUTH_EMAIL_ORIGIN: string | undefined;
@@ -42,12 +37,31 @@ type Env = {
42
37
  readonly AUTH_GOOGLE_RELAY_SECRET: string | undefined;
43
38
  readonly AUTH_GOOGLE_RELAY_URL: string | undefined;
44
39
  readonly AUTH_REDIRECT_ORIGINS: string | undefined;
40
+ readonly AUTUMN_SECRET_KEY: string | undefined;
41
+ readonly BILLING_IOS_RETURN_CHANNELS: string | undefined;
42
+ readonly BILLING_RETURN_URL: string | undefined;
43
+ readonly DISPOSABL_ENVIRONMENT: string | undefined;
44
+ readonly MOBILE_WEB_CHECKOUT_ENABLED: string | undefined;
45
45
  readonly POSTHOG_ENABLED: string | undefined;
46
46
  readonly POSTHOG_HOST: string | undefined;
47
47
  readonly POSTHOG_PROJECT_TOKEN: string | undefined;
48
+ readonly PUBLIC_SITE_URL: string | undefined;
49
+ readonly R2_ACCESS_KEY_ID: string | undefined;
50
+ readonly R2_ACCOUNT_ID: string | undefined;
51
+ readonly R2_BUCKET_NAME: string | undefined;
52
+ readonly R2_SECRET_ACCESS_KEY: string | undefined;
48
53
  readonly RESEND_API_KEY: string | undefined;
49
54
  readonly RESEND_FROM_EMAIL: string | undefined;
50
55
  readonly RESEND_WEBHOOK_SECRET: string | undefined;
56
+ readonly REVENUECAT_CONSUMABLE_INTEGRATION_VERIFIED: string | undefined;
57
+ readonly REVENUECAT_CONSUMABLE_OWNER: string | undefined;
58
+ readonly REVENUECAT_ENVIRONMENT: string | undefined;
59
+ readonly REVENUECAT_MANAGED_MONTHLY_ROUTES: string | undefined;
60
+ readonly REVENUECAT_PROJECT_ID: string | undefined;
61
+ readonly REVENUECAT_REVIEWER_USERS: string | undefined;
62
+ readonly REVENUECAT_ROUTES: string | undefined;
63
+ readonly REVENUECAT_SYNC_ENABLED: string | undefined;
64
+ readonly REVENUECAT_WEBHOOK_AUTH: string | undefined;
51
65
  };
52
66
 
53
67
  /**
@@ -31,7 +31,7 @@ export const { startSignInWithGoogle, completeSignInWithGoogle } = setupGoogle(
31
31
  component: components.authGoogle,
32
32
  authorizationState: googleAuthorizationState,
33
33
  allowedRedirectOrigins: [
34
- env.CONVEX_SITE_URL,
34
+ env.PUBLIC_SITE_URL ?? env.CONVEX_SITE_URL,
35
35
  ...(env.AUTH_REDIRECT_ORIGINS ?? "")
36
36
  .split(",")
37
37
  .map((origin) => origin.trim()),
@@ -4,7 +4,8 @@ import { components, internal } from "./_generated/api";
4
4
  import { env } from "./_generated/server";
5
5
  import { auth } from "./authSetup";
6
6
 
7
- const origin = env.AUTH_EMAIL_ORIGIN || env.CONVEX_SITE_URL;
7
+ const origin =
8
+ env.AUTH_EMAIL_ORIGIN || env.PUBLIC_SITE_URL || env.CONVEX_SITE_URL;
8
9
 
9
10
  // Auth v2 reads these only inside a transaction. A missing sender rolls the
10
11
  // transaction back rather than creating an account or claiming an email was sent.
@@ -11,6 +11,7 @@ import { defineApp } from "convex/server";
11
11
 
12
12
  const app = defineApp({
13
13
  env: {
14
+ PUBLIC_SITE_URL: v.optional(v.string()),
14
15
  R2_ACCOUNT_ID: v.optional(v.string()),
15
16
  R2_BUCKET_NAME: v.optional(v.string()),
16
17
  R2_ACCESS_KEY_ID: v.optional(v.string()),
@@ -5,6 +5,8 @@ import { env } from "../../backend/convex/_generated/server";
5
5
 
6
6
  const path = "/oauth/relay/google";
7
7
  const issuer = "disposabl-google-preview";
8
+ const publicOrigin =
9
+ /^https:\/\/[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.disposabl\.xyz$/;
8
10
  const convexOrigin = /^https:\/\/[a-z0-9-]+\.convex\.site$/;
9
11
 
10
12
  export function googleConfigured() {
@@ -32,8 +34,8 @@ export async function googleAuthorizationState(state: string) {
32
34
  throw new ConvexError("Google sign-in is unavailable.");
33
35
  if (!env.AUTH_GOOGLE_RELAY_URL) return state;
34
36
  const { url, key } = relaySettings();
35
- const origin = env.CONVEX_SITE_URL;
36
- if (!origin || !convexOrigin.test(origin))
37
+ const origin = env.PUBLIC_SITE_URL ?? env.CONVEX_SITE_URL;
38
+ if (!origin || !(convexOrigin.test(origin) || publicOrigin.test(origin)))
37
39
  throw new Error("Google preview requires a Convex HTTP origin.");
38
40
  return new SignJWT({ state, origin })
39
41
  .setProtectedHeader({ alg: "HS256", typ: "JWT" })
@@ -65,7 +67,9 @@ export const googleRelay = httpActionGeneric(async (_ctx, request) => {
65
67
  });
66
68
  if (
67
69
  typeof payload.origin !== "string" ||
68
- !convexOrigin.test(payload.origin) ||
70
+ !(
71
+ convexOrigin.test(payload.origin) || publicOrigin.test(payload.origin)
72
+ ) ||
69
73
  typeof payload.state !== "string" ||
70
74
  !/^[A-Za-z0-9_-]{43}$/.test(payload.state)
71
75
  )
@@ -44,8 +44,8 @@ function createMcp(eligibility?: AccountEligibility): McpServer | undefined {
44
44
  name: "disposabl",
45
45
  title: "Disposabl",
46
46
  version: "1.0.0",
47
- siteUrl: env.CONVEX_SITE_URL,
48
- consentUrl: `${env.CONVEX_SITE_URL}/consent`,
47
+ siteUrl: env.PUBLIC_SITE_URL ?? env.CONVEX_SITE_URL,
48
+ consentUrl: `${env.PUBLIC_SITE_URL ?? env.CONVEX_SITE_URL}/consent`,
49
49
  scopes: {},
50
50
  clientMetadataDocumentHosts: ["claude.ai"],
51
51
  tools: eligibility
@@ -172,7 +172,10 @@ export default function createHttpRouter(
172
172
  method: "GET",
173
173
  handler: httpActionGeneric(async () =>
174
174
  Response.json(
175
- { ...openapi, servers: [{ url: env.CONVEX_SITE_URL }] },
175
+ {
176
+ ...openapi,
177
+ servers: [{ url: env.PUBLIC_SITE_URL ?? env.CONVEX_SITE_URL }],
178
+ },
176
179
  { headers: cors },
177
180
  ),
178
181
  ),
@@ -308,6 +308,7 @@ test("EAS environment cannot replace Android signing or submission policy", asyn
308
308
  "ANDROID_PLAY_SUBMIT",
309
309
  "ANDROID_PLAY_UPLOAD_CERT_SHA256",
310
310
  "UPDATE_POLICY",
311
+ "PUBLIC_SITE_URL",
311
312
  ]) {
312
313
  const result = await run("expo-env", {
313
314
  EAS_VARS: JSON.stringify({ [key]: "fixture-override" }),
@@ -14,6 +14,7 @@ const keys = [
14
14
  "EXPO_PUBLIC_CONVEX_SITE_URL",
15
15
  "CONVEX_URL",
16
16
  "CONVEX_SITE_URL",
17
+ "PUBLIC_SITE_URL",
17
18
  "E2E_ANDROID_APP_ID",
18
19
  "E2E_ANDROID_SCHEME",
19
20
  "DISPOSABL_MOBILE_CHANNEL",
@@ -33,6 +34,29 @@ function withEnv(values: Record<string, string>, run: () => void) {
33
34
  }
34
35
  }
35
36
 
37
+ test("mobile config accepts the registered public site and rejects other backends", () => {
38
+ const env = {
39
+ CONVEX_URL: "https://app.convex.cloud",
40
+ CONVEX_SITE_URL: "https://app.convex.site",
41
+ PUBLIC_SITE_URL: "https://app.disposabl.xyz",
42
+ EXPO_PUBLIC_CONVEX_URL: "https://app.convex.cloud",
43
+ EXPO_PUBLIC_CONVEX_SITE_URL: "https://app.disposabl.xyz",
44
+ };
45
+ withEnv(env, () => assert.doesNotThrow(() => configure({ config: {} })));
46
+ for (const key of ["EXPO_PUBLIC_CONVEX_URL", "EXPO_PUBLIC_CONVEX_SITE_URL"])
47
+ withEnv({ ...env, [key]: "https://other.example" }, () =>
48
+ assert.throws(() => configure({ config: {} }), /conflicts/),
49
+ );
50
+ withEnv(
51
+ {
52
+ ...env,
53
+ PUBLIC_SITE_URL: "",
54
+ EXPO_PUBLIC_CONVEX_SITE_URL: env.CONVEX_SITE_URL,
55
+ },
56
+ () => assert.doesNotThrow(() => configure({ config: {} })),
57
+ );
58
+ });
59
+
36
60
  test("production and E2E-off configurations retain default network security", () => {
37
61
  for (const e2e of [undefined, "false"])
38
62
  withEnv(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.20.24",
3
+ "version": "0.21.0",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",