create-disposabl-app 0.8.14 → 0.9.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 +10 -7
- package/dist/index.js +10 -4
- package/dist/templates/default/.github/README.md +20 -0
- package/dist/templates/default/.github/workflows/pipeline.yml +6 -6
- package/dist/templates/default/apps/mobile/README.md +1 -1
- package/dist/templates/default/apps/web/src/components/connections/expo-connection.tsx +97 -0
- package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +7 -1
- package/dist/templates/default/apps/web/src/components/connections/use-connection-setup.ts +169 -0
- package/dist/templates/default/packages/cli/commands.ts +13 -6
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +2 -8
- package/dist/templates/default/packages/skill/SKILL.md +18 -1
- package/package.json +1 -1
package/dist/disposabl.js
CHANGED
|
@@ -255,7 +255,7 @@ Sign in to Expo if needed and choose Delete project. Then rerun this command to
|
|
|
255
255
|
// ../cli/package.json
|
|
256
256
|
var package_default = {
|
|
257
257
|
name: "@disposabl/cli",
|
|
258
|
-
version: "0.
|
|
258
|
+
version: "0.9.0",
|
|
259
259
|
type: "module",
|
|
260
260
|
description: "Command-line access to your Disposabl app",
|
|
261
261
|
license: "MIT",
|
|
@@ -494,7 +494,9 @@ async function runCli(argv = process.argv, serviceOrigin = SERVICE_ORIGIN) {
|
|
|
494
494
|
const command = parent.command(parts.at(-1));
|
|
495
495
|
const connectionStatus = path === "/api/connections/status";
|
|
496
496
|
if (connectionStatus)
|
|
497
|
-
command.option("--wait", "Open
|
|
497
|
+
command.option("--wait", "Open setup and continue when GitHub, Blacksmith and Convex are ready");
|
|
498
|
+
if (connectionStatus)
|
|
499
|
+
command.option("--mobile", "Also wait for Expo when creating a mobile app");
|
|
498
500
|
const deleteApp = path === "/api/apps/delete";
|
|
499
501
|
if (deleteApp)
|
|
500
502
|
command.option("--no-browser", "Print the Expo cleanup URL without opening a browser");
|
|
@@ -564,14 +566,15 @@ async function runCli(argv = process.argv, serviceOrigin = SERVICE_ORIGIN) {
|
|
|
564
566
|
if (!result.ok)
|
|
565
567
|
throw new Error(`API request failed (${result.status}): ${await result.text()}`);
|
|
566
568
|
let value = await result.json();
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
569
|
+
const ready = () => value.ready && (!options.mobile || Boolean(value.expo));
|
|
570
|
+
if (connectionStatus && options.wait && !ready()) {
|
|
571
|
+
const url = `${base}/dashboard/connections?mobile=${options.mobile ? "1" : "0"}`;
|
|
572
|
+
console.error(`Set up your free GitHub organization, Blacksmith and Convex accounts (plus Expo for mobile):
|
|
570
573
|
${url}
|
|
571
574
|
Waiting for connections. Press Ctrl+C to keep your files and finish later.`);
|
|
572
575
|
openUrl(url);
|
|
573
576
|
const deadline = Date.now() + 15 * 60000;
|
|
574
|
-
while (!
|
|
577
|
+
while (!ready() && Date.now() < deadline) {
|
|
575
578
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
576
579
|
result = await send();
|
|
577
580
|
if (result.status === 401 && !process.env.DISPOSABL_API_KEY)
|
|
@@ -580,7 +583,7 @@ Waiting for connections. Press Ctrl+C to keep your files and finish later.`);
|
|
|
580
583
|
throw new Error(`Connection status failed (${result.status}). Your login and app files are saved.`);
|
|
581
584
|
value = await result.json();
|
|
582
585
|
}
|
|
583
|
-
if (!
|
|
586
|
+
if (!ready())
|
|
584
587
|
throw new Error(`Connections are still incomplete. Finish at ${url}, then retry setup.`);
|
|
585
588
|
}
|
|
586
589
|
if (tokenCreate && options.configure) {
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
8
8
|
import { Command, CommanderError } from "commander";
|
|
9
9
|
import * as p2 from "@clack/prompts";
|
|
10
10
|
// package.json
|
|
11
|
-
var version = "0.
|
|
11
|
+
var version = "0.9.0";
|
|
12
12
|
|
|
13
13
|
// ../disposabl-kit/platforms.ts
|
|
14
14
|
var platforms = [
|
|
@@ -536,11 +536,17 @@ async function setupApp(directory, name, run = runDisposabl) {
|
|
|
536
536
|
if (!verified.currentUser)
|
|
537
537
|
throw new Error("Login completed without a verified user.");
|
|
538
538
|
}
|
|
539
|
-
const connections = await run(["connections", "status", "--wait"]);
|
|
540
|
-
if (!connections.ready)
|
|
541
|
-
throw new Error("Connect GitHub and Convex at https://www.disposabl.dev/dashboard/connections, then retry from the parent directory: bun create disposabl-app@latest " + basename3(directory) + ". Your app files and login are saved.");
|
|
542
539
|
const path = join3(directory, "disposabl.json");
|
|
543
540
|
const config = JSON.parse(await readFile2(path, "utf8"));
|
|
541
|
+
const mobile = config.platforms.some((p) => p === "ios" || p === "android");
|
|
542
|
+
const connections = await run([
|
|
543
|
+
"connections",
|
|
544
|
+
"status",
|
|
545
|
+
"--wait",
|
|
546
|
+
...mobile ? ["--mobile"] : []
|
|
547
|
+
]);
|
|
548
|
+
if (!connections.ready)
|
|
549
|
+
throw new Error("Install Disposabl and Blacksmith in a GitHub organization, then connect Convex at https://www.disposabl.dev/dashboard/connections, then retry from the parent directory: bun create disposabl-app@latest " + basename3(directory) + ". Your app files and login are saved.");
|
|
544
550
|
if (config.appId) {
|
|
545
551
|
const app = await run(["apps", "get", "--appId", config.appId]);
|
|
546
552
|
if (JSON.stringify([...app.platforms].sort()) !== JSON.stringify([...config.platforms].sort()))
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# App builds
|
|
2
|
+
|
|
3
|
+
Install Disposabl and Blacksmith in the same GitHub organization before creating
|
|
4
|
+
an app. Blacksmith does not support personal repositories. A GitHub organization
|
|
5
|
+
is free and works for a solo developer: [create one](https://github.com/organizations/plan).
|
|
6
|
+
Select All repositories when installing Blacksmith so newly generated apps can
|
|
7
|
+
run their workflows. A confirmation in Disposabl records the user's setup;
|
|
8
|
+
only a completed runner job proves that repository access works.
|
|
9
|
+
|
|
10
|
+
Web and Android builds use Blacksmith Ubuntu runners. Desktop builds use its
|
|
11
|
+
Linux, Windows, or macOS runners; iOS simulator previews use its macOS 27 image
|
|
12
|
+
and default Xcode. The existing production iOS path uses EAS Build. Package
|
|
13
|
+
publishing and protected release jobs remain on GitHub-hosted Ubuntu for their
|
|
14
|
+
trusted publishing configuration.
|
|
15
|
+
|
|
16
|
+
Blacksmith includes 3,000 equivalent 2-vCPU Linux minutes per organization per
|
|
17
|
+
month. Larger runners and Windows/macOS consume the allowance at different
|
|
18
|
+
rates. See [pricing](https://www.blacksmith.sh/pricing) and
|
|
19
|
+
[runner types](https://docs.blacksmith.sh/blacksmith-runners/overview).
|
|
20
|
+
All provider accounts are free to create; build and hosting usage limits apply.
|
|
@@ -17,10 +17,10 @@ env:
|
|
|
17
17
|
EAS_CLI: eas-cli@27.2.0
|
|
18
18
|
BUN_VERSION: &bun-version "1.4.4"
|
|
19
19
|
NODE_VERSION: &node-version "24"
|
|
20
|
-
LINUX_RUNNER: &linux-runner ubuntu-
|
|
21
|
-
WEB_RUNNER: &web-runner ubuntu-
|
|
22
|
-
WINDOWS_RUNNER: windows-2025
|
|
23
|
-
MACOS_RUNNER: macos-
|
|
20
|
+
LINUX_RUNNER: &linux-runner blacksmith-4vcpu-ubuntu-2404
|
|
21
|
+
WEB_RUNNER: &web-runner blacksmith-4vcpu-ubuntu-2404
|
|
22
|
+
WINDOWS_RUNNER: blacksmith-2vcpu-windows-2025
|
|
23
|
+
MACOS_RUNNER: blacksmith-6vcpu-macos-27
|
|
24
24
|
RELEASE_PREFIX: app
|
|
25
25
|
DISPOSABL_ANDROID_VERSION_CODE: ${{ github.run_number }}
|
|
26
26
|
DISPOSABL_IOS_BUILD_NUMBER: ${{ github.run_number }}
|
|
@@ -97,6 +97,7 @@ jobs:
|
|
|
97
97
|
done
|
|
98
98
|
- name: Deploy
|
|
99
99
|
id: deploy
|
|
100
|
+
timeout-minutes: 1
|
|
100
101
|
env:
|
|
101
102
|
TRUSTED: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
|
|
102
103
|
CONVEX_DEPLOY_KEY: ${{ secrets[github.event_name == 'push' && 'CONVEX_DEPLOY_KEY' || 'CONVEX_DEPLOY_KEY_PREVIEW'] }}
|
|
@@ -205,10 +206,9 @@ jobs:
|
|
|
205
206
|
needs: web
|
|
206
207
|
if: github.event_name == 'pull_request' && needs.web.outputs.ios == 'true'
|
|
207
208
|
permissions: *release-permissions
|
|
208
|
-
runs-on:
|
|
209
|
+
runs-on: blacksmith-6vcpu-macos-27
|
|
209
210
|
timeout-minutes: 90
|
|
210
211
|
env:
|
|
211
|
-
DEVELOPER_DIR: /Applications/Xcode_27.2.0.app/Contents/Developer
|
|
212
212
|
CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
213
213
|
CONVEX_SITE_URL: ${{ needs.web.outputs.convex_site_url }}
|
|
214
214
|
EXPO_PUBLIC_CONVEX_URL: ${{ needs.web.outputs.convex_url }}
|
|
@@ -72,7 +72,7 @@ installable APK in a separate 4-vCPU Android job. Later runs with the same finge
|
|
|
72
72
|
publish EAS Update from Web. Native jobs install only the mobile workspace using
|
|
73
73
|
the shared dependency cache. Android and iOS native builds run in parallel.
|
|
74
74
|
Linux and Windows start alongside Web.
|
|
75
|
-
|
|
75
|
+
Build jobs use Blacksmith; package publishing keeps GitHub-hosted runners and production iOS uses EAS Build. See [.github/README.md](../../.github/README.md)
|
|
76
76
|
for the job order and cache behavior.
|
|
77
77
|
|
|
78
78
|
Each PR uses its own `pr-<number>` channel and Android application ID. Production
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useAction } from "convex/react";
|
|
3
|
+
import { api } from "../../../../../packages/backend/convex/_generated/api";
|
|
4
|
+
import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
|
|
5
|
+
import { Input } from "@disposabl/disposabl-kit/client/components/ui/input";
|
|
6
|
+
|
|
7
|
+
export function ExpoConnection({
|
|
8
|
+
busy,
|
|
9
|
+
run,
|
|
10
|
+
onConnected,
|
|
11
|
+
}: {
|
|
12
|
+
busy: boolean;
|
|
13
|
+
run: (action: () => Promise<void>) => Promise<void>;
|
|
14
|
+
onConnected: () => void;
|
|
15
|
+
}) {
|
|
16
|
+
const expoAccounts = useAction(api.connections.index.expoAccounts);
|
|
17
|
+
const connectExpo = useAction(api.connections.index.connectExpo);
|
|
18
|
+
const [token, setToken] = useState("");
|
|
19
|
+
const [accounts, setAccounts] = useState<Array<{ id: string; name: string }>>(
|
|
20
|
+
[],
|
|
21
|
+
);
|
|
22
|
+
const [accountId, setAccountId] = useState("");
|
|
23
|
+
return (
|
|
24
|
+
<form
|
|
25
|
+
className="mt-5 space-y-4 border-t pt-5"
|
|
26
|
+
onSubmit={(event) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
void run(async () => {
|
|
29
|
+
if (!accounts.length) {
|
|
30
|
+
const result = await expoAccounts({ token });
|
|
31
|
+
if (!result.length)
|
|
32
|
+
throw new Error("No Expo accounts were found for this token.");
|
|
33
|
+
setAccounts(result);
|
|
34
|
+
setAccountId(result[0]?.id ?? "");
|
|
35
|
+
} else {
|
|
36
|
+
await connectExpo({ token, accountId });
|
|
37
|
+
setToken("");
|
|
38
|
+
setAccounts([]);
|
|
39
|
+
setAccountId("");
|
|
40
|
+
onConnected();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<p className="text-sm text-muted-foreground">
|
|
46
|
+
Verify an Expo access token, then choose the account to save.
|
|
47
|
+
</p>
|
|
48
|
+
<label className="block space-y-2 text-sm font-medium">
|
|
49
|
+
Access token
|
|
50
|
+
<Input
|
|
51
|
+
type="password"
|
|
52
|
+
autoComplete="off"
|
|
53
|
+
required
|
|
54
|
+
value={token}
|
|
55
|
+
onChange={(event) => {
|
|
56
|
+
setToken(event.target.value);
|
|
57
|
+
setAccounts([]);
|
|
58
|
+
setAccountId("");
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
</label>
|
|
62
|
+
<a
|
|
63
|
+
className="inline-block text-sm underline underline-offset-4"
|
|
64
|
+
href="https://expo.dev/settings/access-tokens"
|
|
65
|
+
target="_blank"
|
|
66
|
+
rel="noreferrer"
|
|
67
|
+
>
|
|
68
|
+
Create an Expo access token
|
|
69
|
+
</a>
|
|
70
|
+
{accounts.length > 0 && (
|
|
71
|
+
<label className="block space-y-2 text-sm font-medium">
|
|
72
|
+
Expo account
|
|
73
|
+
<select
|
|
74
|
+
className="block min-h-11 w-full rounded-md border bg-background px-3"
|
|
75
|
+
value={accountId}
|
|
76
|
+
onChange={(event) => setAccountId(event.target.value)}
|
|
77
|
+
>
|
|
78
|
+
{accounts.map((account) => (
|
|
79
|
+
<option key={account.id} value={account.id}>
|
|
80
|
+
{account.name}
|
|
81
|
+
</option>
|
|
82
|
+
))}
|
|
83
|
+
</select>
|
|
84
|
+
</label>
|
|
85
|
+
)}
|
|
86
|
+
<div>
|
|
87
|
+
<Button
|
|
88
|
+
type="submit"
|
|
89
|
+
className="min-h-11"
|
|
90
|
+
disabled={busy || !token.trim()}
|
|
91
|
+
>
|
|
92
|
+
{accounts.length ? "Save account" : "Verify token"}
|
|
93
|
+
</Button>
|
|
94
|
+
</div>
|
|
95
|
+
</form>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export function ProviderLogo({
|
|
2
2
|
provider,
|
|
3
3
|
}: {
|
|
4
|
-
provider: "github" | "convex" | "expo";
|
|
4
|
+
provider: "github" | "convex" | "expo" | "blacksmith";
|
|
5
5
|
}) {
|
|
6
|
+
if (provider === "blacksmith")
|
|
7
|
+
return (
|
|
8
|
+
<span aria-hidden="true" className="font-mono text-xl font-bold">
|
|
9
|
+
B
|
|
10
|
+
</span>
|
|
11
|
+
);
|
|
6
12
|
if (provider === "github")
|
|
7
13
|
return (
|
|
8
14
|
<svg
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { useAction, useMutation, useQuery } from "convex/react";
|
|
3
|
+
import { ConvexError } from "convex/values";
|
|
4
|
+
import { api } from "../../../../../packages/backend/convex/_generated/api";
|
|
5
|
+
|
|
6
|
+
type Provider = "github" | "convex";
|
|
7
|
+
type Installation = { installationId: string; owner: string };
|
|
8
|
+
const pendingKey = "disposabl.pendingConnectionProvider";
|
|
9
|
+
const isProvider = (value: string | null): value is Provider =>
|
|
10
|
+
value === "github" || value === "convex";
|
|
11
|
+
|
|
12
|
+
export function useConnectionSetup() {
|
|
13
|
+
const status = useQuery(api.connections.index.status, {});
|
|
14
|
+
const start = useAction(api.connections.index.start);
|
|
15
|
+
const resumeInstall = useAction(api.connections.index.resumeGithubInstall);
|
|
16
|
+
const confirmBlacksmith = useMutation(
|
|
17
|
+
api.connections.index.confirmBlacksmith,
|
|
18
|
+
);
|
|
19
|
+
const complete = useAction(api.connections.index.complete);
|
|
20
|
+
const selectGithub = useAction(api.connections.index.selectGithub);
|
|
21
|
+
const disconnect = useMutation(api.connections.index.disconnect);
|
|
22
|
+
const [busy, setBusy] = useState(false);
|
|
23
|
+
const [error, setError] = useState<string>();
|
|
24
|
+
const [installations, setInstallations] = useState<Installation[]>([]);
|
|
25
|
+
const [proof, setProof] = useState<string>();
|
|
26
|
+
const [installNeeded, setInstallNeeded] = useState(false);
|
|
27
|
+
const [mobile, setMobile] = useState(false);
|
|
28
|
+
const consumed = useRef(false);
|
|
29
|
+
const fail = (cause: unknown) =>
|
|
30
|
+
setError(
|
|
31
|
+
cause instanceof ConvexError && typeof cause.data === "string"
|
|
32
|
+
? cause.data
|
|
33
|
+
: cause instanceof Error
|
|
34
|
+
? cause.message
|
|
35
|
+
: "Something went wrong. Please try again.",
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (consumed.current) return;
|
|
40
|
+
consumed.current = true;
|
|
41
|
+
const url = new URL(window.location.href);
|
|
42
|
+
const mobileKey = "disposabl.setupMobile";
|
|
43
|
+
if (url.searchParams.has("mobile"))
|
|
44
|
+
sessionStorage.setItem(
|
|
45
|
+
mobileKey,
|
|
46
|
+
url.searchParams.get("mobile") === "1" ? "1" : "0",
|
|
47
|
+
);
|
|
48
|
+
setMobile(sessionStorage.getItem(mobileKey) === "1");
|
|
49
|
+
const queryProvider = url.searchParams.get("provider");
|
|
50
|
+
const pending = sessionStorage.getItem(pendingKey);
|
|
51
|
+
const provider = isProvider(queryProvider)
|
|
52
|
+
? queryProvider
|
|
53
|
+
: isProvider(pending)
|
|
54
|
+
? pending
|
|
55
|
+
: null;
|
|
56
|
+
const code = url.searchParams.get("code");
|
|
57
|
+
const state = url.searchParams.get("state");
|
|
58
|
+
const denial = url.searchParams.get("error");
|
|
59
|
+
const installationReturn =
|
|
60
|
+
url.searchParams.has("installation_id") ||
|
|
61
|
+
url.searchParams.has("setup_action");
|
|
62
|
+
// Remove callback credentials even after a denial or malformed response.
|
|
63
|
+
for (const key of [
|
|
64
|
+
"installation_id",
|
|
65
|
+
"setup_action",
|
|
66
|
+
"state",
|
|
67
|
+
"code",
|
|
68
|
+
"provider",
|
|
69
|
+
"error",
|
|
70
|
+
"error_description",
|
|
71
|
+
])
|
|
72
|
+
url.searchParams.delete(key);
|
|
73
|
+
window.history.replaceState(window.history.state, "", url.toString());
|
|
74
|
+
if (denial) {
|
|
75
|
+
sessionStorage.removeItem(pendingKey);
|
|
76
|
+
setError(
|
|
77
|
+
"Authorization was cancelled. Use the setup button to try again.",
|
|
78
|
+
);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (installationReturn) {
|
|
82
|
+
setBusy(true);
|
|
83
|
+
sessionStorage.setItem(pendingKey, "github");
|
|
84
|
+
void (state ? resumeInstall({ state }) : start({ provider: "github" }))
|
|
85
|
+
.then((next) => window.location.assign(next))
|
|
86
|
+
.catch(fail)
|
|
87
|
+
.finally(() => setBusy(false));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const callback =
|
|
91
|
+
code !== null ||
|
|
92
|
+
state !== null ||
|
|
93
|
+
denial !== null ||
|
|
94
|
+
queryProvider !== null;
|
|
95
|
+
if (!callback) return;
|
|
96
|
+
if (!provider || !code || !state) {
|
|
97
|
+
setError(
|
|
98
|
+
"The authorization response is incomplete. Please connect again to restart authorization.",
|
|
99
|
+
);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
sessionStorage.removeItem(pendingKey);
|
|
103
|
+
setBusy(true);
|
|
104
|
+
void complete({ provider, code, state })
|
|
105
|
+
.then(async (result) => {
|
|
106
|
+
if (provider !== "github") return;
|
|
107
|
+
const installation = result.installations.at(0);
|
|
108
|
+
if (result.installations.length === 1 && installation) {
|
|
109
|
+
if (!result.proof)
|
|
110
|
+
throw new Error(
|
|
111
|
+
"GitHub did not return an account selection proof. Please connect again.",
|
|
112
|
+
);
|
|
113
|
+
await selectGithub({
|
|
114
|
+
proof: result.proof,
|
|
115
|
+
installationId: installation.installationId,
|
|
116
|
+
});
|
|
117
|
+
} else {
|
|
118
|
+
setInstallations(result.installations);
|
|
119
|
+
setProof(result.proof);
|
|
120
|
+
setInstallNeeded(result.installations.length === 0);
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
.catch(fail)
|
|
124
|
+
.finally(() => setBusy(false));
|
|
125
|
+
}, [complete, selectGithub, resumeInstall, start]);
|
|
126
|
+
|
|
127
|
+
async function run(action: () => Promise<void>) {
|
|
128
|
+
if (busy) return;
|
|
129
|
+
setBusy(true);
|
|
130
|
+
setError(undefined);
|
|
131
|
+
try {
|
|
132
|
+
await action();
|
|
133
|
+
} catch (cause) {
|
|
134
|
+
fail(cause);
|
|
135
|
+
} finally {
|
|
136
|
+
setBusy(false);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function connect(provider: Provider) {
|
|
140
|
+
void run(async () => {
|
|
141
|
+
const url = await start({ provider, install: provider === "github" });
|
|
142
|
+
sessionStorage.setItem(pendingKey, provider);
|
|
143
|
+
window.location.assign(url);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function chooseOrganization(installationId: string) {
|
|
148
|
+
void run(async () => {
|
|
149
|
+
if (!proof)
|
|
150
|
+
throw new Error("Restart GitHub setup to choose an organization.");
|
|
151
|
+
await selectGithub({ proof, installationId });
|
|
152
|
+
setInstallations([]);
|
|
153
|
+
setProof(undefined);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
status,
|
|
158
|
+
busy,
|
|
159
|
+
error,
|
|
160
|
+
run,
|
|
161
|
+
connect,
|
|
162
|
+
disconnect,
|
|
163
|
+
installations,
|
|
164
|
+
chooseOrganization,
|
|
165
|
+
installNeeded,
|
|
166
|
+
confirmBlacksmith,
|
|
167
|
+
mobile,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -124,7 +124,12 @@ export async function runCli(
|
|
|
124
124
|
if (connectionStatus)
|
|
125
125
|
command.option(
|
|
126
126
|
"--wait",
|
|
127
|
-
"Open
|
|
127
|
+
"Open setup and continue when GitHub, Blacksmith and Convex are ready",
|
|
128
|
+
);
|
|
129
|
+
if (connectionStatus)
|
|
130
|
+
command.option(
|
|
131
|
+
"--mobile",
|
|
132
|
+
"Also wait for Expo when creating a mobile app",
|
|
128
133
|
);
|
|
129
134
|
const deleteApp = path === "/api/apps/delete";
|
|
130
135
|
if (deleteApp)
|
|
@@ -244,14 +249,16 @@ export async function runCli(
|
|
|
244
249
|
`API request failed (${result.status}): ${await result.text()}`,
|
|
245
250
|
);
|
|
246
251
|
let value = await result.json();
|
|
247
|
-
|
|
248
|
-
|
|
252
|
+
const ready = () =>
|
|
253
|
+
value.ready && (!options.mobile || Boolean(value.expo));
|
|
254
|
+
if (connectionStatus && options.wait && !ready()) {
|
|
255
|
+
const url = `${base}/dashboard/connections?mobile=${options.mobile ? "1" : "0"}`;
|
|
249
256
|
console.error(
|
|
250
|
-
`
|
|
257
|
+
`Set up your free GitHub organization, Blacksmith and Convex accounts (plus Expo for mobile):\n${url}\nWaiting for connections. Press Ctrl+C to keep your files and finish later.`,
|
|
251
258
|
);
|
|
252
259
|
openUrl(url);
|
|
253
260
|
const deadline = Date.now() + 15 * 60_000;
|
|
254
|
-
while (!
|
|
261
|
+
while (!ready() && Date.now() < deadline) {
|
|
255
262
|
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
256
263
|
result = await send();
|
|
257
264
|
if (result.status === 401 && !process.env.DISPOSABL_API_KEY)
|
|
@@ -262,7 +269,7 @@ export async function runCli(
|
|
|
262
269
|
);
|
|
263
270
|
value = await result.json();
|
|
264
271
|
}
|
|
265
|
-
if (!
|
|
272
|
+
if (!ready())
|
|
266
273
|
throw new Error(
|
|
267
274
|
`Connections are still incomplete. Finish at ${url}, then retry setup.`,
|
|
268
275
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
|
-
import { createFileRoute,
|
|
2
|
+
import { createFileRoute, Navigate } from "@tanstack/react-router";
|
|
3
3
|
import { useAction, useConvexAuth, useQuery } from "convex/react";
|
|
4
4
|
import { api } from "../../../backend/convex/_generated/api";
|
|
5
5
|
import { Button } from "../components/ui/button";
|
|
@@ -117,13 +117,7 @@ export function ConsentPage() {
|
|
|
117
117
|
)}
|
|
118
118
|
</div>
|
|
119
119
|
) : (
|
|
120
|
-
<
|
|
121
|
-
to="/login"
|
|
122
|
-
search={{ request: requestId }}
|
|
123
|
-
className="font-medium underline underline-offset-4"
|
|
124
|
-
>
|
|
125
|
-
Log in to review this request
|
|
126
|
-
</Link>
|
|
120
|
+
<Navigate to="/signup" search={{ request: requestId }} replace />
|
|
127
121
|
)}
|
|
128
122
|
</>
|
|
129
123
|
);
|
|
@@ -18,7 +18,7 @@ bun create disposabl-app@latest --list-options
|
|
|
18
18
|
bun create disposabl-app@latest my-app --platforms web,android,mcp --features authentication --yes
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Use the requested platforms and features. Creation handles Disposabl login, required GitHub/Convex
|
|
21
|
+
Use the requested platforms and features. Creation handles Disposabl login, required GitHub organization/Blacksmith/Convex setup, and the app's scoped development environment. Resume interrupted setup in the same directory. Do not create a replacement Convex project or delete an app unless requested. Never print credentials.
|
|
22
22
|
|
|
23
23
|
The CLI is bundled with `create-disposabl-app`; do not use the retired `@disposabl/cli` package. Commands below use the published CLI and work without a global install:
|
|
24
24
|
|
|
@@ -70,3 +70,20 @@ Verify the requested behavior, authentication, and saved data after relaunch on
|
|
|
70
70
|
Only when requested, run `disposabl apps delete --appId <uuid> --dangerously-delete-app`. Apps with production releases cannot be deleted.
|
|
71
71
|
|
|
72
72
|
If the response is `expo_manual_delete_required`, GitHub/Convex cleanup has completed but Expo cleanup remains. Open the exact returned `projectUrl`; never substitute a generic dashboard. The user completes Expo sign-in or reauthentication directly. Do not collect passwords or session cookies. Retry the deletion command afterward and report full deletion only when Disposabl confirms it. `--no-browser` prints the URL for headless callers.
|
|
73
|
+
|
|
74
|
+
## Account setup
|
|
75
|
+
|
|
76
|
+
All provider accounts are free to create; builds and hosting have usage limits.
|
|
77
|
+
Use one GitHub step to install Disposabl and finish authorization. Blacksmith
|
|
78
|
+
requires an organization, even for a solo user. Recommend one new, dedicated
|
|
79
|
+
organization for all of the user's Disposabl apps, and reuse it for future apps.
|
|
80
|
+
Keep an existing organization as an alternative. Explain that it is a free workspace, open https://github.com/organizations/plan when
|
|
81
|
+
browser setup is requested, and guide them through the Free plan. Do not convert
|
|
82
|
+
their personal account or report a missing organization as a failed connection.
|
|
83
|
+
Then install Blacksmith in that same organization with All repositories access so new app repositories can build,
|
|
84
|
+
and connect Convex. Expo is required for mobile apps. Blacksmith's 3,000 free
|
|
85
|
+
monthly minutes are equivalent Linux 2-vCPU minutes; other runners consume more.
|
|
86
|
+
Blacksmith installation is user-confirmed until a build proves runner access.
|
|
87
|
+
Your code and app data stay in your accounts; Disposabl stores encrypted
|
|
88
|
+
connection credentials and setup metadata. Link the open-source repository
|
|
89
|
+
when explaining access: https://github.com/disposabl-dev/create-disposabl-app.
|