create-disposabl-app 0.10.2 → 0.10.4

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.
@@ -14,3 +14,4 @@ dist/
14
14
  *.tsbuildinfo
15
15
 
16
16
  .cache/
17
+ .e2e/
@@ -3,6 +3,8 @@
3
3
  "private": true,
4
4
  "scripts": {
5
5
  "check": "bun run generate && turbo run typecheck lint && bun fmt --check",
6
+ "test": "bun run --cwd packages/tests test",
7
+ "e2e": "bun run --cwd packages/tests e2e",
6
8
  "build": "turbo build",
7
9
  "dev": "turbo dev",
8
10
  "lint": "turbo lint",
@@ -20,7 +22,7 @@
20
22
  },
21
23
  "packageManager": "bun@1.4.4",
22
24
  "engines": {
23
- "node": ">=22.12.0"
25
+ "node": "^22.22.3 || >=24.8.0"
24
26
  },
25
27
  "workspaces": [
26
28
  "apps/*",
@@ -9,7 +9,7 @@ Build the user's requested app and keep its preview visible. Preserve their chos
9
9
 
10
10
  ## Create and configure
11
11
 
12
- On a fresh machine, check Bun, Git, and Node.js 22.12 or newer. Report a missing prerequisite and follow its official installation instructions; do not assume another machine's tools, login, or credentials exist here.
12
+ On a fresh machine, check Bun, Git, and Node.js 24.8 or newer. Report a missing prerequisite and follow its official installation instructions; do not assume another machine's tools, login, or credentials exist here.
13
13
 
14
14
  Discover platform and feature IDs, then create the app with explicit selections:
15
15
 
@@ -35,6 +35,16 @@ Choose a visual direction suited to the product. Use `frontend-design` when avai
35
35
 
36
36
  Read [delivery checks](references/delivery.md) before native builds or delivery repairs. Aim to show a usable web preview early; first native builds can take longer. Do not promise a build deadline.
37
37
 
38
+ Prefer local development, builds, and verification whenever the toolchain is available. Do not push or start GitHub Actions merely to test changes. Use the existing release workflows for authorized publication.
39
+
40
+ ## Testing
41
+
42
+ Read `packages/tests/README.md`. Keep behavior tests in that workspace and use `bun run e2e guide` for the installed E2E documentation. Extend deterministic flows as features change, then run `bun run test` before delivery. No E2E login or model subscription is required. Backend checks always run; web and native targets follow `disposabl.json`, and API checks require the API platform.
43
+
44
+ For a scoped run, use `bun run test --target web,backend` or a selected native target. Build and install mobile apps locally first and keep Metro running for debug builds. Report the exact targets verified and any unavailable platform; do not turn missing devices into passing or silently skipped tests. E2E telemetry stays disabled until Disposabl controls its preference.
45
+
46
+ ## Publish a preview
47
+
38
48
  A generated app already has an Initial commit and a provisioned Git remote. For authorized delivery, publish that scaffold to `main`, then develop on an isolated feature branch/worktree:
39
49
 
40
50
  ```sh
@@ -80,7 +90,7 @@ user, open the free account signup in a separate tab and have them return to
80
90
  Disposabl after signup. Then install Disposabl, choose their account on GitHub,
81
91
  and finish authorization. A clicked link does not prove setup is complete; wait
82
92
  for the connected account to appear. Connect Convex next, and Expo for mobile apps.
83
- Builds use standard GitHub-hosted runners; GitHub Actions usage limits apply.
93
+ Prefer local builds when possible. Hosted publication has provider usage limits.
84
94
  Your code and app data stay in your accounts; Disposabl stores encrypted
85
95
  connection credentials and setup metadata. Link the open-source repository
86
96
  when explaining access: https://github.com/disposabl-dev/create-disposabl-app.
@@ -4,11 +4,12 @@ Read before a first native build, a toolchain change, or a failed preview/produc
4
4
 
5
5
  ## Before expensive builds
6
6
 
7
+ - Build and test locally when the toolchain is available. Use `bun run test` for E2E behavior checks; read `packages/tests/README.md` for backend setup, target selection, and mobile prerequisites. Do not trigger GitHub Actions just to validate a local edit. Use release workflows when publication is requested.
7
8
  - Verify GitHub and Convex connections after a browser reload. A completed OAuth screen does not prove that the callback saved a usable connection. Preserve the pending provider across redirects and inspect the account actually selected.
8
9
  - Use managed setup and a worktree-scoped development token. If `bun run dev` asks to create or select a Convex project, repair setup instead of creating a personal project. Local worktree, PR preview, and production are separate deployments.
9
10
  - Check the generated files, not only the generator source. Confirm the package includes `.github`, helper scripts, native packaging assets, and this skill. Check that provisioned secret names match workflow inputs without printing their values.
10
11
  - Run shared delivery helpers from the working directories used by their callers. Resolve repository configuration relative to the helper module; an iOS job running in `apps/mobile` previously failed before EAS because the reporter looked for `disposabl.json` in that directory.
11
- - Inspect the native dependency's compiler requirements and the selected runner's installed Xcode/Swift versions. Pin a compatible toolchain; do not assume the runner default is compatible or disable concurrency diagnostics to make a build pass.
12
+ - Inspect the native dependency's compiler requirements and the local machine's installed Xcode/Swift versions. For an authorized hosted build, check its runner too. Pin a compatible toolchain; do not assume the default is compatible or disable concurrency diagnostics to make a build pass.
12
13
  - For iOS simulator builds using SecureStore, retain Xcode simulator signing (`CODE_SIGNING_ALLOWED=YES CODE_SIGN_IDENTITY=-`). Disabling signing can omit the embedded application identifier and cause Keychain error `-34018`, leaving session initialization stuck. Inspect the executable's `__TEXT,__entitlements` section, not just `codesign` output; simulator entitlements are embedded during linking. Verify login and persistence after relaunch before accepting the archive. Simulator ad-hoc signing does not establish device signing or TestFlight readiness.
13
14
  - Verify production Android signing is configured before compiling. Check Apple signing and App Store Connect readiness separately; a simulator archive does not establish TestFlight readiness. Do not infer store submission authorization from build authorization.
14
15
  - Use the job-scoped GitHub token for same-repository reads. Obtain installation tokens in publishing jobs when needed. A credential accepted before a long build may fail afterward; check both stages rather than diagnosing every failed job as a compile failure.
@@ -0,0 +1,53 @@
1
+ # End-to-end testing
2
+
3
+ This private workspace tests Disposabl and generated apps using [TesterArmy E2E](https://github.com/tester-army/e2e). Tests stay outside application bundles. The generator includes this workspace without adding setup questions. No E2E login, model, subscription, or API key is required.
4
+
5
+ ```sh
6
+ bun run test # all configured targets
7
+ bun run test --target web,backend # a scoped local or CI run
8
+ bun run test --target android # an installed Android app
9
+ bun run test --target ios # an installed iOS app
10
+ bun run e2e list # discovered flows and targets
11
+ bun run e2e guide # installed version's documentation
12
+ ```
13
+
14
+ Use Node `^22.22.3 || >=24.8.0` and Bun. `bun run test` installs the pinned Chromium browser if missing, then runs E2E. It does not build native apps, provision a new backend, or authenticate a model provider. Prefer local builds and test runs; publishing a PR is not a prerequisite for testing.
15
+
16
+ ## Targets and environment
17
+
18
+ `e2e.config.ts` reads root `disposabl.json`. Backend checks always apply. Web uses Chromium; selected Android/iOS platforms use the mobile engine. API uses an engine-free target only when `api` is selected. MCP, CLI, SDK, and desktop are not additional E2E engines; these starter flows do not claim to verify those clients.
19
+
20
+ Run `bun run dev` once to configure this app's managed development environment and synchronize backend functions. Tests read `packages/backend/.env.local` and `apps/web/.env.local`, with shell/CI variables taking precedence. Keep the backend synchronized while developing. The runner starts and stops an isolated Vite server on a free port. Set `E2E_WEB_URL` to test an already running app instead.
21
+
22
+ For an isolated preview or CI deployment, set `E2E_CONVEX_URL` and `E2E_CONVEX_SITE_URL`. Otherwise the checks use `CONVEX_URL` and `CONVEX_SITE_URL`. Use the backend for the exact source revision under test. A passing check against an old deployment does not verify changed backend code.
23
+
24
+ The initial flows check the public web page, the dashboard's authentication boundary, an anonymous backend auth query, the API contract when enabled, and the mobile home screen. They do not create users or modify data. Add product-specific flows here as behavior changes, including login and saved-state checks using dedicated test users. Keep required flows deterministic; an agent can write and debug tests without adding model calls to their execution.
25
+
26
+ ## Mobile
27
+
28
+ Use a development build, not Expo Go. From the repository root:
29
+
30
+ ```sh
31
+ bun run --cwd apps/mobile ios # macOS/Xcode; builds and installs locally
32
+ bun run --cwd apps/mobile android # Android SDK; builds and installs locally
33
+ ```
34
+
35
+ Debug builds need Metro running with the current source. A release build embeds JavaScript and must be rebuilt after changes. Configure the app's backend URLs before building. Missing SDKs, devices, or installed apps are setup failures, not passing tests.
36
+
37
+ The config evaluates `apps/mobile/app.config.js` to use the same bundle IDs and channel as the build. Match `DISPOSABL_MOBILE_CHANNEL` to the installed app. Override with `E2E_IOS_APP_ID` or `E2E_ANDROID_APP_ID` when testing a different artifact. Set `E2E_IOS_DEVICE` to a simulator name/UDID or `E2E_ANDROID_DEVICE` to an emulator serial to reserve a specific device. Keep each device under one owner's control.
38
+
39
+ ## CI
40
+
41
+ The same commands work in CI without model credentials. On Linux, install Chromium's system dependencies with `bun run --cwd packages/tests setup:browser`. Provision an isolated backend and deploy the current functions before testing. Set its URLs, then run `bun run test --target web,backend` and include `,api` when `disposabl.json` enables it.
42
+
43
+ Run Android separately on a runner with an emulator and iOS on macOS with Xcode and a simulator. Build/install the test artifact before its E2E run. Gate publication on the required target results; native E2E cannot run before an app exists to install. This setup does not replace or automatically gate the repository's existing deployment workflows.
44
+
45
+ Upload `packages/tests/.e2e/report.json`, `junit.xml`, and `results/` even after failure. Reports and screenshots can contain app data, so keep them out of source control. A scoped run proves only the named targets, not the entire app.
46
+
47
+ ## Telemetry and optional AI
48
+
49
+ Both `bun run test` and `bun run e2e ...` set `E2E_TELEMETRY_DISABLED=1`. Keep using those wrappers: directly invoking the upstream binary bypasses that setting. No PostHog reporter is installed, and app analytics is production-only. A future Disposabl telemetry preference will control whether testing metrics are sent centrally.
50
+
51
+ Upstream telemetry otherwise sends command/engine/runtime versions, environment categories, durations, test counts, error codes, and AI/cache usage to the maintainers' PostHog project. It excludes test titles, source, URLs, screenshots, prompts, credentials, and error messages. See [the event inventory](https://github.com/tester-army/e2e/blob/main/docs/telemetry.mdx) and [transport source](https://github.com/tester-army/e2e/blob/main/packages/e2e/src/telemetry/posthog.ts).
52
+
53
+ AI is optional. To add it later, read `bun run e2e guide setup` and configure a provider or the upstream Codex/Claude Code ACP adapter. Keep model-backed flows separate from the required deterministic suite; an AI key appearing in the environment must not silently change the build gate or start spending.
@@ -0,0 +1,89 @@
1
+ import type { E2EConfig } from "e2e";
2
+ import { web } from "@e2e-dev/web";
3
+ import { createRequire } from "node:module";
4
+ import { join } from "node:path";
5
+ import { project, root } from "./project.ts";
6
+
7
+ const targets: E2EConfig["targets"][number][] = [
8
+ { name: "backend", platform: "backend" },
9
+ {
10
+ name: "web",
11
+ engine: web(),
12
+ app: {
13
+ url: process.env.E2E_WEB_URL || "http://127.0.0.1:0",
14
+ ...(!process.env.E2E_WEB_URL && {
15
+ command: {
16
+ executable: "bun",
17
+ args: [
18
+ "x",
19
+ "--no-install",
20
+ "vite",
21
+ "dev",
22
+ "--host",
23
+ "127.0.0.1",
24
+ "--port",
25
+ "{port}",
26
+ "--strictPort",
27
+ ],
28
+ cwd: join(root, "apps/web"),
29
+ inheritEnv: ["VITE_*"],
30
+ env: {
31
+ ...(process.env.E2E_CONVEX_URL || process.env.CONVEX_URL
32
+ ? {
33
+ VITE_CONVEX_URL:
34
+ process.env.E2E_CONVEX_URL || process.env.CONVEX_URL!,
35
+ }
36
+ : {}),
37
+ ...(process.env.E2E_CONVEX_SITE_URL || process.env.CONVEX_SITE_URL
38
+ ? {
39
+ VITE_CONVEX_SITE_URL:
40
+ process.env.E2E_CONVEX_SITE_URL ||
41
+ process.env.CONVEX_SITE_URL!,
42
+ }
43
+ : {}),
44
+ },
45
+ startupTimeout: 120_000,
46
+ },
47
+ }),
48
+ },
49
+ },
50
+ ];
51
+
52
+ const native = project.platforms.filter(
53
+ (platform): platform is "ios" | "android" =>
54
+ platform === "ios" || platform === "android",
55
+ );
56
+ if (native.length) {
57
+ const { mobile } = await import("@e2e-dev/mobile");
58
+ // Expo normally supplies these while evaluating app.config.js. A web-only
59
+ // CI job may provide just the backend URLs, but still loads all targets.
60
+ for (const name of ["CONVEX_URL", "CONVEX_SITE_URL"])
61
+ if (process.env[name] && !process.env[`EXPO_PUBLIC_${name}`])
62
+ process.env[`EXPO_PUBLIC_${name}`] = process.env[name];
63
+ const require = createRequire(import.meta.url);
64
+ const app = require(join(root, "apps/mobile/app.config.js"))({
65
+ config: require(join(root, "apps/mobile/app.json")).expo,
66
+ });
67
+ for (const platform of native)
68
+ targets.push({
69
+ name: platform,
70
+ engine: mobile({
71
+ platform,
72
+ device: process.env[`E2E_${platform.toUpperCase()}_DEVICE`],
73
+ }),
74
+ app: {
75
+ bundleId:
76
+ process.env[`E2E_${platform.toUpperCase()}_APP_ID`] ||
77
+ (platform === "ios" ? app.ios.bundleIdentifier : app.android.package),
78
+ },
79
+ });
80
+ }
81
+ if (project.platforms.includes("api"))
82
+ targets.push({ name: "api", platform: "api" });
83
+
84
+ export default {
85
+ tests: ["flows/**/*.e2e.ts"],
86
+ targets,
87
+ workers: 1,
88
+ reporters: ["list", "junit"],
89
+ } satisfies E2EConfig;
@@ -0,0 +1,14 @@
1
+ import { test, expect } from "e2e";
2
+ import { siteUrl } from "../project.ts";
3
+
4
+ test("enabled API publishes its contract", { platforms: ["api"] }, async () => {
5
+ const response = await fetch(`${siteUrl()}/openapi.json`, {
6
+ signal: AbortSignal.timeout(15_000),
7
+ });
8
+ expect(response.status).toBe(200);
9
+ expect(response.headers.get("content-type")).toContain("application/json");
10
+ const contract = await response.json();
11
+ expect(contract.openapi).toMatch(/^3\./);
12
+ expect(typeof contract.paths).toBe("object");
13
+ expect(contract.paths).not.toBeNull();
14
+ });
@@ -0,0 +1,24 @@
1
+ import { test, expect } from "e2e";
2
+ import { backendUrl } from "../project.ts";
3
+
4
+ test(
5
+ "backend recognizes an unauthenticated request",
6
+ { platforms: ["backend"] },
7
+ async () => {
8
+ const response = await fetch(`${backendUrl()}/api/query`, {
9
+ method: "POST",
10
+ headers: { "Content-Type": "application/json" },
11
+ body: JSON.stringify({
12
+ path: "auth:isAuthenticated",
13
+ args: {},
14
+ format: "json",
15
+ }),
16
+ signal: AbortSignal.timeout(15_000),
17
+ });
18
+ expect(response.status).toBe(200);
19
+ expect(await response.json()).toMatchObject({
20
+ status: "success",
21
+ value: false,
22
+ });
23
+ },
24
+ );
@@ -0,0 +1,10 @@
1
+ import { test, expect } from "e2e";
2
+
3
+ test(
4
+ "mobile home renders",
5
+ { platforms: ["ios", "android"] },
6
+ async ({ app, screen }) => {
7
+ await app.open();
8
+ await expect(screen.getByText("Welcome to Disposabl")).toBeVisible();
9
+ },
10
+ );
@@ -0,0 +1,27 @@
1
+ import { test } from "@e2e-dev/web";
2
+ import { expect } from "e2e";
3
+ import { project } from "../project.ts";
4
+
5
+ test(
6
+ "public home renders",
7
+ { platforms: ["web"] },
8
+ async ({ app, browser }) => {
9
+ await app.open("/");
10
+ await expect(browser.locator("main h1")).toBeVisible();
11
+ },
12
+ );
13
+
14
+ test(
15
+ "dashboard respects the authentication feature",
16
+ { platforms: ["web"] },
17
+ async ({ app, screen }) => {
18
+ await app.open("/dashboard");
19
+ if (project.features.includes("authentication")) {
20
+ await expect(screen.getByLabel("Username")).toBeVisible();
21
+ await expect(screen.getByLabel("Password")).toBeVisible();
22
+ await expect(screen.getByRole("button", "Log in")).toBeVisible();
23
+ } else {
24
+ await expect(screen.getByRole("heading", "Dashboard")).toBeVisible();
25
+ }
26
+ },
27
+ );
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@disposabl/tests",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "test": "bun run e2e run",
7
+ "setup:browser": "E2E_TELEMETRY_DISABLED=1 e2e-web install chromium --with-deps",
8
+ "e2e": "E2E_TELEMETRY_DISABLED=1 e2e",
9
+ "typecheck": "tsc --noEmit",
10
+ "format": "bun fmt"
11
+ },
12
+ "devDependencies": {
13
+ "@e2e-dev/mobile": "0.12.5",
14
+ "@e2e-dev/web": "0.15.4",
15
+ "@types/node": "^24",
16
+ "e2e": "0.22.0",
17
+ "typescript": "^6.0.2"
18
+ }
19
+ }
@@ -0,0 +1,35 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { loadEnvFile } from "node:process";
3
+ import { fileURLToPath } from "node:url";
4
+ import { join } from "node:path";
5
+
6
+ export const root = fileURLToPath(new URL("../../", import.meta.url));
7
+ export const project = JSON.parse(
8
+ readFileSync(join(root, "disposabl.json"), "utf8"),
9
+ ) as { platforms: string[]; features: string[] };
10
+
11
+ // Existing shell/CI variables take precedence. No credentials are copied.
12
+ for (const file of [
13
+ "packages/backend/.env.local",
14
+ "apps/web/.env.local",
15
+ "apps/mobile/.env.local",
16
+ ])
17
+ if (existsSync(join(root, file))) loadEnvFile(join(root, file));
18
+
19
+ export function backendUrl() {
20
+ const url = process.env.E2E_CONVEX_URL || process.env.CONVEX_URL;
21
+ if (!url)
22
+ throw new Error(
23
+ "Configure this app's development environment with bun run dev, or set E2E_CONVEX_URL for an isolated test backend.",
24
+ );
25
+ return url.replace(/\/$/, "");
26
+ }
27
+
28
+ export function siteUrl() {
29
+ const url = process.env.E2E_CONVEX_SITE_URL || process.env.CONVEX_SITE_URL;
30
+ if (!url)
31
+ throw new Error(
32
+ "Set E2E_CONVEX_SITE_URL or CONVEX_SITE_URL for API checks.",
33
+ );
34
+ return url.replace(/\/$/, "");
35
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "strict": true,
7
+ "noEmit": true,
8
+ "skipLibCheck": true,
9
+ "allowImportingTsExtensions": true,
10
+ "types": ["node"]
11
+ },
12
+ "include": ["*.ts", "flows/**/*.ts"]
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,15 +0,0 @@
1
- # App builds
2
-
3
- Install Disposabl on your personal GitHub account or an organization you administer,
4
- then connect Convex. New GitHub users can create a free personal account first.
5
- An organization is optional. No separate runner service is required.
6
-
7
- Web, Android and Linux desktop builds use GitHub-hosted `ubuntu-24.04` runners.
8
- Windows desktop uses `windows-2025`; macOS desktop and iOS simulator previews use
9
- `macos-26` with its default Xcode. Production iOS uses EAS Build. Package
10
- publishing and protected release jobs use GitHub-hosted Ubuntu.
11
-
12
- Generated apps include these runner settings. Existing app repositories retain
13
- the workflow they were created with until it is updated.
14
- GitHub Actions and other services have usage limits; charges may apply beyond
15
- included allowances. See [GitHub-hosted runners](https://docs.github.com/en/actions/reference/runners/github-hosted-runners).