create-disposabl-app 0.8.11 → 0.8.13
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 +5 -0
- package/dist/disposabl.js +1 -1
- package/dist/index.js +1 -6
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +0 -1
- package/dist/templates/default/packages/skill/SKILL.md +39 -19
- package/dist/templates/default/packages/skill/references/design.md +1 -1
- package/package.json +2 -2
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.connections.tsx +0 -445
package/README.md
CHANGED
|
@@ -39,3 +39,8 @@ only application operation. Disposabl's apps, previews, releases, provider
|
|
|
39
39
|
connections, GitHub handlers, and service credentials stay in the Disposabl
|
|
40
40
|
backend. Product-generated API bindings, contracts, and SDK operations are not
|
|
41
41
|
copied into new apps.
|
|
42
|
+
|
|
43
|
+
The root `reset.ts` script owns the product-to-starter cleanup. The generator
|
|
44
|
+
runs it only inside its disposable staging copy before packaging. Replacement
|
|
45
|
+
backend files live in `starter/backend`; platform and feature selection still
|
|
46
|
+
happens when the user creates an app.
|
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.8.
|
|
258
|
+
version: "0.8.13",
|
|
259
259
|
type: "module",
|
|
260
260
|
description: "Command-line access to your Disposabl app",
|
|
261
261
|
license: "MIT",
|
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.8.
|
|
11
|
+
var version = "0.8.13";
|
|
12
12
|
|
|
13
13
|
// ../disposabl-kit/platforms.ts
|
|
14
14
|
var platforms = [
|
|
@@ -328,16 +328,11 @@ async function createApp(template, destination, name, config, overwrite = false)
|
|
|
328
328
|
force: true
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
|
-
await rm(join(destination, "apps/web/src/router/_authenticated/dashboard.connections.tsx"), { force: true });
|
|
332
|
-
const dashboard = join(destination, "apps/web/src/router/_authenticated/dashboard.tsx");
|
|
333
|
-
await writeFile(dashboard, (await readFile(dashboard, "utf8")).replace(` <Link to="/dashboard/connections">Connections</Link>
|
|
334
|
-
`, ""));
|
|
335
331
|
if (!config.features.includes("authentication")) {
|
|
336
332
|
for (const path of [
|
|
337
333
|
"packages/disposabl-kit/client/routes/_auth-pages",
|
|
338
334
|
"packages/disposabl-kit/client/routes/consent.tsx",
|
|
339
335
|
"apps/web/src/router/_authenticated/dashboard.api-keys.tsx",
|
|
340
|
-
"apps/web/src/router/_authenticated/dashboard.connections.tsx",
|
|
341
336
|
"apps/mobile/src/app/(auth)",
|
|
342
337
|
"apps/mobile/src/app/(authenticated)/account.tsx"
|
|
343
338
|
]) {
|
|
@@ -18,7 +18,6 @@ function Dashboard() {
|
|
|
18
18
|
<main className="mx-auto max-w-xl space-y-4 p-6">
|
|
19
19
|
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
|
20
20
|
<nav className="flex gap-4">
|
|
21
|
-
<Link to="/dashboard/connections">Connections</Link>
|
|
22
21
|
{config.platforms.includes("api") && (
|
|
23
22
|
<Link to="/dashboard/api-keys">API keys</Link>
|
|
24
23
|
)}
|
|
@@ -1,52 +1,72 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: disposabl-app
|
|
3
|
-
description:
|
|
3
|
+
description: Create, develop, and deliver Disposabl apps, with preview status updates and verification on the requested platforms.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Build a Disposabl app
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Build the user's requested app and keep its preview visible. Preserve their chosen name and platforms. Use the generated app's `disposabl.json` to identify the app; do not substitute another project's preview.
|
|
9
|
+
|
|
10
|
+
## Create and configure
|
|
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.
|
|
13
|
+
|
|
14
|
+
Discover platform and feature IDs, then create the app with explicit selections:
|
|
9
15
|
|
|
10
16
|
```sh
|
|
11
|
-
bun create disposabl-app@latest
|
|
17
|
+
bun create disposabl-app@latest --list-options
|
|
18
|
+
bun create disposabl-app@latest my-app --platforms web,android,mcp --features authentication --yes
|
|
12
19
|
```
|
|
13
20
|
|
|
14
|
-
Use the requested platforms and features. Creation
|
|
21
|
+
Use the requested platforms and features. Creation handles Disposabl login, required GitHub/Convex connections, 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
|
+
|
|
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
|
+
|
|
25
|
+
```sh
|
|
26
|
+
bunx --package create-disposabl-app@latest disposabl login status
|
|
27
|
+
bunx --package create-disposabl-app@latest disposabl previews get --help
|
|
28
|
+
```
|
|
15
29
|
|
|
16
|
-
Use
|
|
30
|
+
Use command help and the current API contract for other operations. If login is required, use the supported login flow and an existing authenticated browser when available. Never request provider passwords or copy another project's environment files.
|
|
17
31
|
|
|
18
|
-
|
|
32
|
+
## Implement and deliver
|
|
19
33
|
|
|
20
|
-
|
|
34
|
+
Choose a visual direction suited to the product. Use `frontend-design` when available and read [app branding and visual design](references/design.md). If that skill is unavailable, proceed with the user's brief and report the limitation without blocking development.
|
|
21
35
|
|
|
22
|
-
|
|
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.
|
|
23
37
|
|
|
24
|
-
A
|
|
38
|
+
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:
|
|
25
39
|
|
|
26
40
|
```sh
|
|
27
41
|
cd my-app
|
|
28
42
|
git push -u origin main
|
|
29
43
|
git worktree add ../my-app-feature -b feat/first-version
|
|
30
44
|
cd ../my-app-feature
|
|
31
|
-
bunx --package create-disposabl-app disposabl previews token create --configure .
|
|
45
|
+
bunx --package create-disposabl-app@latest disposabl previews token create --configure .
|
|
32
46
|
bun install
|
|
33
47
|
bun run dev
|
|
34
48
|
```
|
|
35
49
|
|
|
36
|
-
|
|
50
|
+
Use the host's worktree and delegation tools when required. Keep tokens in ignored environment files. Local development, PR previews, and production are separate deployments. Opening a same-repository PR to `main` triggers its preview; a branch push alone does not. Push only the intended reviewed changes and preserve unrelated work.
|
|
37
51
|
|
|
38
|
-
|
|
52
|
+
## Preview updates every two minutes
|
|
39
53
|
|
|
40
|
-
|
|
54
|
+
Run this in the active app worktree immediately after setup, after opening or updating its PR, and whenever the user asks for a preview:
|
|
41
55
|
|
|
42
|
-
|
|
56
|
+
```sh
|
|
57
|
+
bunx --package create-disposabl-app@latest disposabl previews get --json
|
|
58
|
+
```
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
While delivery is active, check again every **two minutes**. Track the last check time and continue useful work between checks. Use the host's scheduling/watcher rules; do not start an endless polling process or poll a delegated agent's status. If the host requires yielding to a PR watcher, yield and refresh Disposabl status on wake.
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
After each check, give a short update: the current stage, requested platforms that are ready or still building, any blocker, and the available preview or download links. If unchanged, say so briefly. On a failed status, diagnose the failure rather than repeatedly polling it. Stop periodic checks when all requested platforms are ready, delivery is blocked on a concrete user action, or the user stops the task.
|
|
47
63
|
|
|
48
|
-
When
|
|
64
|
+
When a preview becomes available, open that app's URL or install/open its APK in the supported device panel promptly, before lengthy verification. Do not replace the requested app preview with a dashboard or landing page. A configured URL, `enabled: true`, successful build, or local APK does not by itself prove the hosted preview is ready. If local and reported cloud states differ, explain the difference.
|
|
65
|
+
|
|
66
|
+
Verify the requested behavior, authentication, and saved data after relaunch on each requested platform. Report compilation, publication, and visible behavior separately. After an authorized merge, use `disposabl releases get --appId <appId>` for production status and verify its URLs separately. APK delivery does not require store submission; do not run `eas submit` unless requested.
|
|
67
|
+
|
|
68
|
+
## Delete an app
|
|
49
69
|
|
|
50
|
-
|
|
70
|
+
Only when requested, run `disposabl apps delete --appId <uuid> --dangerously-delete-app`. Apps with production releases cannot be deleted.
|
|
51
71
|
|
|
52
|
-
|
|
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# App branding and visual design
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use when creating or substantially redesigning a Disposabl app. Apply `frontend-design` when available; otherwise use the user's brief and the guidance below. Preserve an existing brand when provided.
|
|
4
4
|
|
|
5
5
|
Before implementing screens, derive a short brand direction from the app's purpose, audience, main task, and intended tone. Choose a fitting product name or use the supplied one, a typography hierarchy, color palette, spacing and shape rules, and an image/icon approach. Record the choices briefly in the implementation plan and proceed with reasonable assumptions when the brief is sufficient.
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-disposabl-app",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
4
4
|
"description": "Create a Disposabl app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "bun build.ts",
|
|
26
26
|
"typecheck": "bun check",
|
|
27
|
-
"lint": "eslint .",
|
|
27
|
+
"lint": "cd ../.. && packages/create-disposabl-app/node_modules/.bin/eslint --config packages/create-disposabl-app/eslint.config.ts packages/create-disposabl-app reset.ts",
|
|
28
28
|
"format": "bun fmt"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { createFileRoute, Link } from "@tanstack/react-router";
|
|
3
|
-
import { useAction, useMutation, useQuery } from "convex/react";
|
|
4
|
-
import { ConvexError } from "convex/values";
|
|
5
|
-
import { Check, ArrowRight } from "lucide-react";
|
|
6
|
-
import { api } from "../../../../../packages/backend/convex/_generated/api";
|
|
7
|
-
import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
|
|
8
|
-
import { Input } from "@disposabl/disposabl-kit/client/components/ui/input";
|
|
9
|
-
import { ProviderLogo } from "../../components/connections/provider-logo";
|
|
10
|
-
|
|
11
|
-
export const Route = createFileRoute(
|
|
12
|
-
"/_providers/_authenticated/dashboard/connections",
|
|
13
|
-
)({ component: Connections });
|
|
14
|
-
|
|
15
|
-
type Provider = "github" | "convex";
|
|
16
|
-
type Installation = { installationId: string; owner: string };
|
|
17
|
-
const pendingKey = "disposabl.pendingConnectionProvider";
|
|
18
|
-
const isProvider = (value: string | null): value is Provider =>
|
|
19
|
-
value === "github" || value === "convex";
|
|
20
|
-
|
|
21
|
-
function Connections() {
|
|
22
|
-
const status = useQuery(api.connections.index.status, {});
|
|
23
|
-
const start = useAction(api.connections.index.start);
|
|
24
|
-
const complete = useAction(api.connections.index.complete);
|
|
25
|
-
const selectGithub = useAction(api.connections.index.selectGithub);
|
|
26
|
-
const expoAccounts = useAction(api.connections.index.expoAccounts);
|
|
27
|
-
const connectExpo = useAction(api.connections.index.connectExpo);
|
|
28
|
-
const disconnect = useMutation(api.connections.index.disconnect);
|
|
29
|
-
const [busy, setBusy] = useState(false);
|
|
30
|
-
const [error, setError] = useState<string>();
|
|
31
|
-
const [installations, setInstallations] = useState<Installation[]>([]);
|
|
32
|
-
const [proof, setProof] = useState<string>();
|
|
33
|
-
const [installNeeded, setInstallNeeded] = useState(false);
|
|
34
|
-
const [returnedFromInstall, setReturnedFromInstall] = useState(false);
|
|
35
|
-
const [token, setToken] = useState("");
|
|
36
|
-
const [showExpo, setShowExpo] = useState(false);
|
|
37
|
-
const [accounts, setAccounts] = useState<Array<{ id: string; name: string }>>(
|
|
38
|
-
[],
|
|
39
|
-
);
|
|
40
|
-
const [accountId, setAccountId] = useState("");
|
|
41
|
-
const consumed = useRef(false);
|
|
42
|
-
const fail = (cause: unknown) =>
|
|
43
|
-
setError(
|
|
44
|
-
cause instanceof ConvexError && typeof cause.data === "string"
|
|
45
|
-
? cause.data
|
|
46
|
-
: cause instanceof Error
|
|
47
|
-
? cause.message
|
|
48
|
-
: "Something went wrong. Please try again.",
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (consumed.current) return;
|
|
53
|
-
consumed.current = true;
|
|
54
|
-
const url = new URL(window.location.href);
|
|
55
|
-
const queryProvider = url.searchParams.get("provider");
|
|
56
|
-
const pending = sessionStorage.getItem(pendingKey);
|
|
57
|
-
const provider = isProvider(queryProvider)
|
|
58
|
-
? queryProvider
|
|
59
|
-
: isProvider(pending)
|
|
60
|
-
? pending
|
|
61
|
-
: null;
|
|
62
|
-
const code = url.searchParams.get("code");
|
|
63
|
-
const state = url.searchParams.get("state");
|
|
64
|
-
const denial = url.searchParams.get("error");
|
|
65
|
-
const installationReturn =
|
|
66
|
-
url.searchParams.has("installation_id") ||
|
|
67
|
-
url.searchParams.has("setup_action");
|
|
68
|
-
if (installationReturn) setReturnedFromInstall(true);
|
|
69
|
-
const callback =
|
|
70
|
-
code !== null ||
|
|
71
|
-
state !== null ||
|
|
72
|
-
denial !== null ||
|
|
73
|
-
queryProvider !== null;
|
|
74
|
-
if (!callback || (installationReturn && !code && !state && !denial)) return;
|
|
75
|
-
if (denial) {
|
|
76
|
-
setError(
|
|
77
|
-
"Authorization was cancelled or denied. Please try connecting again.",
|
|
78
|
-
);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (!provider || !code || !state) {
|
|
82
|
-
setError(
|
|
83
|
-
"The authorization response is incomplete. Please connect again to restart authorization.",
|
|
84
|
-
);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
// Capture the callback before removing it; the backend verifies the OAuth state.
|
|
88
|
-
for (const key of [
|
|
89
|
-
"provider",
|
|
90
|
-
"code",
|
|
91
|
-
"state",
|
|
92
|
-
"error",
|
|
93
|
-
"error_description",
|
|
94
|
-
"installation_id",
|
|
95
|
-
"setup_action",
|
|
96
|
-
])
|
|
97
|
-
url.searchParams.delete(key);
|
|
98
|
-
window.history.replaceState(window.history.state, "", url.toString());
|
|
99
|
-
sessionStorage.removeItem(pendingKey);
|
|
100
|
-
setBusy(true);
|
|
101
|
-
void complete({ provider, code, state })
|
|
102
|
-
.then(async (result) => {
|
|
103
|
-
if (provider !== "github") return;
|
|
104
|
-
const installation = result.installations.at(0);
|
|
105
|
-
if (result.installations.length === 1 && installation) {
|
|
106
|
-
if (!result.proof)
|
|
107
|
-
throw new Error(
|
|
108
|
-
"GitHub did not return an account selection proof. Please connect again.",
|
|
109
|
-
);
|
|
110
|
-
await selectGithub({
|
|
111
|
-
proof: result.proof,
|
|
112
|
-
installationId: installation.installationId,
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
setInstallations(result.installations);
|
|
116
|
-
setProof(result.proof);
|
|
117
|
-
setInstallNeeded(result.installations.length === 0);
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
.catch(fail)
|
|
121
|
-
.finally(() => setBusy(false));
|
|
122
|
-
}, [complete, selectGithub]);
|
|
123
|
-
|
|
124
|
-
async function run(action: () => Promise<void>) {
|
|
125
|
-
if (busy) return;
|
|
126
|
-
setBusy(true);
|
|
127
|
-
setError(undefined);
|
|
128
|
-
try {
|
|
129
|
-
await action();
|
|
130
|
-
} catch (cause) {
|
|
131
|
-
fail(cause);
|
|
132
|
-
} finally {
|
|
133
|
-
setBusy(false);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function connect(provider: Provider) {
|
|
137
|
-
void run(async () => {
|
|
138
|
-
const url = await start({ provider });
|
|
139
|
-
sessionStorage.setItem(pendingKey, provider);
|
|
140
|
-
window.location.assign(url);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
const providers = [
|
|
144
|
-
{
|
|
145
|
-
id: "github",
|
|
146
|
-
name: "GitHub",
|
|
147
|
-
description: "Create and manage your app's repository.",
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
id: "convex",
|
|
151
|
-
name: "Convex",
|
|
152
|
-
description: "Run your backend in your own Convex team.",
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: "expo",
|
|
156
|
-
name: "Expo",
|
|
157
|
-
description: "Build and update your mobile app.",
|
|
158
|
-
},
|
|
159
|
-
] as const;
|
|
160
|
-
const completed =
|
|
161
|
-
Number(Boolean(status?.github)) + Number(Boolean(status?.convex));
|
|
162
|
-
|
|
163
|
-
return (
|
|
164
|
-
<main className="mx-auto max-w-3xl px-5 py-10 sm:px-8 sm:py-16">
|
|
165
|
-
<header className="mb-8 sm:mb-10">
|
|
166
|
-
<p className="mb-3 text-xs font-semibold tracking-[0.18em] text-muted-foreground uppercase">
|
|
167
|
-
Set up your workspace
|
|
168
|
-
</p>
|
|
169
|
-
<h1 className="max-w-2xl text-3xl font-semibold tracking-tight sm:text-4xl">
|
|
170
|
-
Your code. Your data.
|
|
171
|
-
<br />
|
|
172
|
-
Your accounts.
|
|
173
|
-
</h1>
|
|
174
|
-
<p className="mt-4 max-w-xl text-sm leading-6 text-muted-foreground sm:text-base">
|
|
175
|
-
Connect GitHub and Convex to create your app in accounts you control.
|
|
176
|
-
Add Expo when you're ready to build for mobile.
|
|
177
|
-
</p>
|
|
178
|
-
</header>
|
|
179
|
-
<div className="mb-5 flex items-center justify-between gap-3 text-sm">
|
|
180
|
-
<span className="font-medium">Connect your accounts</span>
|
|
181
|
-
<span className="text-muted-foreground">
|
|
182
|
-
{completed} of 2 connected
|
|
183
|
-
</span>
|
|
184
|
-
</div>
|
|
185
|
-
<div
|
|
186
|
-
className="mb-6 flex gap-1.5"
|
|
187
|
-
aria-label={`${completed} of 2 accounts connected`}
|
|
188
|
-
>
|
|
189
|
-
{[1, 2].map((step) => (
|
|
190
|
-
<div
|
|
191
|
-
key={step}
|
|
192
|
-
className={`h-1.5 flex-1 rounded-full ${completed >= step ? "bg-primary" : "bg-muted"}`}
|
|
193
|
-
/>
|
|
194
|
-
))}
|
|
195
|
-
</div>
|
|
196
|
-
{error && (
|
|
197
|
-
<p
|
|
198
|
-
role="alert"
|
|
199
|
-
className="mb-5 rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive"
|
|
200
|
-
>
|
|
201
|
-
{error}
|
|
202
|
-
</p>
|
|
203
|
-
)}
|
|
204
|
-
{!status ? (
|
|
205
|
-
<p role="status" className="text-sm text-muted-foreground">
|
|
206
|
-
Loading connections…
|
|
207
|
-
</p>
|
|
208
|
-
) : (
|
|
209
|
-
<div className="space-y-3">
|
|
210
|
-
{providers.map(({ id, name, description }, index) => {
|
|
211
|
-
const connected = status[id];
|
|
212
|
-
return (
|
|
213
|
-
<section
|
|
214
|
-
key={id}
|
|
215
|
-
className="rounded-2xl border bg-card p-5 shadow-sm sm:p-6"
|
|
216
|
-
>
|
|
217
|
-
<div className="flex flex-wrap items-center gap-4 sm:flex-nowrap">
|
|
218
|
-
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl border bg-background">
|
|
219
|
-
<ProviderLogo provider={id} />
|
|
220
|
-
</div>
|
|
221
|
-
<div className="min-w-0 flex-1">
|
|
222
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
223
|
-
<h2 className="font-semibold">{name}</h2>
|
|
224
|
-
{connected ? (
|
|
225
|
-
<span className="inline-flex items-center gap-1 rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-400">
|
|
226
|
-
<Check className="size-3" /> Connected
|
|
227
|
-
</span>
|
|
228
|
-
) : id === "expo" ? (
|
|
229
|
-
<span className="text-xs text-muted-foreground">
|
|
230
|
-
Optional
|
|
231
|
-
</span>
|
|
232
|
-
) : (
|
|
233
|
-
<span className="text-xs text-muted-foreground">
|
|
234
|
-
Step {index + 1}
|
|
235
|
-
</span>
|
|
236
|
-
)}
|
|
237
|
-
</div>
|
|
238
|
-
<p className="mt-1 text-sm text-muted-foreground">
|
|
239
|
-
{connected
|
|
240
|
-
? "owner" in connected
|
|
241
|
-
? connected.owner
|
|
242
|
-
: connected.name
|
|
243
|
-
: description}
|
|
244
|
-
</p>
|
|
245
|
-
</div>
|
|
246
|
-
{connected ? (
|
|
247
|
-
<Button
|
|
248
|
-
variant="outline"
|
|
249
|
-
className="min-h-11"
|
|
250
|
-
disabled={busy}
|
|
251
|
-
onClick={() =>
|
|
252
|
-
void run(async () => {
|
|
253
|
-
await disconnect({ provider: id });
|
|
254
|
-
})
|
|
255
|
-
}
|
|
256
|
-
>
|
|
257
|
-
Disconnect
|
|
258
|
-
</Button>
|
|
259
|
-
) : (
|
|
260
|
-
<Button
|
|
261
|
-
className="min-h-11"
|
|
262
|
-
disabled={busy || !status.available[id]}
|
|
263
|
-
onClick={() =>
|
|
264
|
-
id === "expo" ? setShowExpo(!showExpo) : connect(id)
|
|
265
|
-
}
|
|
266
|
-
>
|
|
267
|
-
{id === "expo" && showExpo
|
|
268
|
-
? "Cancel"
|
|
269
|
-
: id === "github" && returnedFromInstall
|
|
270
|
-
? "Connect again"
|
|
271
|
-
: "Connect"}
|
|
272
|
-
</Button>
|
|
273
|
-
)}
|
|
274
|
-
</div>
|
|
275
|
-
{!status.available[id] && !connected && (
|
|
276
|
-
<p className="mt-4 text-sm text-muted-foreground">
|
|
277
|
-
Temporarily unavailable.
|
|
278
|
-
</p>
|
|
279
|
-
)}
|
|
280
|
-
{id === "github" && installations.length > 1 && (
|
|
281
|
-
<div className="mt-5 border-t pt-4">
|
|
282
|
-
<p className="mb-3 text-sm font-medium">Select account</p>
|
|
283
|
-
<div className="flex flex-wrap gap-2">
|
|
284
|
-
{installations.map((installation) => (
|
|
285
|
-
<Button
|
|
286
|
-
key={installation.installationId}
|
|
287
|
-
variant="outline"
|
|
288
|
-
disabled={busy || !proof}
|
|
289
|
-
onClick={() =>
|
|
290
|
-
void run(async () => {
|
|
291
|
-
if (!proof) return;
|
|
292
|
-
await selectGithub({
|
|
293
|
-
proof,
|
|
294
|
-
installationId: installation.installationId,
|
|
295
|
-
});
|
|
296
|
-
setInstallations([]);
|
|
297
|
-
setProof(undefined);
|
|
298
|
-
})
|
|
299
|
-
}
|
|
300
|
-
>
|
|
301
|
-
{installation.owner}
|
|
302
|
-
</Button>
|
|
303
|
-
))}
|
|
304
|
-
</div>
|
|
305
|
-
</div>
|
|
306
|
-
)}
|
|
307
|
-
{id === "github" && installNeeded && (
|
|
308
|
-
<p className="mt-4 text-sm">
|
|
309
|
-
Install Disposabl on GitHub, then return here and connect
|
|
310
|
-
again.{" "}
|
|
311
|
-
{status.githubInstallUrl && (
|
|
312
|
-
<a
|
|
313
|
-
className="font-medium underline underline-offset-4"
|
|
314
|
-
href={status.githubInstallUrl}
|
|
315
|
-
>
|
|
316
|
-
Install on GitHub
|
|
317
|
-
</a>
|
|
318
|
-
)}
|
|
319
|
-
</p>
|
|
320
|
-
)}
|
|
321
|
-
{id === "expo" && !connected && showExpo && (
|
|
322
|
-
<form
|
|
323
|
-
className="mt-5 space-y-4 border-t pt-5"
|
|
324
|
-
onSubmit={(event) => {
|
|
325
|
-
event.preventDefault();
|
|
326
|
-
void run(async () => {
|
|
327
|
-
if (!accounts.length) {
|
|
328
|
-
const result = await expoAccounts({ token });
|
|
329
|
-
if (!result.length)
|
|
330
|
-
throw new Error(
|
|
331
|
-
"No Expo accounts were found for this token.",
|
|
332
|
-
);
|
|
333
|
-
setAccounts(result);
|
|
334
|
-
setAccountId(result[0]?.id ?? "");
|
|
335
|
-
} else {
|
|
336
|
-
await connectExpo({ token, accountId });
|
|
337
|
-
setToken("");
|
|
338
|
-
setAccounts([]);
|
|
339
|
-
setAccountId("");
|
|
340
|
-
setShowExpo(false);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
}}
|
|
344
|
-
>
|
|
345
|
-
<p className="text-sm text-muted-foreground">
|
|
346
|
-
Verify an Expo access token, then choose the account to
|
|
347
|
-
save.
|
|
348
|
-
</p>
|
|
349
|
-
<label className="block space-y-2 text-sm font-medium">
|
|
350
|
-
Access token
|
|
351
|
-
<Input
|
|
352
|
-
type="password"
|
|
353
|
-
autoComplete="off"
|
|
354
|
-
required
|
|
355
|
-
value={token}
|
|
356
|
-
onChange={(event) => {
|
|
357
|
-
setToken(event.target.value);
|
|
358
|
-
setAccounts([]);
|
|
359
|
-
setAccountId("");
|
|
360
|
-
}}
|
|
361
|
-
/>
|
|
362
|
-
</label>
|
|
363
|
-
<a
|
|
364
|
-
className="inline-block text-sm underline underline-offset-4"
|
|
365
|
-
href="https://expo.dev/settings/access-tokens"
|
|
366
|
-
target="_blank"
|
|
367
|
-
rel="noreferrer"
|
|
368
|
-
>
|
|
369
|
-
Create an Expo access token
|
|
370
|
-
</a>
|
|
371
|
-
{accounts.length > 0 && (
|
|
372
|
-
<label className="block space-y-2 text-sm font-medium">
|
|
373
|
-
Expo account
|
|
374
|
-
<select
|
|
375
|
-
className="block min-h-11 w-full rounded-md border bg-background px-3"
|
|
376
|
-
value={accountId}
|
|
377
|
-
onChange={(event) => setAccountId(event.target.value)}
|
|
378
|
-
>
|
|
379
|
-
{accounts.map((account) => (
|
|
380
|
-
<option key={account.id} value={account.id}>
|
|
381
|
-
{account.name}
|
|
382
|
-
</option>
|
|
383
|
-
))}
|
|
384
|
-
</select>
|
|
385
|
-
</label>
|
|
386
|
-
)}
|
|
387
|
-
<div>
|
|
388
|
-
<Button
|
|
389
|
-
type="submit"
|
|
390
|
-
className="min-h-11"
|
|
391
|
-
disabled={busy || !token.trim()}
|
|
392
|
-
>
|
|
393
|
-
{accounts.length ? "Save account" : "Verify token"}
|
|
394
|
-
</Button>
|
|
395
|
-
</div>
|
|
396
|
-
</form>
|
|
397
|
-
)}
|
|
398
|
-
</section>
|
|
399
|
-
);
|
|
400
|
-
})}
|
|
401
|
-
</div>
|
|
402
|
-
)}
|
|
403
|
-
{busy && (
|
|
404
|
-
<p role="status" className="mt-4 text-sm text-muted-foreground">
|
|
405
|
-
Connecting…
|
|
406
|
-
</p>
|
|
407
|
-
)}
|
|
408
|
-
<div className="mt-8 flex flex-wrap items-center justify-between gap-4 border-t pt-6">
|
|
409
|
-
<p className="text-sm text-muted-foreground">
|
|
410
|
-
{status?.ready
|
|
411
|
-
? "Your accounts are connected. Continue in your terminal or dashboard."
|
|
412
|
-
: "Connect GitHub and Convex to continue."}
|
|
413
|
-
</p>
|
|
414
|
-
{status?.ready ? (
|
|
415
|
-
<Link
|
|
416
|
-
to="/dashboard"
|
|
417
|
-
className="inline-flex min-h-11 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
|
418
|
-
>
|
|
419
|
-
Continue <ArrowRight className="ml-2 size-4" />
|
|
420
|
-
</Link>
|
|
421
|
-
) : (
|
|
422
|
-
<Button disabled className="min-h-11">
|
|
423
|
-
Continue <ArrowRight className="ml-2 size-4" />
|
|
424
|
-
</Button>
|
|
425
|
-
)}
|
|
426
|
-
</div>
|
|
427
|
-
<details className="mt-8 text-sm text-muted-foreground">
|
|
428
|
-
<summary className="cursor-pointer font-medium">
|
|
429
|
-
Permissions and security
|
|
430
|
-
</summary>
|
|
431
|
-
<div className="mt-3 space-y-2 leading-relaxed">
|
|
432
|
-
<p>
|
|
433
|
-
GitHub access creates repositories and manages builds, releases and
|
|
434
|
-
CI secrets. Convex access can create and manage projects in your
|
|
435
|
-
selected team. Expo tokens are verified before saving.
|
|
436
|
-
</p>
|
|
437
|
-
<p>
|
|
438
|
-
Saved tokens are encrypted. Disconnect here to remove saved access,
|
|
439
|
-
and revoke provider access and CI tokens in their settings.
|
|
440
|
-
</p>
|
|
441
|
-
</div>
|
|
442
|
-
</details>
|
|
443
|
-
</main>
|
|
444
|
-
);
|
|
445
|
-
}
|