create-disposabl-app 0.4.2 → 0.5.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/README.md +6 -0
- package/dist/index.js +67 -57
- package/dist/templates/default/apps/docs/README.md +37 -0
- package/dist/templates/default/apps/docs/content/guides/writing.mdx +15 -0
- package/dist/templates/default/apps/docs/content/index.mdx +10 -0
- package/dist/templates/default/apps/docs/package.json +29 -1
- package/dist/templates/default/apps/docs/press.config.ts +20 -0
- package/dist/templates/default/apps/docs/src/app.css +4 -0
- package/dist/templates/default/apps/docs/tsconfig.json +14 -0
- package/dist/templates/default/apps/docs/vite.config.ts +8 -0
- package/dist/templates/default/apps/mobile/.env.example +2 -0
- package/dist/templates/default/apps/mobile/README.md +63 -4
- package/dist/templates/default/apps/mobile/app.json +2 -0
- package/dist/templates/default/apps/mobile/package.json +16 -3
- package/dist/templates/default/apps/mobile/src/app/(auth)/_layout.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(auth)/login.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(auth)/signup.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(authenticated)/_layout.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(authenticated)/account.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/_layout.tsx +1 -5
- package/dist/templates/default/apps/mobile/src/app/index.tsx +1 -17
- package/dist/templates/default/apps/mobile/tsconfig.json +8 -1
- package/dist/templates/default/apps/web/package.json +2 -1
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +2 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +1 -1
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +1 -1
- package/dist/templates/default/apps/web/tests/auth-branches.test.tsx +44 -0
- package/dist/templates/default/apps/web/vite.config.ts +15 -0
- package/dist/templates/default/bun.lock +564 -18
- package/dist/templates/default/disposabl.json +2 -13
- package/dist/templates/default/packages/backend/convex/users.ts +23 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/log-out.tsx +16 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +6 -3
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/route.tsx +25 -16
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +23 -2
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +20 -9
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +1 -1
- package/dist/templates/default/packages/disposabl-kit/features.ts +4 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-form.tsx +125 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-ui.tsx +107 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/expo-plugin.cjs +26 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/index.ts +10 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +101 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-errors.ts +40 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-storage.ts +9 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/convex.ts +1 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +67 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +50 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/login.tsx +5 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/signup.tsx +5 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +24 -1
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +1 -27
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +6 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/docs.test.ts +111 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/docs.ts +62 -0
- package/dist/templates/default/packages/disposabl-kit/tsconfig.json +1 -1
- package/dist/templates/default/turbo.json +7 -0
- package/package.json +1 -1
- package/dist/templates/default/apps/blog/package.json +0 -1
- package/dist/templates/default/apps/changelog/package.json +0 -1
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +0 -5
- package/dist/templates/default/apps/desktop/.oxlintrc.json +0 -6
- package/dist/templates/default/apps/desktop/README.md +0 -88
- package/dist/templates/default/apps/desktop/build-ci.mjs +0 -56
- package/dist/templates/default/apps/desktop/forge.config.mts +0 -109
- package/dist/templates/default/apps/desktop/index.html +0 -12
- package/dist/templates/default/apps/desktop/package.json +0 -55
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +0 -2
- package/dist/templates/default/apps/desktop/src/index.css +0 -8
- package/dist/templates/default/apps/desktop/src/main.ts +0 -58
- package/dist/templates/default/apps/desktop/src/preload.ts +0 -3
- package/dist/templates/default/apps/desktop/src/renderer.ts +0 -19
- package/dist/templates/default/apps/desktop/tsconfig.json +0 -14
- package/dist/templates/default/apps/desktop/vite.main.config.mts +0 -4
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +0 -4
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +0 -4
package/README.md
CHANGED
|
@@ -6,5 +6,11 @@ Create a Disposabl app with Bun:
|
|
|
6
6
|
bun create disposabl-app@latest my-app
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
Web is always included. Frontend authentication is enabled by default; pass
|
|
10
|
+
`--features none` to disable it, or include `authentication` in a comma-separated
|
|
11
|
+
feature list. Auth-disabled projects omit login/signup routes and auth-dependent
|
|
12
|
+
example screens, so missing routes return 404. Backend authentication code and
|
|
13
|
+
its access checks remain installed.
|
|
14
|
+
|
|
9
15
|
Releases publish automatically after changes reach `main`. Commit messages
|
|
10
16
|
determine the next version; no manual version edit is needed.
|
package/dist/index.js
CHANGED
|
@@ -8,45 +8,22 @@ import { fileURLToPath } 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.5.0";
|
|
12
12
|
|
|
13
13
|
// ../disposabl-kit/platforms.ts
|
|
14
14
|
var platforms = [
|
|
15
15
|
{ id: "web", label: "Web", group: "Required", status: "required" },
|
|
16
16
|
{ id: "android", label: "Android", group: "Mobile", status: "available" },
|
|
17
17
|
{ id: "ios", label: "iOS", group: "Mobile", status: "available" },
|
|
18
|
-
{ id: "windows", label: "Windows", group: "Desktop", status: "available" },
|
|
19
|
-
{ id: "linux", label: "Linux", group: "Desktop", status: "available" },
|
|
20
|
-
{ id: "macos", label: "macOS", group: "Desktop", status: "available" },
|
|
21
18
|
{
|
|
22
19
|
id: "mcp",
|
|
23
20
|
label: "MCP",
|
|
24
|
-
group: "
|
|
21
|
+
group: "Developer tools",
|
|
25
22
|
status: "available",
|
|
26
23
|
description: "Tools for AI assistants"
|
|
27
24
|
},
|
|
28
|
-
{
|
|
29
|
-
id: "openai-plugin",
|
|
30
|
-
label: "OpenAI Plugin",
|
|
31
|
-
description: "Tools and skills for OpenAI",
|
|
32
|
-
group: "MCP & plugins",
|
|
33
|
-
status: "available"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: "claude-code-plugin",
|
|
37
|
-
label: "Claude Code Plugin",
|
|
38
|
-
description: "Tools and skills for Claude Code",
|
|
39
|
-
group: "MCP & plugins",
|
|
40
|
-
status: "available"
|
|
41
|
-
},
|
|
42
25
|
{ id: "api", label: "API", group: "Developer tools", status: "available" },
|
|
43
26
|
{ id: "cli", label: "CLI", group: "Developer tools", status: "available" },
|
|
44
|
-
{
|
|
45
|
-
id: "python-sdk",
|
|
46
|
-
label: "Python SDK",
|
|
47
|
-
group: "Coming soon",
|
|
48
|
-
status: "disabled"
|
|
49
|
-
},
|
|
50
27
|
{
|
|
51
28
|
id: "typescript-sdk",
|
|
52
29
|
label: "TypeScript SDK",
|
|
@@ -57,10 +34,7 @@ var platforms = [
|
|
|
57
34
|
var platformIds = platforms.map(({ id }) => id);
|
|
58
35
|
var requiredPlatform = "web";
|
|
59
36
|
var platformDependencies = {
|
|
60
|
-
"openai-plugin": ["mcp"],
|
|
61
|
-
"claude-code-plugin": ["mcp"],
|
|
62
37
|
cli: ["api"],
|
|
63
|
-
"python-sdk": ["api"],
|
|
64
38
|
"typescript-sdk": ["api"]
|
|
65
39
|
};
|
|
66
40
|
function isPlatform(value) {
|
|
@@ -83,15 +57,13 @@ function resolvePlatforms(values) {
|
|
|
83
57
|
// options.ts
|
|
84
58
|
var features = [
|
|
85
59
|
{ id: "docs", label: "Docs", hint: "apps/docs" },
|
|
86
|
-
{ id: "blog", label: "Blog", hint: "apps/blog" },
|
|
87
|
-
{ id: "changelog", label: "Changelog", hint: "apps/changelog" },
|
|
88
60
|
{
|
|
89
61
|
id: "authentication",
|
|
90
62
|
label: "Authentication",
|
|
91
|
-
hint: "
|
|
63
|
+
hint: "Frontend sign-in and sign-up"
|
|
92
64
|
}
|
|
93
65
|
];
|
|
94
|
-
var requiredFeatures = [
|
|
66
|
+
var requiredFeatures = [];
|
|
95
67
|
var parseList = (input) => input.split(",").map((value) => value.trim());
|
|
96
68
|
function selectPlatforms(input = "web") {
|
|
97
69
|
const requested = parseList(input);
|
|
@@ -99,19 +71,17 @@ function selectPlatforms(input = "web") {
|
|
|
99
71
|
const option = platforms.find((platform) => platform.id === id);
|
|
100
72
|
if (!option)
|
|
101
73
|
throw new Error("Unknown platform " + JSON.stringify(id) + ". Use --list-options to see valid IDs.");
|
|
102
|
-
if (option.status === "disabled")
|
|
103
|
-
throw new Error(option.label + " is not available yet and cannot be selected.");
|
|
104
74
|
}
|
|
105
75
|
return resolvePlatforms(requested);
|
|
106
76
|
}
|
|
107
|
-
function selectFeatures(input = "
|
|
77
|
+
function selectFeatures(input = "authentication") {
|
|
108
78
|
const requested = input === "none" ? [] : parseList(input);
|
|
109
79
|
for (const id of requested) {
|
|
110
80
|
if (!features.some((feature) => feature.id === id)) {
|
|
111
81
|
throw new Error("Unknown feature " + JSON.stringify(id) + ". Use --features none or --list-options to see valid IDs.");
|
|
112
82
|
}
|
|
113
83
|
}
|
|
114
|
-
return features.filter((option) =>
|
|
84
|
+
return features.filter((option) => requested.includes(option.id)).map((option) => option.id);
|
|
115
85
|
}
|
|
116
86
|
function selectedFolders(config) {
|
|
117
87
|
const result = ["apps/web"];
|
|
@@ -121,8 +91,6 @@ function selectedFolders(config) {
|
|
|
121
91
|
result.push("packages/sdk");
|
|
122
92
|
if (config.platforms.some((platform) => platform === "android" || platform === "ios"))
|
|
123
93
|
result.push("apps/mobile");
|
|
124
|
-
if (config.platforms.some((platform) => ["windows", "linux", "macos"].includes(platform)))
|
|
125
|
-
result.push("apps/desktop");
|
|
126
94
|
for (const feature of config.features) {
|
|
127
95
|
if (feature !== "authentication")
|
|
128
96
|
result.push("apps/" + feature);
|
|
@@ -164,7 +132,7 @@ ${bar} ${color.dim(labels.join(", ") || "Web only")}`;
|
|
|
164
132
|
${bar} ${color.dim("Cancelled")}`;
|
|
165
133
|
const style = (option, active) => {
|
|
166
134
|
const checked = selected.includes(option.value);
|
|
167
|
-
const hint = option.value === "web" ? "Required" : option.disabled ? "Unavailable" : option.description
|
|
135
|
+
const hint = option.value === "web" ? "Required" : option.disabled ? "Unavailable" : option.description;
|
|
168
136
|
const checkbox = checked ? p.S_CHECKBOX_SELECTED : active ? p.S_CHECKBOX_ACTIVE : p.S_CHECKBOX_INACTIVE;
|
|
169
137
|
const label = `${checkbox} ${option.label}`;
|
|
170
138
|
return (option.value === "web" ? color.green(label) : option.disabled ? color.dim(label) : active ? color.cyan(label) : label) + (hint ? color.dim(` (${hint})`) : "");
|
|
@@ -355,6 +323,55 @@ async function createApp(template, destination, name, config, overwrite = false)
|
|
|
355
323
|
force: true
|
|
356
324
|
});
|
|
357
325
|
}
|
|
326
|
+
if (!config.features.includes("authentication")) {
|
|
327
|
+
for (const path of [
|
|
328
|
+
"packages/disposabl-kit/client/routes/_auth-pages",
|
|
329
|
+
"packages/disposabl-kit/client/routes/consent.tsx",
|
|
330
|
+
"apps/web/src/router/_authenticated/todos",
|
|
331
|
+
"apps/web/src/router/_authenticated/dashboard.api-keys.tsx",
|
|
332
|
+
"apps/web/tests/auth-branches.test.tsx",
|
|
333
|
+
"apps/mobile/src/app/(auth)",
|
|
334
|
+
"apps/mobile/src/app/(authenticated)/account.tsx"
|
|
335
|
+
]) {
|
|
336
|
+
await rm(join(destination, path), { recursive: true, force: true });
|
|
337
|
+
}
|
|
338
|
+
await writeFile(join(destination, "apps/web/src/router/_authenticated/dashboard.tsx"), `import { createFileRoute } from "@tanstack/react-router";
|
|
339
|
+
|
|
340
|
+
export const Route = createFileRoute("/_providers/_authenticated/dashboard")({
|
|
341
|
+
component: () => <h1>Dashboard</h1>,
|
|
342
|
+
});
|
|
343
|
+
`);
|
|
344
|
+
if (folders.includes("apps/mobile")) {
|
|
345
|
+
await writeFile(join(destination, "apps/mobile/src/app/index.tsx"), `export { PublicHomeScreen as default } from "@disposabl/disposabl-kit/mobile";
|
|
346
|
+
`);
|
|
347
|
+
await writeFile(join(destination, "apps/mobile/src/app/(authenticated)/_layout.tsx"), `export { PublicLayout as default } from "@disposabl/disposabl-kit/mobile";
|
|
348
|
+
`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (!config.features.includes("docs")) {
|
|
352
|
+
const webPackage = join(destination, "apps/web/package.json");
|
|
353
|
+
const web = JSON.parse(await readFile(webPackage, "utf8"));
|
|
354
|
+
delete web.devDependencies["@disposabl/docs"];
|
|
355
|
+
await writeFile(webPackage, JSON.stringify(web, null, 2) + `
|
|
356
|
+
`);
|
|
357
|
+
for (const file of [
|
|
358
|
+
"apps/web/vite.config.ts",
|
|
359
|
+
"packages/disposabl-kit/client/lib/prerender.ts",
|
|
360
|
+
"packages/disposabl-kit/server/http.ts"
|
|
361
|
+
]) {
|
|
362
|
+
const path = join(destination, file);
|
|
363
|
+
const source = await readFile(path, "utf8");
|
|
364
|
+
await writeFile(path, source.replace(/^[ \t]*\/\/ docs:start\r?\n[\s\S]*?^[ \t]*\/\/ docs:end\r?\n/gm, ""));
|
|
365
|
+
}
|
|
366
|
+
const turboPath = join(destination, "turbo.json");
|
|
367
|
+
const turbo = JSON.parse(await readFile(turboPath, "utf8"));
|
|
368
|
+
delete turbo.tasks["@disposabl/docs#build"];
|
|
369
|
+
delete turbo.tasks["@disposabl/web#build"];
|
|
370
|
+
await writeFile(turboPath, JSON.stringify(turbo, null, 2) + `
|
|
371
|
+
`);
|
|
372
|
+
for (const file of ["docs.ts", "docs.test.ts"])
|
|
373
|
+
await rm(join(destination, "packages/disposabl-kit/server/lib", file));
|
|
374
|
+
}
|
|
358
375
|
for (const kind of ["cli", "sdk"]) {
|
|
359
376
|
const folder = join(destination, "packages", kind);
|
|
360
377
|
if (!folders.includes(`packages/${kind}`)) {
|
|
@@ -402,17 +419,14 @@ async function createApp(template, destination, name, config, overwrite = false)
|
|
|
402
419
|
|
|
403
420
|
// index.ts
|
|
404
421
|
var jsonOutput = process.argv.slice(2).includes("--json");
|
|
405
|
-
var program = new Command("create-disposabl-app").description("Create a Disposabl starter. Web
|
|
422
|
+
var program = new Command("create-disposabl-app").description("Create a Disposabl starter. Web is always included.").version(version, "-v, --version").argument("[appname]", "App name and new directory").option("--platforms <ids>", "Comma-separated platform IDs; Web is always included").option("--features <ids>", "Comma-separated feature IDs, or none (default: authentication)").option("-y, --yes", "Skip prompts; include Web and authentication by default").option("--skip-install", "Create files without running bun install").option("--list-options", "List every platform and feature, including disabled choices").option("--json", "Skip prompts and emit a JSON result or error; install logs go to stderr").helpOption("-h, --help").addHelpText("after", `
|
|
406
423
|
Platforms:
|
|
407
|
-
web (required), android, ios,
|
|
408
|
-
cli, typescript-sdk, openai-plugin, claude-code-plugin
|
|
424
|
+
web (required), android, ios, api, mcp, cli, typescript-sdk
|
|
409
425
|
CLI and TypeScript SDK automatically include API.
|
|
410
|
-
Either plugin automatically includes MCP.
|
|
411
|
-
Disabled: python-sdk
|
|
412
426
|
|
|
413
427
|
Optional features:
|
|
414
|
-
|
|
415
|
-
Authentication is
|
|
428
|
+
authentication, docs
|
|
429
|
+
Authentication is enabled by default. Use --features none to disable frontend authentication.
|
|
416
430
|
|
|
417
431
|
Examples:
|
|
418
432
|
bun create disposabl-app@latest
|
|
@@ -423,7 +437,7 @@ Examples:
|
|
|
423
437
|
|
|
424
438
|
Without a TTY, the CLI never prompts. Supply an app name.
|
|
425
439
|
Platform and feature choices are saved in disposabl.json.
|
|
426
|
-
|
|
440
|
+
Backend authentication code is always included. No appId or Convex deployment is created.
|
|
427
441
|
`).configureOutput({ writeErr: () => {} }).exitOverride();
|
|
428
442
|
|
|
429
443
|
class Cancelled extends Error {
|
|
@@ -448,14 +462,9 @@ function showOptions(json) {
|
|
|
448
462
|
"typescript-sdk": "packages/sdk",
|
|
449
463
|
android: "apps/mobile",
|
|
450
464
|
ios: "apps/mobile",
|
|
451
|
-
|
|
452
|
-
linux: "apps/desktop",
|
|
453
|
-
macos: "apps/desktop",
|
|
454
|
-
docs: "apps/docs",
|
|
455
|
-
blog: "apps/blog",
|
|
456
|
-
changelog: "apps/changelog"
|
|
465
|
+
docs: "apps/docs"
|
|
457
466
|
},
|
|
458
|
-
configOnly: ["api", "mcp"
|
|
467
|
+
configOnly: ["api", "mcp"]
|
|
459
468
|
}, null, 2));
|
|
460
469
|
return;
|
|
461
470
|
}
|
|
@@ -471,7 +480,7 @@ Features
|
|
|
471
480
|
for (const option of features)
|
|
472
481
|
console.log(" " + option.id.padEnd(21) + option.hint);
|
|
473
482
|
console.log(`
|
|
474
|
-
Web
|
|
483
|
+
Web is always included. Authentication is enabled by default. Use --platforms and --features with the IDs above.`);
|
|
475
484
|
}
|
|
476
485
|
async function install(directory, interactive) {
|
|
477
486
|
await new Promise((done, reject) => {
|
|
@@ -541,8 +550,9 @@ async function main() {
|
|
|
541
550
|
}
|
|
542
551
|
if (interactive && options.features === undefined) {
|
|
543
552
|
const selected = answer(await p2.multiselect({
|
|
544
|
-
message: "Choose optional features
|
|
545
|
-
|
|
553
|
+
message: "Choose optional features",
|
|
554
|
+
initialValues: ["authentication"],
|
|
555
|
+
options: features.map((feature) => ({
|
|
546
556
|
value: feature.id,
|
|
547
557
|
label: feature.label,
|
|
548
558
|
hint: feature.hint
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Documentation
|
|
2
|
+
|
|
3
|
+
Choose `--features docs` when creating an app. The generator includes Fumapress,
|
|
4
|
+
the web build dependency and copy step, and the `/docs` HTTP routes. Without
|
|
5
|
+
docs, it removes this workspace and all of those hooks.
|
|
6
|
+
|
|
7
|
+
Add Markdown or MDX files in `apps/docs/content` and commit them with your PR.
|
|
8
|
+
`content/index.mdx` is the docs home. `content/guides/writing.mdx` becomes
|
|
9
|
+
`/docs/guides/writing`. Fumapress builds the sidebar and static search index from
|
|
10
|
+
these files. Use `/guides/writing` for internal docs links; Fumapress adds `/docs`.
|
|
11
|
+
Use an ordinary `<a href="/docs/">` link from the web app to enter docs.
|
|
12
|
+
|
|
13
|
+
Run `bun run build`, or `bun run build --filter=@disposabl/web` for the website
|
|
14
|
+
and its dependencies. Turbo builds docs first, then web copies the rendered site
|
|
15
|
+
into its output. Both build tasks run without caching so deleted pages cannot
|
|
16
|
+
survive a cache restore:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
apps/web/dist/client/
|
|
20
|
+
index.html
|
|
21
|
+
assets/
|
|
22
|
+
docs/
|
|
23
|
+
index.html
|
|
24
|
+
guides/writing/index.html
|
|
25
|
+
assets/
|
|
26
|
+
RSC/
|
|
27
|
+
api/search
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The PR and production pipeline template uses that same web build command and
|
|
31
|
+
uploads `apps/web/dist/client` once to Convex static hosting. Docs changes ship
|
|
32
|
+
with the web app. There is no docs dev server or runtime build process.
|
|
33
|
+
|
|
34
|
+
Run `bun run --cwd apps/docs build` to build only the documentation. Local web
|
|
35
|
+
development does not serve docs; rendered docs are included in the combined
|
|
36
|
+
build and deployment. Adding docs to an app generated without them requires
|
|
37
|
+
restoring the workspace and build hooks, not just changing `disposabl.json`.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Writing docs
|
|
3
|
+
description: Add pages with Markdown and MDX.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Add a page
|
|
7
|
+
|
|
8
|
+
Create a Markdown or MDX file in `apps/docs/content` with a `title` in its frontmatter.
|
|
9
|
+
For example, `content/guides/setup.mdx` becomes `/docs/guides/setup`.
|
|
10
|
+
|
|
11
|
+
## Navigation
|
|
12
|
+
|
|
13
|
+
Fumapress builds the sidebar from the content directory. Add a `meta.json` file to control the page order.
|
|
14
|
+
|
|
15
|
+
[Back to documentation](/)
|
|
@@ -1 +1,29 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@disposabl/docs",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "fumapress build",
|
|
7
|
+
"typecheck": "tsc --noEmit"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@base-ui/react": "^1.9.0",
|
|
11
|
+
"fumadocs-core": "^16.16.2",
|
|
12
|
+
"fumadocs-mdx": "^15.4.6",
|
|
13
|
+
"fumadocs-ui": "npm:@fumadocs/base-ui@^16.16.2",
|
|
14
|
+
"fumapress": "1.6.2",
|
|
15
|
+
"react": "catalog:",
|
|
16
|
+
"react-dom": "catalog:",
|
|
17
|
+
"waku": "1.0.0-rc.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@tailwindcss/vite": "^4",
|
|
21
|
+
"@types/mdx": "^2",
|
|
22
|
+
"@types/node": "^22",
|
|
23
|
+
"@types/react": "^19",
|
|
24
|
+
"@types/react-dom": "^19",
|
|
25
|
+
"tailwindcss": "^4",
|
|
26
|
+
"typescript": "^6.0.2",
|
|
27
|
+
"vite": "^8"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { flexsearchPlugin } from "fumapress/plugins/flexsearch";
|
|
2
|
+
import { defineConfig } from "fumapress";
|
|
3
|
+
import { fumadocsMdx } from "fumapress/adapters/mdx";
|
|
4
|
+
import { metaSchema, pageSchema } from "fumapress/adapters/mdx/schema";
|
|
5
|
+
import { defineDocs } from "fumadocs-mdx/macro";
|
|
6
|
+
|
|
7
|
+
const docs = defineDocs({
|
|
8
|
+
dir: "content",
|
|
9
|
+
docs: { async: true, schema: pageSchema },
|
|
10
|
+
meta: { schema: metaSchema },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
mode: "static",
|
|
15
|
+
preset: false,
|
|
16
|
+
content: docs.toFumadocsSource(),
|
|
17
|
+
site: { name: "Documentation" },
|
|
18
|
+
})
|
|
19
|
+
.adapters(fumadocsMdx())
|
|
20
|
+
.plugins(flexsearchPlugin());
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"types": ["vite/client"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["*.ts", "src"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
3
|
+
import press from "fumapress/vite";
|
|
4
|
+
import { fumadocsMdx } from "fumadocs-mdx/vite";
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [press({ basePath: "/docs/" }), fumadocsMdx(), tailwindcss()],
|
|
8
|
+
});
|
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Mobile previews and updates
|
|
2
2
|
|
|
3
|
+
## Local development and authentication
|
|
4
|
+
|
|
5
|
+
Mobile uses the same Convex Auth v2 username/password accounts as the website.
|
|
6
|
+
`@disposabl/disposabl-kit/mobile` owns the provider, signup/login forms, session
|
|
7
|
+
storage, route guards, and account screen. Files in `src/app/` only re-export
|
|
8
|
+
these reusable screens and layouts. Add custom app screens alongside them.
|
|
9
|
+
|
|
10
|
+
Routes outside `(authenticated)` are public. Put screens that require login
|
|
11
|
+
under `src/app/(authenticated)/`; its shared layout guards every descendant,
|
|
12
|
+
including direct links. The `(auth)` group contains login and signup. Successful
|
|
13
|
+
login opens the account screen, where `users.current` returns the caller's
|
|
14
|
+
username and user ID from Convex. Logout clears the session and returns home.
|
|
15
|
+
Expo SecureStore persists tokens per deployment across app restarts.
|
|
16
|
+
|
|
17
|
+
Include `"authentication"` in root `disposabl.json` features to enable frontend
|
|
18
|
+
auth. The generator omits login, signup, consent, and auth-dependent sample
|
|
19
|
+
screens when this feature is not selected. Missing routes return not found;
|
|
20
|
+
they do not redirect home. Mobile gets a public home and route-group layout.
|
|
21
|
+
The root provider selects Convex with or without auth; individual screens do
|
|
22
|
+
not check the feature flag. Backend authentication and its access checks remain
|
|
23
|
+
installed and enforced. Removing auth from an existing app also means deleting
|
|
24
|
+
its auth routes and replacing any auth-dependent UI, as the generator does for
|
|
25
|
+
new apps. Rebuild preview/release apps after changing routes or features.
|
|
26
|
+
|
|
27
|
+
Expo autolinking deduplicates React, Convex, and Convex Auth between the app and
|
|
28
|
+
kit so native screens use the app's React version and a single auth context.
|
|
29
|
+
The kit's Expo config plugin adds workspace sources, the feature list, and public
|
|
30
|
+
backend URL inputs to Android release bundling, so Gradle rebuilds the embedded
|
|
31
|
+
JavaScript after shared kit or configuration changes.
|
|
32
|
+
|
|
33
|
+
For a new worktree, install dependencies with `bun install`, then select an
|
|
34
|
+
isolated Convex dev deployment. Substitute your own team, project, and branch:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
cd packages/backend
|
|
38
|
+
bunx convex deployment create YOUR_TEAM:YOUR_PROJECT:dev/YOUR_BRANCH --type dev --select
|
|
39
|
+
bun run predev
|
|
40
|
+
bunx convex dev --once
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Copy the generated `CONVEX_URL` and `CONVEX_SITE_URL` from
|
|
44
|
+
`packages/backend/.env.local` into `apps/mobile/.env.local` as
|
|
45
|
+
`EXPO_PUBLIC_CONVEX_URL` and `EXPO_PUBLIC_CONVEX_SITE_URL`. Use the same pair in
|
|
46
|
+
`apps/web/.env.local` as `VITE_CONVEX_URL` and `VITE_CONVEX_SITE_URL`.
|
|
47
|
+
These files are ignored by Git. Run `bun run dev` from the repository root to
|
|
48
|
+
start the backend, website, and Metro. Restart Metro after changing these URLs.
|
|
49
|
+
The cloud URL connects the mobile client; the site URL is available for HTTP
|
|
50
|
+
endpoints and is not needed for the native password flow.
|
|
51
|
+
|
|
52
|
+
Use a development build containing `expo-secure-store`, or an SDK 58-compatible
|
|
53
|
+
Expo Go installation. No browser redirect or custom token exchange is needed
|
|
54
|
+
for username/password login. OAuth would require a separate browser flow.
|
|
55
|
+
|
|
56
|
+
Checked npm and the Convex Auth `reboot` branch on 2026-11-02. The latest v2 beta
|
|
57
|
+
is still `2.0.0-beta.0`. Its React provider already supports async SecureStore
|
|
58
|
+
storage. The relevant upstream provider and session code at
|
|
59
|
+
`db15c82e6f568d7717563783447010f9a5534359` adds no native password requirement,
|
|
60
|
+
so this integration uses the published package without another auth patch.
|
|
61
|
+
|
|
3
62
|
Mobile previews are release builds with embedded JavaScript, not development
|
|
4
63
|
clients. Android uses `assembleRelease`; iOS internal profiles explicitly disable
|
|
5
64
|
`developmentClient`. They run without Metro or Expo Go and use EAS Update for
|
|
@@ -95,10 +154,10 @@ The job has `contents: write`; fork PRs never deploy or publish. There is no
|
|
|
95
154
|
intermediate Actions artifact. This workflow does not submit to Google Play or
|
|
96
155
|
the App Store.
|
|
97
156
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
`process.env.EXPO_PUBLIC_CONVEX_SITE_URL
|
|
101
|
-
the
|
|
157
|
+
Backend URLs are available to mobile code through
|
|
158
|
+
`process.env.EXPO_PUBLIC_CONVEX_URL` and
|
|
159
|
+
`process.env.EXPO_PUBLIC_CONVEX_SITE_URL`. The distribution workflow supplies
|
|
160
|
+
them to the same native authentication flow used during development.
|
|
102
161
|
|
|
103
162
|
## iOS
|
|
104
163
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"main": "expo-router/entry",
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@convex-dev/auth": "catalog:",
|
|
6
7
|
"@expo/ui": "~58.0.23",
|
|
8
|
+
"convex": "catalog:",
|
|
7
9
|
"expo": "~58.0.19",
|
|
8
10
|
"expo-constants": "~58.0.13",
|
|
9
11
|
"expo-device": "~58.0.5",
|
|
@@ -12,6 +14,7 @@
|
|
|
12
14
|
"expo-image": "~58.0.17",
|
|
13
15
|
"expo-linking": "~58.0.14",
|
|
14
16
|
"expo-router": "~58.0.26",
|
|
17
|
+
"expo-secure-store": "~58.0.2",
|
|
15
18
|
"expo-splash-screen": "~58.0.11",
|
|
16
19
|
"expo-status-bar": "~58.0.4",
|
|
17
20
|
"expo-symbols": "~58.0.4",
|
|
@@ -24,7 +27,8 @@
|
|
|
24
27
|
"react-native-reanimated": "4.7.1",
|
|
25
28
|
"react-native-safe-area-context": "~5.10.1",
|
|
26
29
|
"react-native-screens": "~4.30.0",
|
|
27
|
-
"react-native-worklets": "0.13.0"
|
|
30
|
+
"react-native-worklets": "0.13.0",
|
|
31
|
+
"@disposabl/disposabl-kit": "workspace:*"
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"@types/react": "~19.3.0",
|
|
@@ -36,10 +40,19 @@
|
|
|
36
40
|
"start": "expo start",
|
|
37
41
|
"android": "expo run:android",
|
|
38
42
|
"ios": "expo run:ios",
|
|
39
|
-
"lint": "
|
|
43
|
+
"lint": "cd ../.. && apps/mobile/node_modules/.bin/eslint --config apps/mobile/eslint.config.js apps/mobile/src packages/disposabl-kit/mobile",
|
|
40
44
|
"dev": "expo start",
|
|
41
45
|
"typecheck": "tsc --noEmit",
|
|
42
46
|
"build:ios": "bunx eas-cli@27.2.0 build --platform ios --profile ios-preview --local"
|
|
43
47
|
},
|
|
44
|
-
"private": true
|
|
48
|
+
"private": true,
|
|
49
|
+
"expo": {
|
|
50
|
+
"autolinking": {
|
|
51
|
+
"include": [
|
|
52
|
+
"react",
|
|
53
|
+
"convex",
|
|
54
|
+
"@convex-dev/auth"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
45
58
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthLayout as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoginScreen as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SignupScreen as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthenticatedLayout as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccountScreen as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default function Index() {
|
|
4
|
-
return (
|
|
5
|
-
<View style={styles.container}>
|
|
6
|
-
<Text>Edit src/app/index.tsx to edit this screen.</Text>
|
|
7
|
-
</View>
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const styles = StyleSheet.create({
|
|
12
|
-
container: {
|
|
13
|
-
flex: 1,
|
|
14
|
-
alignItems: "center",
|
|
15
|
-
justifyContent: "center",
|
|
16
|
-
},
|
|
17
|
-
});
|
|
1
|
+
export { HomeScreen as default } from "@disposabl/disposabl-kit/mobile";
|
|
@@ -7,5 +7,12 @@
|
|
|
7
7
|
"@/assets/*": ["./assets/*"]
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
-
"include": [
|
|
10
|
+
"include": [
|
|
11
|
+
"**/*.ts",
|
|
12
|
+
"**/*.tsx",
|
|
13
|
+
".expo/types/**/*.ts",
|
|
14
|
+
"expo-env.d.ts",
|
|
15
|
+
"../../packages/disposabl-kit/mobile/**/*.ts",
|
|
16
|
+
"../../packages/disposabl-kit/mobile/**/*.tsx"
|
|
17
|
+
]
|
|
11
18
|
}
|
|
@@ -9,7 +9,7 @@ import config from "../../../../../disposabl.json";
|
|
|
9
9
|
export const Route = createFileRoute(
|
|
10
10
|
"/_providers/_authenticated/dashboard/api-keys",
|
|
11
11
|
)({ component: ApiKeys });
|
|
12
|
-
function ApiKeys() {
|
|
12
|
+
export function ApiKeys() {
|
|
13
13
|
const enabled = config.platforms.includes("api");
|
|
14
14
|
const connections = useQuery(api.mcp.listConnections, enabled ? {} : "skip");
|
|
15
15
|
const create = useAction(api.mcp.createApiKey);
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
useLocation,
|
|
6
6
|
} from "@tanstack/react-router";
|
|
7
7
|
import config from "../../../../../disposabl.json";
|
|
8
|
+
import { LogOut } from "@disposabl/disposabl-kit/client/components/ui/log-out";
|
|
8
9
|
|
|
9
10
|
export const Route = createFileRoute("/_providers/_authenticated/dashboard")({
|
|
10
11
|
component: Dashboard,
|
|
@@ -22,6 +23,7 @@ function Dashboard() {
|
|
|
22
23
|
<Link to="/dashboard/api-keys">API keys</Link>
|
|
23
24
|
)}
|
|
24
25
|
</nav>
|
|
26
|
+
<LogOut />
|
|
25
27
|
</main>
|
|
26
28
|
);
|
|
27
29
|
}
|