create-disposabl-app 0.17.5 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +4 -0
  2. package/dist/disposabl.js +43 -10
  3. package/dist/index.js +64 -18
  4. package/dist/templates/default/apps/mobile/README.md +40 -0
  5. package/dist/templates/default/apps/mobile/app.config.js +46 -2
  6. package/dist/templates/default/apps/mobile/package.json +7 -1
  7. package/dist/templates/default/apps/mobile/plugins/with-android-signing.js +23 -1
  8. package/dist/templates/default/apps/mobile/scripts/fresh-android.mjs +24 -0
  9. package/dist/templates/default/apps/mobile/scripts/play-aab.mjs +176 -0
  10. package/dist/templates/default/apps/mobile/scripts/verify-play-aab.mjs +77 -0
  11. package/dist/templates/default/bun.lock +12 -3
  12. package/dist/templates/default/bunfig.toml +1 -0
  13. package/dist/templates/default/package.json +6 -2
  14. package/dist/templates/default/packages/backend/convex/files/guard.ts +2 -0
  15. package/dist/templates/default/packages/backend/convex/http.ts +11 -1
  16. package/dist/templates/default/packages/backend/convex/schema.ts +10 -0
  17. package/dist/templates/default/packages/backend/convex/telemetry.ts +12 -16
  18. package/dist/templates/default/packages/cli/build.ts +4 -0
  19. package/dist/templates/default/packages/cli/package.json +2 -1
  20. package/dist/templates/default/packages/cli/telemetry.ts +40 -3
  21. package/dist/templates/default/packages/disposabl-kit/PAYMENTS.md +2 -0
  22. package/dist/templates/default/packages/disposabl-kit/client/components/account-deletion.tsx +111 -0
  23. package/dist/templates/default/packages/disposabl-kit/client/components/consent-identity.tsx +50 -0
  24. package/dist/templates/default/packages/disposabl-kit/client/components/legal-page.tsx +12 -1
  25. package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry-lease.ts +200 -0
  26. package/dist/templates/default/packages/disposabl-kit/client/lib/telemetry.ts +8 -1
  27. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +23 -1
  28. package/dist/templates/default/packages/disposabl-kit/client/routes/legal/delete-account.tsx +6 -1
  29. package/dist/templates/default/packages/disposabl-kit/client/routes/legal/support.tsx +33 -0
  30. package/dist/templates/default/packages/disposabl-kit/client/routes/pricing.tsx +13 -0
  31. package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +19 -2
  32. package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +1 -0
  33. package/dist/templates/default/packages/disposabl-kit/legal/README.md +1 -1
  34. package/dist/templates/default/packages/disposabl-kit/legal/config.ts +32 -4
  35. package/dist/templates/default/packages/disposabl-kit/legal/index.ts +2 -2
  36. package/dist/templates/default/packages/disposabl-kit/legal/publisher.ts +6 -0
  37. package/dist/templates/default/packages/disposabl-kit/mobile/billing/account-billing.tsx +13 -9
  38. package/dist/templates/default/packages/disposabl-kit/mobile/billing/paywall.ts +28 -4
  39. package/dist/templates/default/packages/disposabl-kit/mobile/billing/policy.ts +31 -14
  40. package/dist/templates/default/packages/disposabl-kit/mobile/billing/web-checkout.ts +45 -34
  41. package/dist/templates/default/packages/disposabl-kit/mobile/components/settings-links.tsx +14 -0
  42. package/dist/templates/default/packages/disposabl-kit/mobile/expo-plugin.cjs +3 -0
  43. package/dist/templates/default/packages/disposabl-kit/mobile/index.ts +4 -0
  44. package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +55 -8
  45. package/dist/templates/default/packages/disposabl-kit/server/billing-functions.ts +147 -124
  46. package/dist/templates/default/packages/disposabl-kit/server/billing-handoff.ts +113 -95
  47. package/dist/templates/default/packages/disposabl-kit/server/files-functions.ts +70 -54
  48. package/dist/templates/default/packages/disposabl-kit/server/http.ts +49 -21
  49. package/dist/templates/default/packages/disposabl-kit/server/lib/platform-spec.ts +25 -1
  50. package/dist/templates/default/packages/disposabl-kit/server/lib/telemetry.ts +375 -69
  51. package/dist/templates/default/packages/disposabl-kit/server/release/clients.mjs +28 -1
  52. package/dist/templates/default/packages/disposabl-kit/server/release/verify-metadata.mjs +64 -0
  53. package/dist/templates/default/packages/sdk/README.md +2 -0
  54. package/dist/templates/default/packages/sdk/build.ts +8 -0
  55. package/dist/templates/default/packages/sdk/package.json +3 -2
  56. package/dist/templates/default/packages/sdk/src/analytics.ts +7 -2
  57. package/dist/templates/default/packages/skill/SKILL.md +4 -2
  58. package/dist/templates/default/packages/skill/references/store-submissions.md +25 -0
  59. package/dist/templates/default/packages/tests/README.md +28 -1
  60. package/dist/templates/default/packages/tests/account-deletion-ui.test.ts +21 -0
  61. package/dist/templates/default/packages/tests/auth-email-setup.test.ts +45 -0
  62. package/dist/templates/default/packages/tests/components/account-deletion.test.mjs +82 -0
  63. package/dist/templates/default/packages/tests/components/consent-identity.test.mjs +175 -0
  64. package/dist/templates/default/packages/tests/components/mobile-deletion-link.test.mjs +40 -0
  65. package/dist/templates/default/packages/tests/components/mobile-theme.test.mjs +56 -3
  66. package/dist/templates/default/packages/tests/components/pricing-identity.test.mjs +113 -0
  67. package/dist/templates/default/packages/tests/components/support-page.test.mjs +36 -0
  68. package/dist/templates/default/packages/tests/consent-identity.test.ts +13 -0
  69. package/dist/templates/default/packages/tests/desktop-macos-release.test.ts +153 -145
  70. package/dist/templates/default/packages/tests/flows/legal.e2e.ts +40 -3
  71. package/dist/templates/default/packages/tests/helpers/auth-email-setup/probe.test.mjs +44 -0
  72. package/dist/templates/default/packages/tests/helpers/mobile-simulator/preflight.py +80 -0
  73. package/dist/templates/default/packages/tests/helpers/mobile-simulator/test_preflight.py +57 -0
  74. package/dist/templates/default/packages/tests/mobile-android-e2e-network.test.ts +81 -1
  75. package/dist/templates/default/packages/tests/mobile-android-signing.test.ts +52 -0
  76. package/dist/templates/default/packages/tests/mobile-deletion-link.test.ts +21 -0
  77. package/dist/templates/default/packages/tests/mobile-ios-reachability-pin.test.ts +84 -0
  78. package/dist/templates/default/packages/tests/mobile-simulator-preflight.test.ts +16 -0
  79. package/dist/templates/default/packages/tests/native-billing.test.ts +288 -0
  80. package/dist/templates/default/packages/tests/pricing-identity.test.ts +13 -0
  81. package/dist/templates/default/packages/tests/sdk-analytics.test.ts +28 -2
  82. package/dist/templates/default/packages/tests/support-page.test.ts +13 -0
  83. package/dist/templates/default/packages/tests/telemetry.test.ts +389 -18
  84. package/dist/templates/default/packages/tests/ui-telemetry-lease.test.ts +346 -0
  85. package/dist/templates/default/patches/convex-mcp-account-erasure-alpha7.patch +466 -0
  86. package/dist/templates/default/vendor/README.md +61 -1
  87. package/dist/templates/default/vendor/convex-auth-040d8e36-disposabl.1.patch +890 -0
  88. package/dist/templates/default/vendor/convex-auth-040d8e36-disposabl.1.tgz +0 -0
  89. package/dist/templates/default/vendor/convex-auth-040d8e36-disposabl.2.patch +1060 -0
  90. package/dist/templates/default/vendor/convex-auth-040d8e36-disposabl.2.tgz +0 -0
  91. package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.4.tgz +0 -0
  92. package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.5.tgz +0 -0
  93. package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.6.tgz +0 -0
  94. package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.7.tgz +0 -0
  95. package/dist/templates/default/vendor/convex-auth-437831bd-disposabl.8.tgz +0 -0
  96. package/dist/templates/default/vendor/convex-auth-core-erasure-disposabl.6.patch +115 -0
  97. package/dist/templates/default/vendor/convex-auth-identity-cutoff-disposabl.7.patch +442 -0
  98. package/dist/templates/default/vendor/convex-auth-identity-erasure-disposabl.8.md +11 -0
  99. package/dist/templates/default/vendor/convex-auth-identity-erasure-disposabl.8.patch +78 -0
  100. package/dist/templates/default/vendor/convex-auth-marker-disposabl.4.patch +169 -0
  101. package/dist/templates/default/vendor/convex-auth-marker-password-disposabl.5.patch +126 -0
  102. package/dist/verify-metadata.mjs +64 -0
  103. package/package.json +3 -2
package/README.md CHANGED
@@ -25,6 +25,8 @@ Use the app name you chose instead of `my-app`. Your website opens automatically
25
25
 
26
26
  You can also launch setup with npm, pnpm, or Yarn 2+. The generated project still requires Bun. Tests need Node.js 22.22.3 or newer on Node 22, or Node.js 24.8 or newer.
27
27
 
28
+ Scaffolding skips automatic formatting when Bun's formatter is unavailable. After installing the project's pinned Bun version, run `bun fmt` to format those files.
29
+
28
30
  | Tool | Command |
29
31
  | ---- | -------------------------------------- |
30
32
  | npm | `npx create-disposabl-app@latest` |
@@ -111,4 +113,6 @@ Before publishing the generator, `bun run --cwd packages/create-disposabl-app bu
111
113
 
112
114
  Published generator releases can collect limited Disposabl usage analytics when centrally configured. They record the generator version, operating system, package-manager category and outcome, using a random ID that can be linked to your Disposabl user ID after login. They do not collect prompts, arguments, paths, error messages, credentials or email. Set `DO_NOT_TRACK=1` or `DISPOSABL_TELEMETRY_DISABLED=1` to opt out. Local source, development, CI and E2E runs do not send events. This is separate from analytics you configure for your own app.
113
115
 
116
+ Failed commands also send a fixed, coarse error-tracking event with no exception message or stack trace.
117
+
114
118
  Release builds must receive the central public PostHog project token in `DISPOSABL_CLI_POSTHOG_PROJECT_TOKEN` and its approved ingestion origin in `DISPOSABL_CLI_POSTHOG_HOST`. Both values are embedded at build time; a release build fails if they are missing. `DISPOSABL_CLI_TELEMETRY_REQUIRED=1` enforces this check for development-version qualification builds. Use the central public project token, never a personal API key or a generated app owner’s project token.
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.17.5";
6
+ var version = "0.18.0";
7
7
  var package_default = {
8
8
  name: "@disposabl/cli",
9
9
  version,
@@ -14,7 +14,7 @@ var package_default = {
14
14
  files: ["dist", "README.md"],
15
15
  engines: { node: ">=22.12.0" },
16
16
  publishConfig: { access: "public" },
17
- scripts: { build: "bun build.ts", typecheck: "bun check", lint: "bun check", release: "semantic-release" },
17
+ scripts: { build: "bun build.ts", typecheck: "bun check", lint: "bun check", release: "semantic-release", prepack: "node dist/verify-metadata.mjs" },
18
18
  dependencies: { "@modelcontextprotocol/sdk": "1.32.2", commander: "15.0.0", "proper-lockfile": "4.1.2" },
19
19
  devDependencies: { "@types/bun": "1.4.4", typescript: "~6.0.3", "@types/proper-lockfile": "4.1.4", "semantic-release": "25.0.9", "@semantic-release/exec": "7.1.0", "conventional-changelog-conventionalcommits": "9.3.1" },
20
20
  repository: { type: "git", url: "git+https://github.com/disposabl-dev/create-disposabl-app.git", directory: "packages/cli" }
@@ -292,10 +292,13 @@ Sign in to Expo if needed and choose Delete project. Then rerun this command to
292
292
  openUrl(url.href);
293
293
  }
294
294
 
295
+ // ../cli/commands.ts
296
+ import { CommanderError } from "commander";
297
+
295
298
  // ../cli/telemetry.ts
296
299
  import { createHash as createHash2, randomUUID } from "node:crypto";
297
300
  import { realpathSync } from "node:fs";
298
- import { mkdir as mkdir2, readFile as readFile2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
301
+ import { mkdir as mkdir2, open, readFile as readFile2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
299
302
  import { homedir as homedir2 } from "node:os";
300
303
  import { dirname, join as join2 } from "node:path";
301
304
  import { lock as lock2 } from "proper-lockfile";
@@ -361,6 +364,18 @@ async function send(config, event, distinctId, properties) {
361
364
  });
362
365
  return response.ok;
363
366
  }
367
+ async function firstExecution(path, product, version) {
368
+ try {
369
+ const directory = join2(dirname(path), "activations");
370
+ await mkdir2(directory, { recursive: true, mode: 448 });
371
+ const name = createHash2("sha256").update(`${product}:${version}`).digest("hex");
372
+ const file = await open(join2(directory, name), "wx", 384);
373
+ await file.close();
374
+ return true;
375
+ } catch {
376
+ return false;
377
+ }
378
+ }
364
379
  async function capture(version, product, command, outcome, path) {
365
380
  const config = telemetryConfig(version);
366
381
  if (!config)
@@ -382,15 +397,29 @@ async function capture(version, product, command, outcome, path) {
382
397
  "other",
383
398
  "create"
384
399
  ];
385
- await send(config, "cli_command", current.userId ?? current.anonymousId, {
400
+ const distinctId = current.userId ?? current.anonymousId;
401
+ const activation = outcome === "started" && await firstExecution(path, product, version);
402
+ const properties = {
386
403
  product,
387
404
  command: allowed.includes(command) ? command : "other",
388
405
  outcome,
389
406
  version,
407
+ ...activation ? { first_execution: true } : {},
390
408
  invocation: process.env.npm_command === "exec" ? "npx" : /^(npm|pnpm|yarn|bun)\//.exec(process.env.npm_config_user_agent ?? "")?.[1] ?? "direct",
391
409
  platform: ["darwin", "linux", "win32"].includes(process.platform) ? process.platform : "other",
392
410
  ...!current.userId ? { $process_person_profile: false } : {}
393
- });
411
+ };
412
+ const pending = [send(config, "cli_command", distinctId, properties)];
413
+ if (outcome === "failure") {
414
+ pending.push(send(config, "$exception", distinctId, {
415
+ ...properties,
416
+ $exception_list: [
417
+ { type: "CommandFailure", value: "Command failed" }
418
+ ],
419
+ $exception_fingerprint: `disposabl-${product}-${properties.command}`
420
+ }));
421
+ }
422
+ await Promise.allSettled(pending);
394
423
  } catch {}
395
424
  }
396
425
  async function prepareLogin(path) {
@@ -870,6 +899,7 @@ function formatPreview(preview) {
870
899
  // ../cli/commands.ts
871
900
  async function runCli(argv = process.argv, serviceOrigin = process.env.DISPOSABL_API_ORIGIN || SERVICE_ORIGIN) {
872
901
  const program = createProgram(serviceOrigin, true);
902
+ program.exitOverride();
873
903
  const origin = () => apiUrl(serviceOrigin);
874
904
  async function main() {
875
905
  if (needsContract(program, argv, serviceOrigin)) {
@@ -984,18 +1014,21 @@ Waiting for connections. Press Ctrl+C to keep your files and finish later.`);
984
1014
  }
985
1015
  await program.parseAsync(argv);
986
1016
  }
987
- const command = argv[2] ?? "help";
1017
+ const command = ["--version", "-V"].includes(argv[2] ?? "") ? "version" : ["--help", "-h"].includes(argv[2] ?? "") ? "help" : argv[2] ?? "help";
988
1018
  const central = serviceOrigin === SERVICE_ORIGIN;
989
- if (central)
990
- await capture(version, "cli", command, "started", telemetryStatePath());
1019
+ const started = central ? capture(version, "cli", command, "started", telemetryStatePath()) : undefined;
991
1020
  try {
992
1021
  await main();
1022
+ await started;
993
1023
  if (central)
994
1024
  await capture(version, "cli", command, "success", telemetryStatePath());
995
1025
  } catch (error) {
1026
+ await started;
1027
+ const success = error instanceof CommanderError && error.exitCode === 0;
996
1028
  if (central)
997
- await capture(version, "cli", command, "failure", telemetryStatePath());
998
- throw error;
1029
+ await capture(version, "cli", command, success ? "success" : "failure", telemetryStatePath());
1030
+ if (!success)
1031
+ throw error;
999
1032
  }
1000
1033
  }
1001
1034
 
package/dist/index.js CHANGED
@@ -1556,20 +1556,20 @@ var require_proper_lockfile = __commonJS(function(exports, module) {
1556
1556
  });
1557
1557
 
1558
1558
  // index.ts
1559
- import { execFileSync as execFileSync2, spawnSync as spawnSync3 } from "node:child_process";
1559
+ import { execFileSync as execFileSync3, spawnSync as spawnSync4 } from "node:child_process";
1560
1560
  import { lstatSync, readFileSync } from "node:fs";
1561
1561
  import { join as join8, resolve as resolve3 } from "node:path";
1562
1562
  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.17.5";
1566
+ var version = "0.18.0";
1567
1567
 
1568
1568
  // ../cli/telemetry.ts
1569
1569
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
1570
1570
  import { createHash as createHash2, randomUUID } from "node:crypto";
1571
1571
  import { realpathSync } from "node:fs";
1572
- import { mkdir as mkdir2, readFile as readFile2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
1572
+ import { mkdir as mkdir2, open as open2, readFile as readFile2, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
1573
1573
  import { homedir as homedir2 } from "node:os";
1574
1574
  import { dirname, join as join2 } from "node:path";
1575
1575
 
@@ -8759,6 +8759,18 @@ async function send(config, event, distinctId, properties) {
8759
8759
  });
8760
8760
  return response.ok;
8761
8761
  }
8762
+ async function firstExecution(path, product, version) {
8763
+ try {
8764
+ const directory = join2(dirname(path), "activations");
8765
+ await mkdir2(directory, { recursive: true, mode: 448 });
8766
+ const name = createHash2("sha256").update(`${product}:${version}`).digest("hex");
8767
+ const file = await open2(join2(directory, name), "wx", 384);
8768
+ await file.close();
8769
+ return true;
8770
+ } catch {
8771
+ return false;
8772
+ }
8773
+ }
8762
8774
  async function capture(version, product, command, outcome, path) {
8763
8775
  const config = telemetryConfig(version);
8764
8776
  if (!config)
@@ -8780,15 +8792,29 @@ async function capture(version, product, command, outcome, path) {
8780
8792
  "other",
8781
8793
  "create"
8782
8794
  ];
8783
- await send(config, "cli_command", current.userId ?? current.anonymousId, {
8795
+ const distinctId = current.userId ?? current.anonymousId;
8796
+ const activation = outcome === "started" && await firstExecution(path, product, version);
8797
+ const properties = {
8784
8798
  product,
8785
8799
  command: allowed.includes(command) ? command : "other",
8786
8800
  outcome,
8787
8801
  version,
8802
+ ...activation ? { first_execution: true } : {},
8788
8803
  invocation: process.env.npm_command === "exec" ? "npx" : /^(npm|pnpm|yarn|bun)\//.exec(process.env.npm_config_user_agent ?? "")?.[1] ?? "direct",
8789
8804
  platform: ["darwin", "linux", "win32"].includes(process.platform) ? process.platform : "other",
8790
8805
  ...!current.userId ? { $process_person_profile: false } : {}
8791
- });
8806
+ };
8807
+ const pending = [send(config, "cli_command", distinctId, properties)];
8808
+ if (outcome === "failure") {
8809
+ pending.push(send(config, "$exception", distinctId, {
8810
+ ...properties,
8811
+ $exception_list: [
8812
+ { type: "CommandFailure", value: "Command failed" }
8813
+ ],
8814
+ $exception_fingerprint: `disposabl-${product}-${properties.command}`
8815
+ }));
8816
+ }
8817
+ await Promise.allSettled(pending);
8792
8818
  } catch {}
8793
8819
  }
8794
8820
 
@@ -9104,6 +9130,7 @@ import {
9104
9130
  import { existsSync as existsSync2 } from "node:fs";
9105
9131
  import { basename, join as join4, normalize } from "node:path";
9106
9132
  import { randomUUID as randomUUID2 } from "node:crypto";
9133
+ import { execFileSync, spawnSync } from "node:child_process";
9107
9134
 
9108
9135
  // mobile-payments.ts
9109
9136
  import { existsSync } from "node:fs";
@@ -9197,6 +9224,8 @@ function validateAndroidArchitectures(values = defaultAndroidArchitectures) {
9197
9224
  var authStarterPaths = [
9198
9225
  "packages/disposabl-kit/client/routes/_auth-pages",
9199
9226
  "packages/disposabl-kit/client/routes/consent.tsx",
9227
+ "packages/tests/consent-identity.test.ts",
9228
+ "packages/tests/components/consent-identity.test.mjs",
9200
9229
  "packages/disposabl-kit/client/routes/billing-login.tsx",
9201
9230
  "packages/disposabl-kit/client/routes/_authenticated/change-password.tsx",
9202
9231
  "apps/web/src/router/_authenticated/dashboard.api-keys.tsx",
@@ -9257,6 +9286,15 @@ For Disposabl development and delivery, read [.agents/skills/disposabl-app/SKILL
9257
9286
  if (!folders.includes("apps/desktop") && /^desktop-.*\.test\.ts$/.test(entry) || !folders.includes("apps/mobile") && /^(mobile-.*|native-billing|ios-ota)\.test\.ts$/.test(entry))
9258
9287
  await rm4(join4(tests, entry));
9259
9288
  }
9289
+ if (!folders.includes("apps/mobile")) {
9290
+ await rm4(join4(tests, "helpers/mobile-simulator"), {
9291
+ recursive: true,
9292
+ force: true
9293
+ });
9294
+ const readme = join4(tests, "README.md");
9295
+ const text = await readFile4(readme, "utf8");
9296
+ await writeFile4(readme, text.replace(/<!-- mobile-simulator-preflight:start -->[\s\S]*?<!-- mobile-simulator-preflight:end -->\n?/, ""));
9297
+ }
9260
9298
  if (!config.features.includes("authentication")) {
9261
9299
  for (const path of authStarterPaths) {
9262
9300
  await rm4(join4(destination, path), { recursive: true, force: true });
@@ -9398,6 +9436,14 @@ main().catch((error) => {
9398
9436
  }
9399
9437
  await writeFile4(join4(destination, "disposabl.json"), JSON.stringify(config, null, 2) + `
9400
9438
  `);
9439
+ if (spawnSync("bun", ["fmt", "--no-script", "--help"], {
9440
+ cwd: destination,
9441
+ stdio: "ignore"
9442
+ }).status === 0)
9443
+ execFileSync("bun", ["fmt", "--no-script"], {
9444
+ cwd: destination,
9445
+ stdio: "pipe"
9446
+ });
9401
9447
  } catch (error) {
9402
9448
  await rm4(destination, { recursive: true, force: true });
9403
9449
  throw error;
@@ -9594,16 +9640,16 @@ async function reconfigureApp(template, directory, version, options) {
9594
9640
  }
9595
9641
 
9596
9642
  // setup.ts
9597
- import { execFileSync, spawn, spawnSync as spawnSync2 } from "node:child_process";
9643
+ import { execFileSync as execFileSync2, spawn, spawnSync as spawnSync3 } from "node:child_process";
9598
9644
  import { readFile as readFile6, writeFile as writeFile6 } from "node:fs/promises";
9599
9645
  import { basename as basename4, join as join7 } from "node:path";
9600
9646
  import { fileURLToPath } from "node:url";
9601
9647
 
9602
9648
  // ../cli/preview.ts
9603
9649
  import { basename as basename3, join as join6, resolve as resolve2 } from "node:path";
9604
- import { spawnSync } from "node:child_process";
9650
+ import { spawnSync as spawnSync2 } from "node:child_process";
9605
9651
  function detectReference(directory = process.cwd()) {
9606
- const git = (...args) => spawnSync("git", args, { cwd: directory, encoding: "utf8" }).stdout?.trim();
9652
+ const git = (...args) => spawnSync2("git", args, { cwd: directory, encoding: "utf8" }).stdout?.trim();
9607
9653
  const branch = git("symbolic-ref", "--quiet", "--short", "HEAD");
9608
9654
  if (branch)
9609
9655
  return branch;
@@ -9690,7 +9736,7 @@ async function setupApp(directory, name, run = runDisposabl) {
9690
9736
  config.appId = app.appId;
9691
9737
  await writeFile6(path, JSON.stringify(config, null, 2) + `
9692
9738
  `);
9693
- execFileSync("bun", ["fmt", "disposabl.json"], {
9739
+ execFileSync2("bun", ["fmt", "disposabl.json"], {
9694
9740
  cwd: directory,
9695
9741
  stdio: "pipe"
9696
9742
  });
@@ -9748,9 +9794,9 @@ async function install(directory, interactive) {
9748
9794
  });
9749
9795
  }
9750
9796
  function commitApp(directory) {
9751
- const git = (...args) => execFileSync("git", args, { cwd: directory, stdio: "pipe" });
9797
+ const git = (...args) => execFileSync2("git", args, { cwd: directory, stdio: "pipe" });
9752
9798
  git("add", "--all");
9753
- const hasIdentity = spawnSync2("git", ["var", "GIT_AUTHOR_IDENT"], {
9799
+ const hasIdentity = spawnSync3("git", ["var", "GIT_AUTHOR_IDENT"], {
9754
9800
  cwd: directory,
9755
9801
  stdio: "ignore"
9756
9802
  }).status === 0;
@@ -9884,7 +9930,7 @@ async function main() {
9884
9930
  return;
9885
9931
  }
9886
9932
  const appId = await setupApp(directory, name);
9887
- if (spawnSync3("git", ["rev-parse", "--verify", "HEAD"], {
9933
+ if (spawnSync4("git", ["rev-parse", "--verify", "HEAD"], {
9888
9934
  cwd: directory,
9889
9935
  stdio: "ignore"
9890
9936
  }).status !== 0)
@@ -9944,9 +9990,9 @@ Setup complete.
9944
9990
  const setup = options.json ? undefined : projectSetup(name, config);
9945
9991
  let installationStarted = false;
9946
9992
  try {
9947
- if (spawnSync3("git", ["--version"], { stdio: "ignore" }).status !== 0)
9993
+ if (spawnSync4("git", ["--version"], { stdio: "ignore" }).status !== 0)
9948
9994
  throw new Error("Install Git first to create the app's initial commit.");
9949
- const hasBun = spawnSync3("bun", ["--version"], { stdio: "ignore" }).status === 0;
9995
+ const hasBun = spawnSync4("bun", ["--version"], { stdio: "ignore" }).status === 0;
9950
9996
  if (!options.skipInstall && !hasBun)
9951
9997
  throw new Error("Install Bun first, or pass --skip-install to create the files only.");
9952
9998
  const template = fileURLToPath2(new URL("./templates/default", import.meta.url));
@@ -9956,8 +10002,6 @@ Setup complete.
9956
10002
  setup?.installing();
9957
10003
  await install(directory, Boolean(setup?.live));
9958
10004
  }
9959
- if (hasBun)
9960
- execFileSync2("bun", ["fmt"], { cwd: directory, stdio: "pipe" });
9961
10005
  setup?.finish({
9962
10006
  installation: options.skipInstall ? "Skipped" : "Complete"
9963
10007
  });
@@ -9967,7 +10011,7 @@ Setup complete.
9967
10011
  });
9968
10012
  throw error;
9969
10013
  }
9970
- execFileSync2("git", ["init", "--initial-branch=main"], {
10014
+ execFileSync3("git", ["init", "--initial-branch=main"], {
9971
10015
  cwd: directory,
9972
10016
  stdio: "pipe"
9973
10017
  });
@@ -9993,11 +10037,13 @@ Next steps
9993
10037
  `);
9994
10038
  }
9995
10039
  }
9996
- await capture(version, "generator", "create", "started", telemetryStatePath());
10040
+ var started = capture(version, "generator", "create", "started", telemetryStatePath());
9997
10041
  try {
9998
10042
  await main();
10043
+ await started;
9999
10044
  await capture(version, "generator", "create", "success", telemetryStatePath());
10000
10045
  } catch (error) {
10046
+ await started;
10001
10047
  await capture(version, "generator", "create", error instanceof CommanderError && error.exitCode === 0 ? "success" : error instanceof Cancelled ? "cancelled" : "failure", telemetryStatePath());
10002
10048
  if (error instanceof CommanderError && error.exitCode === 0) {
10003
10049
  process.exitCode = 0;
@@ -191,6 +191,37 @@ Backend URLs are available to mobile code through
191
191
  `process.env.EXPO_PUBLIC_CONVEX_SITE_URL`. The distribution workflow supplies
192
192
  them to the same native authentication flow used during development.
193
193
 
194
+ ## Local Google Play bundle
195
+
196
+ The normal release workflow continues to produce installable APKs. For a Play
197
+ upload, first verify the existing listing package ID, highest uploaded version
198
+ code, and upload certificate SHA-256 in Play Console. For a new listing, use
199
+ its confirmed package ID and `0` as the previous version. Do not use a debug
200
+ key for a Play submission.
201
+
202
+ Use a dedicated local checkout configured for the confirmed package and version.
203
+ The script generates a fresh production Android project. Configure the intended
204
+ production backend URLs explicitly and set these environment variables:
205
+
206
+ - `PLAY_PACKAGE_ID`, `PLAY_PREVIOUS_VERSION_CODE`, `PLAY_UPLOAD_CERT_SHA256`
207
+ - `DISPOSABL_ANDROID_VERSION_CODE` (greater than the previous version)
208
+ - `EXPO_PUBLIC_CONVEX_URL`, `EXPO_PUBLIC_CONVEX_SITE_URL` (HTTPS)
209
+ - `ANDROID_KEYSTORE_PATH`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`,
210
+ `ANDROID_KEY_PASSWORD`
211
+ - `BUNDLETOOL_JAR`, the local path to the official standalone bundletool jar
212
+
213
+ Run `node apps/mobile/scripts/play-aab.mjs` from the repository root. It checks
214
+ the keystore certificate and Expo identity, then moves any existing `android`
215
+ directory to a printed temporary backup path and runs a fresh Expo prebuild.
216
+ Native customizations must be represented in Expo config/plugins; stale native
217
+ files are never reused. A failed prebuild restores the previous directory and
218
+ preserves partial output in the backup. Keep the upload keystore and bundletool
219
+ jar outside `android`; relative input paths resolve from the command's working directory.
220
+ The build uses the configured Android architectures and verifies the AAB's manifest,
221
+ ABIs and upload signature. It prints the output path and SHA-256. It does not
222
+ upload or submit the bundle. Keep signing values out of shell history and logs.
223
+ A debug-signed or E2E bundle is not a Play release.
224
+
194
225
  ## iOS
195
226
 
196
227
  When iOS is enabled and affected, the Web runner checks the latest
@@ -218,3 +249,12 @@ It does not require TestFlight or an App Store Connect app record. TestFlight is
218
249
  a separate distribution option. The pipeline never submits to the App Store.
219
250
 
220
251
  Android preview builds produce an installable APK. Production builds produce a signed installable APK. GitHub Actions builds and publishes these files; Expo hosts compatible EAS Updates.
252
+
253
+ ### iOS image privacy manifest
254
+
255
+ The iOS Expo autolinking configuration builds `expo-image` from source so its
256
+ SDWebImage CocoaPod supplies its own privacy resource bundle. The Expo 58
257
+ precompiled SDWebImage framework inspected for this app did not include that
258
+ manifest. This changes native dependencies and may increase build time; regenerate
259
+ the native project and reinstall pods after changing it. Check the final archive
260
+ and Xcode privacy report for each release, especially after SDK upgrades.
@@ -46,11 +46,42 @@ module.exports = ({ config }) => {
46
46
  );
47
47
  }
48
48
  }
49
+ const plugins = config.plugins || [];
50
+ const isBuildProperties = (plugin) =>
51
+ (Array.isArray(plugin) ? plugin[0] : plugin) === "expo-build-properties";
52
+ const buildProperties = plugins
53
+ .filter(isBuildProperties)
54
+ .reduce((merged, plugin) => {
55
+ const options = Array.isArray(plugin) ? plugin[1] || {} : {};
56
+ return {
57
+ ...merged,
58
+ ...options,
59
+ android: { ...merged.android, ...options.android },
60
+ ios: {
61
+ ...merged.ios,
62
+ ...options.ios,
63
+ extraPods: [
64
+ ...(merged.ios?.extraPods || []),
65
+ ...(options.ios?.extraPods || []),
66
+ ],
67
+ },
68
+ };
69
+ }, {});
70
+ // 5.2.4 omits the collected-data array used by Xcode's privacy report.
71
+ // Revisit when https://github.com/ashleymills/Reachability.swift/issues/423 is fixed.
72
+ const extraPods = (buildProperties.ios?.extraPods || []).filter(
73
+ (pod) => pod.name !== "ReachabilitySwift",
74
+ );
49
75
  return {
50
76
  ...config,
51
77
  scheme:
52
78
  process.env.EXPO_PUBLIC_E2E === "true" && process.env.E2E_ANDROID_SCHEME
53
- ? [process.env.E2E_ANDROID_SCHEME]
79
+ ? [
80
+ ...new Set([
81
+ process.env.E2E_ANDROID_SCHEME,
82
+ ...(paymentsEnabled ? [billingScheme] : []),
83
+ ]),
84
+ ]
54
85
  : [
55
86
  ...new Set([
56
87
  ...[config.scheme || []].flat(),
@@ -84,8 +115,21 @@ module.exports = ({ config }) => {
84
115
  versionCode,
85
116
  },
86
117
  plugins: [
87
- ...(config.plugins || []),
118
+ ...plugins.filter((plugin) => !isBuildProperties(plugin)),
88
119
  "./plugins/with-android-signing.js",
120
+ [
121
+ "expo-build-properties",
122
+ {
123
+ ...buildProperties,
124
+ ios: {
125
+ ...buildProperties.ios,
126
+ extraPods: [
127
+ ...extraPods,
128
+ { name: "ReachabilitySwift", version: "5.2.3" },
129
+ ],
130
+ },
131
+ },
132
+ ],
89
133
  ...(process.env.EXPO_PUBLIC_E2E === "true"
90
134
  ? [
91
135
  ...(process.env.E2E_ANDROID_LOOPBACK === "true"
@@ -10,6 +10,7 @@
10
10
  "@expo/vector-icons": "^15.0.2",
11
11
  "convex": "catalog:",
12
12
  "expo": "~58.0.23",
13
+ "expo-build-properties": "~58.0.11",
13
14
  "expo-clipboard": "~58.0.4",
14
15
  "expo-constants": "~58.0.15",
15
16
  "expo-dev-client": "~58.0.18",
@@ -65,7 +66,12 @@
65
66
  "react",
66
67
  "convex",
67
68
  "@convex-dev/auth"
68
- ]
69
+ ],
70
+ "ios": {
71
+ "buildFromSource": [
72
+ "expo-image"
73
+ ]
74
+ }
69
75
  }
70
76
  }
71
77
  }
@@ -15,7 +15,8 @@ if (System.getenv("DISPOSABL_ANDROID_CHANNEL") == "production") {
15
15
  android {
16
16
  signingConfigs {
17
17
  disposablRelease {
18
- storeFile file(System.getenv("ANDROID_KEYSTORE_PATH"))
18
+ def storePath = System.getenv("ANDROID_KEYSTORE_PATH")
19
+ if (storePath) storeFile file(storePath)
19
20
  storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
20
21
  keyAlias System.getenv("ANDROID_KEY_ALIAS")
21
22
  keyPassword System.getenv("ANDROID_KEY_PASSWORD")
@@ -23,6 +24,27 @@ if (System.getenv("DISPOSABL_ANDROID_CHANNEL") == "production") {
23
24
  }
24
25
  buildTypes.release.signingConfig = signingConfigs.disposablRelease
25
26
  }
27
+ // AGP omits its signing validator when any input is missing. Gate actual
28
+ // release packaging task types so a production artifact cannot be unsigned.
29
+ def signingCheck = tasks.register("validateDisposablProductionSigning") {
30
+ doLast {
31
+ def required = ["ANDROID_KEYSTORE_PATH", "ANDROID_KEYSTORE_PASSWORD", "ANDROID_KEY_ALIAS", "ANDROID_KEY_PASSWORD"]
32
+ if (required.any { !System.getenv(it) }) {
33
+ throw new GradleException("Production Android signing inputs are required.")
34
+ }
35
+ }
36
+ }
37
+ def releaseVariants = [] as Set
38
+ androidComponents.onVariants(androidComponents.selector().withBuildType("release")) { variant ->
39
+ releaseVariants.add(variant.name)
40
+ }
41
+ [com.android.build.gradle.tasks.PackageAndroidArtifact,
42
+ com.android.build.gradle.internal.tasks.PackageBundleTask,
43
+ com.android.build.gradle.internal.tasks.FinalizeBundleTask].each { taskType ->
44
+ tasks.withType(taskType).configureEach { task ->
45
+ task.dependsOn(providers.provider { releaseVariants.contains(task.variantName) ? [signingCheck] : [] })
46
+ }
47
+ }
26
48
  }
27
49
  `;
28
50
  return mod;
@@ -0,0 +1,24 @@
1
+ import { existsSync, mkdtempSync, renameSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+
5
+ // Prebuild must start without an Android project: updating one in place can
6
+ // retain old intent filters, update metadata, or E2E dev-client settings.
7
+ export function freshAndroid(mobile, prebuild) {
8
+ const android = join(mobile, "android");
9
+ const saved = mkdtempSync(join(tmpdir(), "disposabl-play-native-"));
10
+ const previous = join(saved, "android");
11
+ const hadPrevious = existsSync(android);
12
+ if (hadPrevious) renameSync(android, previous);
13
+ console.error(`Preserved native build files: ${saved}`);
14
+ try {
15
+ prebuild();
16
+ if (!existsSync(join(android, "app/build.gradle")))
17
+ throw new Error("Prebuild did not create an Android app");
18
+ } catch (error) {
19
+ if (existsSync(android)) renameSync(android, join(saved, "failed-android"));
20
+ if (hadPrevious) renameSync(previous, android);
21
+ throw error;
22
+ }
23
+ return saved;
24
+ }