create-disposabl-app 0.8.1 → 0.8.3
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 +36 -2
- package/dist/index.js +73 -5
- package/dist/templates/default/.github/scripts/apple.sh +62 -0
- package/dist/templates/default/.github/scripts/disposabl.mjs +31 -14
- package/dist/templates/default/.github/scripts/mobile.sh +9 -9
- package/dist/templates/default/.github/scripts/platforms.sh +3 -3
- package/dist/templates/default/.github/scripts/release.sh +1 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +116 -12
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +5 -0
- package/dist/templates/default/apps/desktop/.oxlintrc.json +6 -0
- package/dist/templates/default/apps/desktop/README.md +90 -0
- package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +124 -0
- package/dist/templates/default/apps/desktop/gitignore +146 -0
- package/dist/templates/default/apps/desktop/index.html +16 -0
- package/dist/templates/default/apps/desktop/package.json +55 -0
- package/dist/templates/default/apps/desktop/rpm.spec.ejs +84 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.icns +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.ico +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.png +0 -0
- package/dist/templates/default/apps/desktop/src/assets/logo.svg +8 -0
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +4 -0
- package/dist/templates/default/apps/desktop/src/index.css +27 -0
- package/dist/templates/default/apps/desktop/src/main.ts +54 -0
- package/dist/templates/default/apps/desktop/src/preload.ts +3 -0
- package/dist/templates/default/apps/desktop/src/renderer.ts +1 -0
- package/dist/templates/default/apps/desktop/tsconfig.json +14 -0
- package/dist/templates/default/apps/desktop/vite.main.config.mts +9 -0
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +4 -0
- package/dist/templates/default/apps/mobile/README.md +1 -1
- package/dist/templates/default/apps/mobile/eas.json +2 -2
- package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +38 -0
- package/dist/templates/default/apps/web/src/index.css +0 -22
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.connections.tsx +244 -153
- package/dist/templates/default/bun.lock +4 -0
- package/dist/templates/default/dev.ts +22 -6
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +10 -0
- package/dist/templates/default/packages/backend/convex/apps/actions/cleanup.ts +1 -0
- package/dist/templates/default/packages/backend/convex/apps/internal.ts +17 -1
- package/dist/templates/default/packages/backend/convex/connections/actions/github.ts +5 -4
- package/dist/templates/default/packages/backend/convex/connections/actions/oauth.ts +2 -2
- package/dist/templates/default/packages/backend/convex/downloads/action.ts +136 -0
- package/dist/templates/default/packages/backend/convex/downloads/http.ts +32 -0
- package/dist/templates/default/packages/backend/convex/downloads/internal.ts +58 -0
- package/dist/templates/default/packages/backend/convex/github/actions/http.ts +37 -8
- package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +1 -0
- package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +1 -1
- package/dist/templates/default/packages/backend/convex/github/actions/secrets.ts +38 -6
- package/dist/templates/default/packages/backend/convex/github/actions/signing.ts +41 -0
- package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +82 -16
- package/dist/templates/default/packages/backend/convex/github/identityCache.ts +54 -0
- package/dist/templates/default/packages/backend/convex/http.ts +3 -0
- package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +21 -3
- package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +17 -2
- package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +4 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +7 -0
- package/dist/templates/default/packages/backend/generated/openapi.json +107 -1
- package/dist/templates/default/packages/backend/generated/platforms.ts +12 -10
- package/dist/templates/default/packages/backend/package.json +3 -1
- package/dist/templates/default/packages/cli/preview.ts +63 -0
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +3 -0
- package/dist/templates/default/packages/sdk/src/generated/index.ts +5 -0
- package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +20 -0
- package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +69 -0
- package/dist/templates/default/packages/skill/SKILL.md +38 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "preserve",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"noImplicitAny": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"resolveJsonModule": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*", "*.ts", "*.mts"]
|
|
14
|
+
}
|
|
@@ -186,4 +186,4 @@ credentials fail the iOS build instead of silently skipping it.
|
|
|
186
186
|
It does not require TestFlight or an App Store Connect app record. TestFlight is
|
|
187
187
|
a separate distribution option. The pipeline never submits to the App Store.
|
|
188
188
|
|
|
189
|
-
Android preview builds produce an installable APK. Production builds produce
|
|
189
|
+
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.
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"build": {
|
|
7
7
|
"ios-preview": {
|
|
8
8
|
"developmentClient": false,
|
|
9
|
-
"
|
|
9
|
+
"ios": { "simulator": true },
|
|
10
10
|
"environment": "preview",
|
|
11
11
|
"credentialsSource": "remote",
|
|
12
12
|
"channel": "preview"
|
|
13
13
|
},
|
|
14
14
|
"ios-production": {
|
|
15
15
|
"developmentClient": false,
|
|
16
|
-
"distribution": "
|
|
16
|
+
"distribution": "store",
|
|
17
17
|
"environment": "production",
|
|
18
18
|
"credentialsSource": "remote",
|
|
19
19
|
"channel": "production"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function ProviderLogo({
|
|
2
|
+
provider,
|
|
3
|
+
}: {
|
|
4
|
+
provider: "github" | "convex" | "expo";
|
|
5
|
+
}) {
|
|
6
|
+
if (provider === "github")
|
|
7
|
+
return (
|
|
8
|
+
<svg
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="currentColor"
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
className="size-6"
|
|
13
|
+
>
|
|
14
|
+
<path d="M12 .5a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58v-2.23c-3.34.73-4.04-1.42-4.04-1.42-.55-1.39-1.33-1.76-1.33-1.76-1.09-.75.08-.73.08-.73 1.2.08 1.83 1.23 1.83 1.23 1.07 1.83 2.8 1.3 3.49.99.1-.77.42-1.3.76-1.6-2.67-.31-5.47-1.34-5.47-5.93 0-1.31.47-2.38 1.23-3.22-.12-.3-.53-1.52.12-3.17 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.29-1.55 3.29-1.23 3.29-1.23.65 1.65.24 2.87.12 3.17.77.84 1.23 1.91 1.23 3.22 0 4.6-2.8 5.62-5.48 5.92.43.37.81 1.1.81 2.22v3.3c0 .32.22.7.83.58A12 12 0 0 0 12 .5Z" />
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
if (provider === "expo")
|
|
18
|
+
return (
|
|
19
|
+
<svg
|
|
20
|
+
viewBox="0 0 24 24"
|
|
21
|
+
fill="currentColor"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
className="size-6"
|
|
24
|
+
>
|
|
25
|
+
<path d="M12 2c-.9 0-1.37.24-1.76.84-1.1 1.67-6.42 10.95-7.2 12.34-.52.92-.67 1.5-.45 2.19.31.96 1.26 1.65 2.18 1.65.66 0 1.11-.3 1.61-.98 1.07-1.47 3.43-5.61 4.74-7.47.28-.4.53-.61.88-.61s.6.21.88.61c1.31 1.86 3.67 6 4.74 7.47.5.68.95.98 1.61.98.92 0 1.87-.69 2.18-1.65.22-.69.07-1.27-.45-2.19-.78-1.39-6.1-10.67-7.2-12.34C13.37 2.24 12.9 2 12 2Z" />
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
return (
|
|
29
|
+
<svg
|
|
30
|
+
viewBox="0 0 24 24"
|
|
31
|
+
fill="#EE342F"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
className="size-7"
|
|
34
|
+
>
|
|
35
|
+
<path d="M15.09 18.916c3.488-.387 6.776-2.246 8.586-5.348-.857 7.673-9.247 12.522-16.095 9.545a3.47 3.47 0 0 1-1.547-1.314c-1.539-2.417-2.044-5.492-1.318-8.282 2.077 3.584 6.3 5.78 10.374 5.399m-10.501-7.65c-1.414 3.266-1.475 7.092.258 10.24-6.1-4.59-6.033-14.41-.074-18.953a3.44 3.44 0 0 1 1.893-.707c2.825-.15 5.695.942 7.708 2.977-4.09.04-8.073 2.66-9.785 6.442m11.757-5.437C14.283 2.951 11.053.992 7.515.933c6.84-3.105 15.253 1.929 16.17 9.37a3.6 3.6 0 0 1-.334 2.02c-1.278 2.594-3.647 4.607-6.416 5.352 2.029-3.763 1.778-8.36-.589-11.847" />
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -70,28 +70,6 @@
|
|
|
70
70
|
--sidebar-border: oklch(1 0 0 / 10%);
|
|
71
71
|
--sidebar-ring: oklch(0.556 0 0);
|
|
72
72
|
}
|
|
73
|
-
@font-face {
|
|
74
|
-
font-family: "Disposabl Landing Sans";
|
|
75
|
-
src: url("./assets/landing/general-sans-400.woff2") format("woff2");
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
font-display: swap;
|
|
78
|
-
}
|
|
79
|
-
@font-face {
|
|
80
|
-
font-family: "Disposabl Landing Sans";
|
|
81
|
-
src: url("./assets/landing/general-sans-500.woff2") format("woff2");
|
|
82
|
-
font-weight: 500;
|
|
83
|
-
font-display: swap;
|
|
84
|
-
}
|
|
85
|
-
@font-face {
|
|
86
|
-
font-family: "Disposabl Landing Sans";
|
|
87
|
-
src: url("./assets/landing/general-sans-600.woff2") format("woff2");
|
|
88
|
-
font-weight: 600;
|
|
89
|
-
font-display: swap;
|
|
90
|
-
}
|
|
91
|
-
@theme inline {
|
|
92
|
-
--font-landing: "Disposabl Landing Sans", sans-serif;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
73
|
@keyframes disposabl-draw-check {
|
|
96
74
|
to {
|
|
97
75
|
stroke-dashoffset: 0;
|
|
@@ -2,14 +2,21 @@ import { useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import { createFileRoute, Link } from "@tanstack/react-router";
|
|
3
3
|
import { useAction, useMutation, useQuery } from "convex/react";
|
|
4
4
|
import { ConvexError } from "convex/values";
|
|
5
|
+
import { Check, ArrowRight } from "lucide-react";
|
|
5
6
|
import { api } from "../../../../../packages/backend/convex/_generated/api";
|
|
6
7
|
import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
|
|
7
8
|
import { Input } from "@disposabl/disposabl-kit/client/components/ui/input";
|
|
9
|
+
import { ProviderLogo } from "../../components/connections/provider-logo";
|
|
8
10
|
|
|
9
11
|
export const Route = createFileRoute(
|
|
10
12
|
"/_providers/_authenticated/dashboard/connections",
|
|
11
13
|
)({ component: Connections });
|
|
14
|
+
|
|
15
|
+
type Provider = "github" | "convex";
|
|
12
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";
|
|
13
20
|
|
|
14
21
|
function Connections() {
|
|
15
22
|
const status = useQuery(api.connections.index.status, {});
|
|
@@ -45,11 +52,39 @@ function Connections() {
|
|
|
45
52
|
if (consumed.current) return;
|
|
46
53
|
consumed.current = true;
|
|
47
54
|
const url = new URL(window.location.href);
|
|
48
|
-
const
|
|
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;
|
|
49
62
|
const code = url.searchParams.get("code");
|
|
50
63
|
const state = url.searchParams.get("state");
|
|
51
64
|
const denial = url.searchParams.get("error");
|
|
52
|
-
|
|
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.
|
|
53
88
|
for (const key of [
|
|
54
89
|
"provider",
|
|
55
90
|
"code",
|
|
@@ -61,16 +96,22 @@ function Connections() {
|
|
|
61
96
|
])
|
|
62
97
|
url.searchParams.delete(key);
|
|
63
98
|
window.history.replaceState(window.history.state, "", url.toString());
|
|
64
|
-
|
|
65
|
-
setError("Authorization was cancelled or denied. Please try again.");
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if ((provider !== "github" && provider !== "convex") || !code || !state)
|
|
69
|
-
return;
|
|
99
|
+
sessionStorage.removeItem(pendingKey);
|
|
70
100
|
setBusy(true);
|
|
71
101
|
void complete({ provider, code, state })
|
|
72
|
-
.then((result) => {
|
|
73
|
-
if (provider
|
|
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 {
|
|
74
115
|
setInstallations(result.installations);
|
|
75
116
|
setProof(result.proof);
|
|
76
117
|
setInstallNeeded(result.installations.length === 0);
|
|
@@ -78,7 +119,7 @@ function Connections() {
|
|
|
78
119
|
})
|
|
79
120
|
.catch(fail)
|
|
80
121
|
.finally(() => setBusy(false));
|
|
81
|
-
}, [complete]);
|
|
122
|
+
}, [complete, selectGithub]);
|
|
82
123
|
|
|
83
124
|
async function run(action: () => Promise<void>) {
|
|
84
125
|
if (busy) return;
|
|
@@ -92,42 +133,109 @@ function Connections() {
|
|
|
92
133
|
setBusy(false);
|
|
93
134
|
}
|
|
94
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
|
+
}
|
|
95
143
|
const providers = [
|
|
96
|
-
{
|
|
144
|
+
{
|
|
145
|
+
id: "github",
|
|
146
|
+
name: "GitHub",
|
|
147
|
+
description: "Create and manage your app's repository.",
|
|
148
|
+
},
|
|
97
149
|
{
|
|
98
150
|
id: "convex",
|
|
99
151
|
name: "Convex",
|
|
100
|
-
description: "
|
|
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.",
|
|
101
158
|
},
|
|
102
|
-
{ id: "expo", name: "Expo", description: "Mobile builds and updates" },
|
|
103
159
|
] as const;
|
|
160
|
+
const completed =
|
|
161
|
+
Number(Boolean(status?.github)) + Number(Boolean(status?.convex));
|
|
162
|
+
|
|
104
163
|
return (
|
|
105
|
-
<main className="mx-auto max-w-
|
|
106
|
-
<header>
|
|
107
|
-
<
|
|
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>
|
|
108
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>
|
|
109
196
|
{error && (
|
|
110
|
-
<p
|
|
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
|
+
>
|
|
111
201
|
{error}
|
|
112
202
|
</p>
|
|
113
203
|
)}
|
|
114
204
|
{!status ? (
|
|
115
|
-
<p role="status">
|
|
205
|
+
<p role="status" className="text-sm text-muted-foreground">
|
|
206
|
+
Loading connections…
|
|
207
|
+
</p>
|
|
116
208
|
) : (
|
|
117
209
|
<div className="space-y-3">
|
|
118
|
-
{providers.map(({ id, name, description }) => {
|
|
210
|
+
{providers.map(({ id, name, description }, index) => {
|
|
119
211
|
const connected = status[id];
|
|
120
212
|
return (
|
|
121
|
-
<section
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
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">
|
|
131
239
|
{connected
|
|
132
240
|
? "owner" in connected
|
|
133
241
|
? connected.owner
|
|
@@ -138,7 +246,7 @@ function Connections() {
|
|
|
138
246
|
{connected ? (
|
|
139
247
|
<Button
|
|
140
248
|
variant="outline"
|
|
141
|
-
className="min-h-11
|
|
249
|
+
className="min-h-11"
|
|
142
250
|
disabled={busy}
|
|
143
251
|
onClick={() =>
|
|
144
252
|
void run(async () => {
|
|
@@ -150,39 +258,78 @@ function Connections() {
|
|
|
150
258
|
</Button>
|
|
151
259
|
) : (
|
|
152
260
|
<Button
|
|
153
|
-
className="min-h-11
|
|
261
|
+
className="min-h-11"
|
|
154
262
|
disabled={busy || !status.available[id]}
|
|
155
|
-
onClick={() =>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
void run(async () => {
|
|
161
|
-
window.location.assign(await start({ provider: id }));
|
|
162
|
-
});
|
|
163
|
-
}}
|
|
263
|
+
onClick={() =>
|
|
264
|
+
id === "expo" ? setShowExpo(!showExpo) : connect(id)
|
|
265
|
+
}
|
|
164
266
|
>
|
|
165
|
-
{
|
|
166
|
-
? "
|
|
167
|
-
: id === "
|
|
168
|
-
? "
|
|
267
|
+
{id === "expo" && showExpo
|
|
268
|
+
? "Cancel"
|
|
269
|
+
: id === "github" && returnedFromInstall
|
|
270
|
+
? "Connect again"
|
|
169
271
|
: "Connect"}
|
|
170
272
|
</Button>
|
|
171
273
|
)}
|
|
172
274
|
</div>
|
|
173
275
|
{!status.available[id] && !connected && (
|
|
174
|
-
<p className="text-
|
|
276
|
+
<p className="mt-4 text-sm text-muted-foreground">
|
|
175
277
|
Temporarily unavailable.
|
|
176
278
|
</p>
|
|
177
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
|
+
)}
|
|
178
321
|
{id === "expo" && !connected && showExpo && (
|
|
179
322
|
<form
|
|
180
|
-
className="space-y-
|
|
323
|
+
className="mt-5 space-y-4 border-t pt-5"
|
|
181
324
|
onSubmit={(event) => {
|
|
182
325
|
event.preventDefault();
|
|
183
326
|
void run(async () => {
|
|
184
327
|
if (!accounts.length) {
|
|
185
328
|
const result = await expoAccounts({ token });
|
|
329
|
+
if (!result.length)
|
|
330
|
+
throw new Error(
|
|
331
|
+
"No Expo accounts were found for this token.",
|
|
332
|
+
);
|
|
186
333
|
setAccounts(result);
|
|
187
334
|
setAccountId(result[0]?.id ?? "");
|
|
188
335
|
} else {
|
|
@@ -195,7 +342,11 @@ function Connections() {
|
|
|
195
342
|
});
|
|
196
343
|
}}
|
|
197
344
|
>
|
|
198
|
-
<
|
|
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">
|
|
199
350
|
Access token
|
|
200
351
|
<Input
|
|
201
352
|
type="password"
|
|
@@ -210,16 +361,16 @@ function Connections() {
|
|
|
210
361
|
/>
|
|
211
362
|
</label>
|
|
212
363
|
<a
|
|
213
|
-
className="inline-block text-
|
|
364
|
+
className="inline-block text-sm underline underline-offset-4"
|
|
214
365
|
href="https://expo.dev/settings/access-tokens"
|
|
215
366
|
target="_blank"
|
|
216
367
|
rel="noreferrer"
|
|
217
368
|
>
|
|
218
|
-
|
|
369
|
+
Create an Expo access token
|
|
219
370
|
</a>
|
|
220
371
|
{accounts.length > 0 && (
|
|
221
|
-
<label className="block space-y-
|
|
222
|
-
|
|
372
|
+
<label className="block space-y-2 text-sm font-medium">
|
|
373
|
+
Expo account
|
|
223
374
|
<select
|
|
224
375
|
className="block min-h-11 w-full rounded-md border bg-background px-3"
|
|
225
376
|
value={accountId}
|
|
@@ -233,48 +384,16 @@ function Connections() {
|
|
|
233
384
|
</select>
|
|
234
385
|
</label>
|
|
235
386
|
)}
|
|
236
|
-
<
|
|
237
|
-
type="submit"
|
|
238
|
-
className="min-h-11"
|
|
239
|
-
disabled={busy || !token.trim()}
|
|
240
|
-
>
|
|
241
|
-
{accounts.length ? "Save connection" : "Verify token"}
|
|
242
|
-
</Button>
|
|
243
|
-
</form>
|
|
244
|
-
)}
|
|
245
|
-
{id === "github" && installations.length > 0 && (
|
|
246
|
-
<div className="flex flex-wrap gap-2">
|
|
247
|
-
{installations.map((installation) => (
|
|
387
|
+
<div>
|
|
248
388
|
<Button
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
disabled={busy || !
|
|
252
|
-
onClick={() =>
|
|
253
|
-
void run(async () => {
|
|
254
|
-
if (!proof) return;
|
|
255
|
-
await selectGithub({
|
|
256
|
-
proof,
|
|
257
|
-
installationId: installation.installationId,
|
|
258
|
-
});
|
|
259
|
-
setInstallations([]);
|
|
260
|
-
setProof(undefined);
|
|
261
|
-
})
|
|
262
|
-
}
|
|
389
|
+
type="submit"
|
|
390
|
+
className="min-h-11"
|
|
391
|
+
disabled={busy || !token.trim()}
|
|
263
392
|
>
|
|
264
|
-
{
|
|
393
|
+
{accounts.length ? "Save account" : "Verify token"}
|
|
265
394
|
</Button>
|
|
266
|
-
|
|
267
|
-
</
|
|
268
|
-
)}
|
|
269
|
-
{id === "github" && installNeeded && (
|
|
270
|
-
<p className="text-sm">
|
|
271
|
-
Install Disposabl, then connect again.{" "}
|
|
272
|
-
{status.githubInstallUrl && (
|
|
273
|
-
<a className="underline" href={status.githubInstallUrl}>
|
|
274
|
-
Install on GitHub
|
|
275
|
-
</a>
|
|
276
|
-
)}
|
|
277
|
-
</p>
|
|
395
|
+
</div>
|
|
396
|
+
</form>
|
|
278
397
|
)}
|
|
279
398
|
</section>
|
|
280
399
|
);
|
|
@@ -282,73 +401,45 @@ function Connections() {
|
|
|
282
401
|
</div>
|
|
283
402
|
)}
|
|
284
403
|
{busy && (
|
|
285
|
-
<p role="status" className="text-sm">
|
|
404
|
+
<p role="status" className="mt-4 text-sm text-muted-foreground">
|
|
286
405
|
Connecting…
|
|
287
406
|
</p>
|
|
288
407
|
)}
|
|
289
|
-
|
|
290
|
-
<p
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<div className="space-y-3 text-xs text-muted-foreground">
|
|
295
|
-
<p>
|
|
296
|
-
Free to start, with plans for personal projects and early startups.
|
|
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."}
|
|
297
413
|
</p>
|
|
298
|
-
|
|
299
|
-
<
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
<
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
passwords. Disconnect here to remove saved access; revoke provider
|
|
311
|
-
access and CI tokens in their settings.
|
|
312
|
-
</p>
|
|
313
|
-
<p>
|
|
314
|
-
Free plan limits:{" "}
|
|
315
|
-
<a
|
|
316
|
-
className="underline"
|
|
317
|
-
href="https://github.com/pricing"
|
|
318
|
-
target="_blank"
|
|
319
|
-
rel="noreferrer"
|
|
320
|
-
>
|
|
321
|
-
GitHub
|
|
322
|
-
</a>
|
|
323
|
-
,{" "}
|
|
324
|
-
<a
|
|
325
|
-
className="underline"
|
|
326
|
-
href="https://www.convex.dev/pricing"
|
|
327
|
-
target="_blank"
|
|
328
|
-
rel="noreferrer"
|
|
329
|
-
>
|
|
330
|
-
Convex
|
|
331
|
-
</a>
|
|
332
|
-
,{" "}
|
|
333
|
-
<a
|
|
334
|
-
className="underline"
|
|
335
|
-
href="https://expo.dev/pricing"
|
|
336
|
-
target="_blank"
|
|
337
|
-
rel="noreferrer"
|
|
338
|
-
>
|
|
339
|
-
Expo
|
|
340
|
-
</a>
|
|
341
|
-
.
|
|
342
|
-
</p>
|
|
343
|
-
</div>
|
|
344
|
-
</details>
|
|
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
|
+
)}
|
|
345
426
|
</div>
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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>
|
|
352
443
|
</main>
|
|
353
444
|
);
|
|
354
445
|
}
|