create-disposabl-app 0.20.23 → 0.20.24

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/README.md CHANGED
@@ -101,6 +101,8 @@ bunx --package create-disposabl-app disposabl previews token create --configure
101
101
 
102
102
  Push the generated initial commit to `main` before opening feature pull requests. A same-repository pull request to `main` starts a CI preview; changes pushed to `main` start the production workflow. A feature branch push by itself does not deploy. Desktop installers build only on pushes to `main`, when their inputs change; PRs retain web and mobile previews. Build and delivery requirements depend on the selected platforms.
103
103
 
104
+ Before pushing implementation commits, run `bun run check:preview` from a clean checkout of the intended commit with the app's development web URLs configured. It runs the pipeline checks and a production web build locally. When you change Convex functions or schemas, run `bun run dev` to regenerate the bindings and commit the changes under `packages/backend/convex/_generated` with the source.
105
+
104
106
  See the [coding-agent guide](https://github.com/disposabl-dev/create-disposabl-app/blob/main/packages/skill/SKILL.md) for the full delivery workflow, or [report a problem](https://github.com/disposabl-dev/create-disposabl-app/issues).
105
107
 
106
108
  Set `features` to include `faster-ci` in `disposabl.json` to use Blacksmith runners (the GitHub App must be installed). The initial selection job remains GitHub-hosted so it can read the configuration.
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.23";
6
+ var version = "0.20.24";
7
7
  var package_default = {
8
8
  name: "@disposabl/cli",
9
9
  version,
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.23";
1566
+ var version = "0.20.24";
1567
1567
 
1568
1568
  // ../cli/telemetry.ts
1569
1569
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
@@ -10,6 +10,9 @@
10
10
  - Run `bun run test` for the platforms selected in `disposabl.json`. Backend checks always apply; API checks only apply when the API platform is selected. Use `--target` for an explicitly scoped run and report which platforms were tested.
11
11
  - Use deterministic locators and assertions by default. No E2E login, model subscription, or API key is required. Coding agents should extend the flows when application behavior changes.
12
12
  - Build and verify locally when the toolchain is available. Do not push or start GitHub Actions merely to test a change. Mobile tests need a locally built and installed app plus a simulator/emulator; a successful compilation is not behavioral proof.
13
+ - Before pushing app code for a preview, run `bun run check:preview` with the app's development web environment from a clean checkout of the commit you plan to push. This also runs the production web build and prerenders public routes.
14
+ - After changes to Convex functions or schemas, let the app's development backend regenerate `packages/backend/convex/_generated` and commit those changes with the source.
15
+ - Use the starter's Convex provider in web routes. Start separate realtime clients or subscriptions after browser hydration to keep public route prerendering independent of live connections.
13
16
  - Run checks against the app's development or isolated preview backend. Never copy another app's credentials or seed production data. Report missing infrastructure and failed tests rather than silently skipping required platforms.
14
17
  - E2E telemetry is disabled by the provided commands. Leave it disabled until it follows Disposabl's telemetry preference.
15
18
  - PostHog analytics is production-only; do not enable it for local development or E2E runs.
@@ -3,6 +3,7 @@
3
3
  "private": true,
4
4
  "scripts": {
5
5
  "check": "bun fmt --check && bun run generate && turbo run typecheck lint && bun fmt --check",
6
+ "check:preview": "bun install --frozen-lockfile && bun run check && bun run build --filter=@disposabl/web",
6
7
  "hooks:install": ".githooks/install",
7
8
  "test": "bun run --cwd packages/tests test",
8
9
  "test:unit": "bun run --cwd packages/tests test:unit",
@@ -0,0 +1,26 @@
1
+ import type { ConnectionState } from "convex/browser";
2
+ import { ConvexReactClient } from "convex/react";
3
+
4
+ const disconnected: ConnectionState = {
5
+ hasInflightRequests: false,
6
+ isWebSocketConnected: false,
7
+ timeOfOldestInflightRequest: null,
8
+ hasEverConnected: false,
9
+ connectionCount: 0,
10
+ connectionRetries: 0,
11
+ inflightMutations: 0,
12
+ inflightActions: 0,
13
+ };
14
+
15
+ class ServerConvexClient extends ConvexReactClient {
16
+ override connectionState(): ConnectionState {
17
+ // Reading the live state opens a WebSocket during static rendering.
18
+ return disconnected;
19
+ }
20
+ }
21
+
22
+ export function createWebConvexClient(url: string): ConvexReactClient {
23
+ return typeof window === "undefined"
24
+ ? new ServerConvexClient(url)
25
+ : new ConvexReactClient(url);
26
+ }
@@ -4,6 +4,7 @@ import { LegalFooter } from "../components/legal-page";
4
4
  import { LogOut } from "../components/ui/log-out";
5
5
  import { useContext, useState } from "react";
6
6
  import { ThemeProvider } from "../lib/theme";
7
+ import { createWebConvexClient } from "../lib/convex-client";
7
8
  import {
8
9
  createFileRoute,
9
10
  Outlet,
@@ -12,7 +13,7 @@ import {
12
13
  import { ConvexAuthProvider, useAuthToken } from "@convex-dev/auth/react";
13
14
  import {
14
15
  ConvexProvider,
15
- ConvexReactClient,
16
+ type ConvexReactClient,
16
17
  useConvexAuth,
17
18
  useQuery,
18
19
  } from "convex/react";
@@ -33,7 +34,7 @@ function Providers() {
33
34
  const url = import.meta.env.VITE_CONVEX_URL;
34
35
  if (!url)
35
36
  throw new Error("Set VITE_CONVEX_URL to your Convex deployment URL");
36
- return new ConvexReactClient(url);
37
+ return createWebConvexClient(url);
37
38
  });
38
39
 
39
40
  return (
@@ -65,6 +65,8 @@ Use the host's worktree and delegation tools when required. Keep tokens in ignor
65
65
 
66
66
  Before generating the product, write a concise `APP_BRIEF.md` with its purpose, selected platforms and intended user flow. Commit that real change, push the feature branch, and open its PR. Keep the starter usable while the selected native builds from the initial `main` push run in parallel with generation.
67
67
 
68
+ Before pushing implementation commits to that PR, regenerate and commit Convex bindings when backend functions or schemas change. Run `bun run check:preview` in a clean local checkout of the intended commit with the app's development web URLs. This runs the pipeline's checks and production web build before CI starts.
69
+
68
70
  An installer from `main` receives production updates, not PR preview updates. After the generated app passes review and its selected-platform checks, merge through the authorized delivery workflow to publish the production update. Compatible Android JavaScript and asset changes use EAS Update; native dependency or configuration changes need a new binary. Desktop delivery needs its configured native update feed. Do not report that an update reached an installed app until that behavior is verified.
69
71
 
70
72
  ## Preview updates every two minutes
@@ -0,0 +1,34 @@
1
+ import { ConvexProvider, useConvexConnectionState } from "convex/react";
2
+ import assert from "node:assert/strict";
3
+ import { test } from "node:test";
4
+ import { createElement } from "react";
5
+ import { renderToStaticMarkup } from "react-dom/server";
6
+ import { createWebConvexClient } from "../disposabl-kit/client/lib/convex-client";
7
+
8
+ test("prerendering the Convex connection state leaves the WebSocket unopened", () => {
9
+ const webSocket = globalThis.WebSocket;
10
+ globalThis.WebSocket = new Proxy(webSocket, {
11
+ construct() {
12
+ throw new Error("Prerendering opened a WebSocket");
13
+ },
14
+ });
15
+
16
+ try {
17
+ function PickupStatus() {
18
+ const { isWebSocketConnected } = useConvexConnectionState();
19
+ return createElement(
20
+ "p",
21
+ null,
22
+ isWebSocketConnected ? "Live" : "Loading",
23
+ );
24
+ }
25
+
26
+ const client = createWebConvexClient("https://starter-check.convex.cloud");
27
+ const html = renderToStaticMarkup(
28
+ createElement(ConvexProvider, { client }, createElement(PickupStatus)),
29
+ );
30
+ assert.equal(html, "<p>Loading</p>");
31
+ } finally {
32
+ globalThis.WebSocket = webSocket;
33
+ }
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.20.23",
3
+ "version": "0.20.24",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",