create-disposabl-app 0.8.10 → 0.8.12
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 +13 -1
- 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/bun.lock +1 -7
- package/dist/templates/default/packages/backend/README.md +4 -8
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +0 -67
- package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +0 -9
- package/dist/templates/default/packages/backend/convex/convex.config.ts +0 -11
- package/dist/templates/default/packages/backend/convex/http.ts +1 -9
- package/dist/templates/default/packages/backend/convex/schema.ts +1 -70
- package/dist/templates/default/packages/backend/generated/openapi.json +1 -1262
- package/dist/templates/default/packages/backend/generated/pages.json +0 -4
- package/dist/templates/default/packages/backend/generated/platforms.ts +2 -20
- package/dist/templates/default/packages/backend/package.json +1 -7
- package/dist/templates/default/packages/skill/SKILL.md +5 -5
- package/dist/templates/default/packages/skill/references/delivery.md +1 -1
- package/package.json +2 -2
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.connections.tsx +0 -445
- package/dist/templates/default/packages/backend/convex/apps/actions/cleanup.ts +0 -317
- package/dist/templates/default/packages/backend/convex/apps/actions/create.ts +0 -30
- package/dist/templates/default/packages/backend/convex/apps/actions/delete.ts +0 -15
- package/dist/templates/default/packages/backend/convex/apps/actions/expo.ts +0 -180
- package/dist/templates/default/packages/backend/convex/apps/actions/setup.ts +0 -48
- package/dist/templates/default/packages/backend/convex/apps/internal.ts +0 -211
- package/dist/templates/default/packages/backend/convex/apps/operations/internal.ts +0 -239
- package/dist/templates/default/packages/backend/convex/apps/validator.ts +0 -23
- package/dist/templates/default/packages/backend/convex/connections/actions/credentials.ts +0 -56
- package/dist/templates/default/packages/backend/convex/connections/actions/expo.ts +0 -79
- package/dist/templates/default/packages/backend/convex/connections/actions/github.ts +0 -119
- package/dist/templates/default/packages/backend/convex/connections/actions/oauth.ts +0 -128
- package/dist/templates/default/packages/backend/convex/connections/index.ts +0 -80
- package/dist/templates/default/packages/backend/convex/connections/internal.ts +0 -147
- package/dist/templates/default/packages/backend/convex/connections/validator.ts +0 -35
- package/dist/templates/default/packages/backend/convex/downloads/action.ts +0 -136
- package/dist/templates/default/packages/backend/convex/downloads/http.ts +0 -32
- package/dist/templates/default/packages/backend/convex/downloads/internal.ts +0 -58
- package/dist/templates/default/packages/backend/convex/github/actions/http.ts +0 -69
- package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +0 -196
- package/dist/templates/default/packages/backend/convex/github/actions/oidc.ts +0 -75
- package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +0 -76
- package/dist/templates/default/packages/backend/convex/github/actions/secrets.ts +0 -180
- package/dist/templates/default/packages/backend/convex/github/actions/signing.ts +0 -41
- package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +0 -145
- package/dist/templates/default/packages/backend/convex/github/identityCache.ts +0 -54
- package/dist/templates/default/packages/backend/convex/github/internal.ts +0 -33
- package/dist/templates/default/packages/backend/convex/previews/internal.ts +0 -257
- package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +0 -83
- package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +0 -182
- package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +0 -32
- package/dist/templates/default/packages/backend/convex/releases/internal.ts +0 -28
- package/dist/templates/default/packages/backend/convex/validator.ts +0 -87
- package/dist/templates/default/packages/sdk/src/generated/client/client.gen.ts +0 -300
- package/dist/templates/default/packages/sdk/src/generated/client/index.ts +0 -27
- package/dist/templates/default/packages/sdk/src/generated/client/types.gen.ts +0 -238
- package/dist/templates/default/packages/sdk/src/generated/client/utils.gen.ts +0 -337
- package/dist/templates/default/packages/sdk/src/generated/client.gen.ts +0 -28
- package/dist/templates/default/packages/sdk/src/generated/core/auth.gen.ts +0 -49
- package/dist/templates/default/packages/sdk/src/generated/core/bodySerializer.gen.ts +0 -96
- package/dist/templates/default/packages/sdk/src/generated/core/params.gen.ts +0 -188
- package/dist/templates/default/packages/sdk/src/generated/core/pathSerializer.gen.ts +0 -186
- package/dist/templates/default/packages/sdk/src/generated/core/queryKeySerializer.gen.ts +0 -134
- package/dist/templates/default/packages/sdk/src/generated/core/serverSentEvents.gen.ts +0 -265
- package/dist/templates/default/packages/sdk/src/generated/core/types.gen.ts +0 -126
- package/dist/templates/default/packages/sdk/src/generated/core/utils.gen.ts +0 -146
- package/dist/templates/default/packages/sdk/src/generated/index.ts +0 -63
- package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +0 -234
- package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +0 -660
|
@@ -1,21 +1,3 @@
|
|
|
1
1
|
// Generated by bun run generate. Do not edit.
|
|
2
|
-
import * as m0 from "../convex/
|
|
3
|
-
|
|
4
|
-
import * as m2 from "../convex/connections/internal";
|
|
5
|
-
import * as m3 from "../convex/downloads/internal";
|
|
6
|
-
import * as m4 from "../convex/github/internal";
|
|
7
|
-
import * as m5 from "../convex/previews/internal";
|
|
8
|
-
import * as m6 from "../convex/previews/token/internal";
|
|
9
|
-
import * as m7 from "../convex/releases/internal";
|
|
10
|
-
import * as m8 from "../convex/users/internal";
|
|
11
|
-
export default {
|
|
12
|
-
"apps/internal": m0,
|
|
13
|
-
"apps/operations/internal": m1,
|
|
14
|
-
"connections/internal": m2,
|
|
15
|
-
"downloads/internal": m3,
|
|
16
|
-
"github/internal": m4,
|
|
17
|
-
"previews/internal": m5,
|
|
18
|
-
"previews/token/internal": m6,
|
|
19
|
-
"releases/internal": m7,
|
|
20
|
-
"users/internal": m8,
|
|
21
|
-
};
|
|
2
|
+
import * as m0 from "../convex/users/internal";
|
|
3
|
+
export default { "users/internal": m0 };
|
|
@@ -16,20 +16,14 @@
|
|
|
16
16
|
"@convex-dev/auth": "catalog:",
|
|
17
17
|
"@convex-dev/mcp": "catalog:",
|
|
18
18
|
"@convex-dev/static-hosting": "catalog:",
|
|
19
|
-
"@convex-dev/workflow": "^0.4.10",
|
|
20
19
|
"@disposabl/disposabl-kit": "workspace:*",
|
|
21
|
-
"
|
|
22
|
-
"@vercel/connect": "^2.5.2",
|
|
23
|
-
"convex": "catalog:",
|
|
24
|
-
"libsodium-wrappers": "^0.8.4",
|
|
25
|
-
"node-forge": "^1.4.2"
|
|
20
|
+
"convex": "catalog:"
|
|
26
21
|
},
|
|
27
22
|
"devDependencies": {
|
|
28
23
|
"@convex-dev/eslint-plugin": "^5.0.1",
|
|
29
24
|
"@eslint/eslintrc": "^3.3.6",
|
|
30
25
|
"@eslint/js": "^10.0.1",
|
|
31
26
|
"@types/node": "^24.13.3",
|
|
32
|
-
"@types/node-forge": "^1.3.14",
|
|
33
27
|
"@typescript-eslint/eslint-plugin": "^8.66.0",
|
|
34
28
|
"@typescript-eslint/parser": "^8.66.0",
|
|
35
29
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
@@ -21,12 +21,10 @@ Before designing a new app, locate and read the `frontend-design` skill and use
|
|
|
21
21
|
|
|
22
22
|
Create a separate Git branch and worktree for each change. In that worktree run `disposabl previews token create --configure .`, `bun install`, and `bun dev`. Implement the request and verify the actual behavior on the requested platforms. Commit and push the branch and open a pull request when the task authorizes delivery.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
A newly generated app already has an Initial commit. Publish its scaffold to `main` first so GitHub has the trusted publishing workflow. Setup configures `origin` for the provisioned repository. Then work on the requested features in an isolated branch:
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
27
|
cd my-app
|
|
28
|
-
git add .
|
|
29
|
-
git commit -m "chore: initialize app"
|
|
30
28
|
git push -u origin main
|
|
31
29
|
git worktree add ../my-app-feature -b feat/first-version
|
|
32
30
|
cd ../my-app-feature
|
|
@@ -35,9 +33,11 @@ bun install
|
|
|
35
33
|
bun run dev
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
The configured token is scoped to this worktree's development backend. Never copy another worktree's environment files or use a production deploy key for development.
|
|
36
|
+
The configured token is scoped to this worktree's development backend. Never copy another worktree's environment files or use a production deploy key for development. Token provisioning or refresh alone does not deploy or require git operations. Keep credentials in ignored environment files. A branch push alone does not trigger deployment: a same-repository PR to `main` triggers the `pr-N` preview, and a push to `main` triggers production. Local development is separate; preview reports are tracked by head branch.
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
For background delivery, hand a subagent a fixed, reviewed commit snapshot in an isolated worktree. Its brief must name the repository, branch, SHA, scope, PR base, required checks, push ownership, and expected result evidence. It pushes that snapshot and opens or updates the same-repository PR while the main agent continues separately. Never sweep concurrent edits or the index, or push later commits without a new handoff. Do not block implementation on push or PR creation.
|
|
39
|
+
|
|
40
|
+
After opening the PR, run `disposabl previews get` in the worktree and check each requested platform's status and available preview, workflow, release, or download URLs. Report the deployed SHA, checks, and each platform URL and status. Readiness requires successful CI and actual endpoint or device behavior; a provisioned development URL is not a hosted preview. For Android, install the preview APK on the target and verify the requested behavior and authentication. Do not run `eas submit`. After an authorized merge, verify production status and actual URLs. If a platform or URL is missing, inspect the relevant workflow and report the gap.
|
|
41
41
|
|
|
42
42
|
Use `disposabl previews get --json` when an agent needs structured status. Query again as builds progress, respecting the host's PR watcher rules, and stop waiting when every requested platform has a terminal status. Inspect and repair failures instead of repeatedly polling an unchanged failure. After merging, run `disposabl releases get --appId <appId-from-disposabl.json>`; production results are separate from the worktree's preview. Install the production Android APK alongside its preview and verify login and saved data against the production backend. Store submission is not required for Android APK delivery. TestFlight is available only after Apple signing and App Store Connect submission credentials are configured.
|
|
43
43
|
|
|
@@ -15,7 +15,7 @@ Read before a first native build, a toolchain change, or a failed preview/produc
|
|
|
15
15
|
|
|
16
16
|
## Avoid repeating expensive work
|
|
17
17
|
|
|
18
|
-
Diagnose independent platform failures in parallel when available, with separate owners and checkouts. Keep each device and browser session under one owner. Give a delivery delegate an observable success condition, such as an uploaded artifact or a verified login on its assigned device; a commit and local checks alone do not satisfy that condition. Batch related repairs before pushing, because PR concurrency can cancel running native builds. Keep source-commit validation when publishing so an old build cannot become the current release.
|
|
18
|
+
Diagnose independent platform failures in parallel when available, with separate owners and checkouts. Keep each device and browser session under one owner. Give a delivery delegate an observable success condition, such as an uploaded artifact or a verified login on its assigned device; a commit and local checks alone do not satisfy that condition. Batch related repairs before pushing, because PR concurrency can cancel running native builds. Use host PR watchers where applicable; do not busy poll. Hand off a new reviewed SHA before pushing subsequent changes. Keep source-commit validation when publishing so an old build cannot become the current release.
|
|
19
19
|
|
|
20
20
|
Separate an application change from a starter/pipeline defect. Repair a reusable defect in the generator and the generated app. For a new repository, establish its trusted publishing workflow on `main` before the feature preview; later workflow changes must follow the repository's review and merge policy. Do not weaken workflow-source identity checks to bypass a mismatch.
|
|
21
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-disposabl-app",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.12",
|
|
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
|
-
}
|