kitcn 0.13.2 → 0.13.4
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/{backend-core-B4DHUUfg.mjs → backend-core-D2a2poAE.mjs} +1024 -23
- package/dist/cli.mjs +13 -7
- package/dist/watcher.mjs +1 -1
- package/package.json +1 -1
- package/skills/convex/references/setup/expo.md +73 -0
- package/skills/convex/references/setup/index.md +9 -0
- package/skills/convex/references/setup/server.md +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as promptForScaffoldTemplateSelection, A as resolveCodegenTrimSegments, B as runConfiguredCodegen, C as isEntryPoint, Ct as serializeEnvValue, D as parseInitCommandArgs, Dt as logger, E as parseBackendRunJson, F as resolveRunDeps, G as runMigrationFlow, H as runDevSchemaBackfillIfNeeded, I as runAfterScaffoldScript, J as withWorkingDirectory, K as trackProcess, L as runAggregateBackfillFlow, M as resolveDocTopic, N as resolveInitProjectDir, O as readPackageVersions, Ot as highlighter, P as resolveMigrationConfig, Q as promptForPluginSelection, R as runAggregatePruneFlow, S as isConvexDevPreRunConflictFlag, St as resolveAuthEnvState, T as parseArgs, U as runInitCommandFlow, V as runConvexInitIfNeeded, W as runMigrationCreate, X as collectPluginScaffoldTemplates, Y as createSpinner, Z as filterScaffoldTemplatePathMap, _ as formatInfoOutput, _t as applyPlanningDependencyInstall, a as cleanup, at as getPluginCatalogEntry, b as getDevAggregateBackfillStatePath, bt as resolveSupportedDependencyWarnings, c as createCommandEnv, ct as buildPluginInstallPlan, d as extractBackfillCliOptions, dt as collectInstalledPluginKeys, et as resolveAddTemplateDefaults, f as extractConcaveRunTargetArgs, ft as getPluginLockfilePath, g as formatDocsOutput, gt as applyDependencyHintsInstall, h as extractResetCliOptions, ht as resolveSchemaInstalledPlugins, i as buildInitializationPlan, it as resolveTemplatesByIdOrThrow, j as resolveConfiguredBackend, k as resolveBackfillConfig, l as ensureConvexGitignoreEntry, lt as resolvePluginScaffoldRoots, m as extractMigrationDownOptions, mt as readPluginLockfile, n as applyPluginInstallPlanFiles, nt as resolvePresetScaffoldTemplates, o as createBackendAdapter, ot as getSupportedPluginKeys, p as extractMigrationCliOptions, pt as getSchemaFilePath, q as withLocalCodegenEnv, r as assertNoRemovedDevPreRunFlag, rt as resolveTemplateSelectionSource, s as createBackendCommandEnv, st as isSupportedPluginKey, t as applyDependencyInstallPlan, tt as resolvePluginPreset, u as extractBackendRunTargetArgs, ut as assertSchemaFileExists, v as getAggregateBackfillDeploymentKey, vt as applyPluginDependencyInstall, w as isInitialized, wt as stripConvexCommandNoise, x as hasRemoteConvexDeploymentEnv, xt as resolveProjectScaffoldContext, y as getConvexDeploymentCommandEnv, yt as inspectPluginDependencyInstall, z as runBackendFunction } from "./backend-core-
|
|
2
|
+
import { $ as promptForScaffoldTemplateSelection, A as resolveCodegenTrimSegments, B as runConfiguredCodegen, C as isEntryPoint, Ct as serializeEnvValue, D as parseInitCommandArgs, Dt as logger, E as parseBackendRunJson, F as resolveRunDeps, G as runMigrationFlow, H as runDevSchemaBackfillIfNeeded, I as runAfterScaffoldScript, J as withWorkingDirectory, K as trackProcess, L as runAggregateBackfillFlow, M as resolveDocTopic, N as resolveInitProjectDir, O as readPackageVersions, Ot as highlighter, P as resolveMigrationConfig, Q as promptForPluginSelection, R as runAggregatePruneFlow, S as isConvexDevPreRunConflictFlag, St as resolveAuthEnvState, T as parseArgs, U as runInitCommandFlow, V as runConvexInitIfNeeded, W as runMigrationCreate, X as collectPluginScaffoldTemplates, Y as createSpinner, Z as filterScaffoldTemplatePathMap, _ as formatInfoOutput, _t as applyPlanningDependencyInstall, a as cleanup, at as getPluginCatalogEntry, b as getDevAggregateBackfillStatePath, bt as resolveSupportedDependencyWarnings, c as createCommandEnv, ct as buildPluginInstallPlan, d as extractBackfillCliOptions, dt as collectInstalledPluginKeys, et as resolveAddTemplateDefaults, f as extractConcaveRunTargetArgs, ft as getPluginLockfilePath, g as formatDocsOutput, gt as applyDependencyHintsInstall, h as extractResetCliOptions, ht as resolveSchemaInstalledPlugins, i as buildInitializationPlan, it as resolveTemplatesByIdOrThrow, j as resolveConfiguredBackend, k as resolveBackfillConfig, l as ensureConvexGitignoreEntry, lt as resolvePluginScaffoldRoots, m as extractMigrationDownOptions, mt as readPluginLockfile, n as applyPluginInstallPlanFiles, nt as resolvePresetScaffoldTemplates, o as createBackendAdapter, ot as getSupportedPluginKeys, p as extractMigrationCliOptions, pt as getSchemaFilePath, q as withLocalCodegenEnv, r as assertNoRemovedDevPreRunFlag, rt as resolveTemplateSelectionSource, s as createBackendCommandEnv, st as isSupportedPluginKey, t as applyDependencyInstallPlan, tt as resolvePluginPreset, u as extractBackendRunTargetArgs, ut as assertSchemaFileExists, v as getAggregateBackfillDeploymentKey, vt as applyPluginDependencyInstall, w as isInitialized, wt as stripConvexCommandNoise, x as hasRemoteConvexDeploymentEnv, xt as resolveProjectScaffoldContext, y as getConvexDeploymentCommandEnv, yt as inspectPluginDependencyInstall, z as runBackendFunction } from "./backend-core-D2a2poAE.mjs";
|
|
3
3
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import path, { delimiter, dirname, join, relative, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -638,7 +638,7 @@ function resolveConcaveLocalSiteUrl(cwd = process.cwd()) {
|
|
|
638
638
|
const envLocalPath = join(cwd, ".env.local");
|
|
639
639
|
if (!fs.existsSync(envLocalPath)) return "http://localhost:3000";
|
|
640
640
|
const parsed = parseEnv(fs.readFileSync(envLocalPath, "utf8"));
|
|
641
|
-
return parsed.NEXT_PUBLIC_SITE_URL ?? parsed.VITE_SITE_URL ?? "http://localhost:3000";
|
|
641
|
+
return parsed.NEXT_PUBLIC_SITE_URL ?? parsed.EXPO_PUBLIC_SITE_URL ?? parsed.VITE_SITE_URL ?? "http://localhost:3000";
|
|
642
642
|
}
|
|
643
643
|
function resolveImplicitConvexRemoteDeploymentEnv(cwd = process.cwd()) {
|
|
644
644
|
const envLocalPath = join(cwd, ".env.local");
|
|
@@ -1571,6 +1571,7 @@ const handleAggregateCommand = async (argv, deps = {}) => {
|
|
|
1571
1571
|
realConvexPath,
|
|
1572
1572
|
realConcavePath
|
|
1573
1573
|
});
|
|
1574
|
+
const commandEnv = backend === "convex" ? getConvexDeploymentCommandEnv() : void 0;
|
|
1574
1575
|
const { remainingArgs: aggregateCommandArgs, overrides: aggregateBackfillOverrides } = extractBackfillCliOptions(parsed.restArgs.slice(1));
|
|
1575
1576
|
const aggregateArgs = [...config.deploy.args, ...aggregateCommandArgs];
|
|
1576
1577
|
const backfillConfig = {
|
|
@@ -1581,7 +1582,8 @@ const handleAggregateCommand = async (argv, deps = {}) => {
|
|
|
1581
1582
|
if (subcommand === "prune") return runAggregatePruneFlow({
|
|
1582
1583
|
execaFn,
|
|
1583
1584
|
backendAdapter,
|
|
1584
|
-
targetArgs
|
|
1585
|
+
targetArgs,
|
|
1586
|
+
env: commandEnv
|
|
1585
1587
|
});
|
|
1586
1588
|
return runAggregateBackfillFlow({
|
|
1587
1589
|
execaFn,
|
|
@@ -1589,6 +1591,7 @@ const handleAggregateCommand = async (argv, deps = {}) => {
|
|
|
1589
1591
|
backfillConfig,
|
|
1590
1592
|
mode: subcommand === "rebuild" ? "rebuild" : "resume",
|
|
1591
1593
|
targetArgs,
|
|
1594
|
+
env: commandEnv,
|
|
1592
1595
|
context: "aggregate"
|
|
1593
1596
|
});
|
|
1594
1597
|
};
|
|
@@ -2169,7 +2172,7 @@ const INIT_LOCAL_BOOTSTRAP_PROMPT = "Run one-shot local Convex bootstrap after i
|
|
|
2169
2172
|
const INIT_HELP_TEXT = `Usage: kitcn init [options]
|
|
2170
2173
|
|
|
2171
2174
|
Options:
|
|
2172
|
-
--template, -t App template ("next", "start", or "vite") for fresh app scaffolding
|
|
2175
|
+
--template, -t App template ("next", "expo", "start", or "vite") for fresh app scaffolding
|
|
2173
2176
|
--cwd Target directory (or parent when used with --name)
|
|
2174
2177
|
--name Project name when scaffolding a fresh app
|
|
2175
2178
|
--prod Forward to \`convex init\`
|
|
@@ -2342,6 +2345,7 @@ const handleMigrateCommand = async (argv, deps = {}) => {
|
|
|
2342
2345
|
realConvexPath,
|
|
2343
2346
|
realConcavePath
|
|
2344
2347
|
});
|
|
2348
|
+
const commandEnv = backend === "convex" ? getConvexDeploymentCommandEnv() : void 0;
|
|
2345
2349
|
if (migrateArgs.subcommand === "create") {
|
|
2346
2350
|
const rawName = migrateArgs.restArgs.join(" ").trim();
|
|
2347
2351
|
if (!rawName) throw new Error("Missing migration name. Usage: `kitcn migrate create <name>`.");
|
|
@@ -2364,6 +2368,7 @@ const handleMigrateCommand = async (argv, deps = {}) => {
|
|
|
2364
2368
|
backendAdapter,
|
|
2365
2369
|
migrationConfig,
|
|
2366
2370
|
targetArgs,
|
|
2371
|
+
env: commandEnv,
|
|
2367
2372
|
context: "migration",
|
|
2368
2373
|
direction: "up"
|
|
2369
2374
|
});
|
|
@@ -2374,13 +2379,14 @@ const handleMigrateCommand = async (argv, deps = {}) => {
|
|
|
2374
2379
|
backendAdapter,
|
|
2375
2380
|
migrationConfig,
|
|
2376
2381
|
targetArgs: extractBackendRunTargetArgs(backend, remainingArgs),
|
|
2382
|
+
env: commandEnv,
|
|
2377
2383
|
context: "migration",
|
|
2378
2384
|
direction: "down",
|
|
2379
2385
|
steps,
|
|
2380
2386
|
to
|
|
2381
2387
|
});
|
|
2382
2388
|
}
|
|
2383
|
-
if (migrateArgs.subcommand === "status") return (await runBackendFunction(execaFn, backendAdapter, "generated/server:migrationStatus", {}, targetArgs)).exitCode;
|
|
2389
|
+
if (migrateArgs.subcommand === "status") return (await runBackendFunction(execaFn, backendAdapter, "generated/server:migrationStatus", {}, targetArgs, { env: commandEnv })).exitCode;
|
|
2384
2390
|
let runId;
|
|
2385
2391
|
const cancelArgs = [];
|
|
2386
2392
|
for (let index = 0; index < commandArgs.length; index += 1) {
|
|
@@ -2401,7 +2407,7 @@ const handleMigrateCommand = async (argv, deps = {}) => {
|
|
|
2401
2407
|
cancelArgs.push(arg);
|
|
2402
2408
|
}
|
|
2403
2409
|
const cancelTargetArgs = extractBackendRunTargetArgs(backend, cancelArgs);
|
|
2404
|
-
return (await runBackendFunction(execaFn, backendAdapter, "generated/server:migrationCancel", runId ? { runId } : {}, cancelTargetArgs)).exitCode;
|
|
2410
|
+
return (await runBackendFunction(execaFn, backendAdapter, "generated/server:migrationCancel", runId ? { runId } : {}, cancelTargetArgs, { env: commandEnv })).exitCode;
|
|
2405
2411
|
};
|
|
2406
2412
|
|
|
2407
2413
|
//#endregion
|
|
@@ -2629,7 +2635,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
2629
2635
|
const HELP_FLAGS = new Set(["--help", "-h"]);
|
|
2630
2636
|
const VERSION_FLAGS = new Set(["--version", "-v"]);
|
|
2631
2637
|
const packageJson = readOwnPackageJson(import.meta.url);
|
|
2632
|
-
const REMOVED_CREATE_MESSAGE = "Removed `kitcn create`. Use `kitcn init -t <next|start|vite>` for fresh app scaffolding.";
|
|
2638
|
+
const REMOVED_CREATE_MESSAGE = "Removed `kitcn create`. Use `kitcn init -t <next|expo|start|vite>` for fresh app scaffolding.";
|
|
2633
2639
|
const LOCAL_NODE_REEXEC_ENV = "KITCN_NODE_REEXEC";
|
|
2634
2640
|
const LOCAL_NODE_REEXEC_COMMANDS = new Set([
|
|
2635
2641
|
"add",
|
package/dist/watcher.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Dt as logger, Et as getConvexConfig, F as resolveRunDeps, Tt as generateMeta, j as resolveConfiguredBackend, q as withLocalCodegenEnv } from "./backend-core-
|
|
2
|
+
import { Dt as logger, Et as getConvexConfig, F as resolveRunDeps, Tt as generateMeta, j as resolveConfiguredBackend, q as withLocalCodegenEnv } from "./backend-core-D2a2poAE.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Expo Setup
|
|
2
|
+
|
|
3
|
+
Use Expo when you want the official `create-expo-app` shell with the kitcn
|
|
4
|
+
Convex baseline layered on top.
|
|
5
|
+
|
|
6
|
+
## Fresh scaffold
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npx kitcn@latest init -t expo --yes
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This path owns:
|
|
13
|
+
|
|
14
|
+
- `.env.local`
|
|
15
|
+
- `expo-env.d.ts`
|
|
16
|
+
- `src/components/providers.tsx`
|
|
17
|
+
- `src/lib/convex/*`
|
|
18
|
+
- `src/app/_layout.tsx`
|
|
19
|
+
- `src/app/index.tsx`
|
|
20
|
+
- `convex/functions/schema.ts`
|
|
21
|
+
- `convex/functions/messages.ts`
|
|
22
|
+
- `convex/lib/crpc.ts`
|
|
23
|
+
- `convex/lib/get-env.ts`
|
|
24
|
+
- `convex/shared/api.ts`
|
|
25
|
+
|
|
26
|
+
V1 scope stays narrow:
|
|
27
|
+
|
|
28
|
+
- fresh scaffold only
|
|
29
|
+
- no existing Expo adoption
|
|
30
|
+
- no styling-framework layer beyond the official Expo baseline
|
|
31
|
+
|
|
32
|
+
## Add auth
|
|
33
|
+
|
|
34
|
+
Expo uses the default auth scaffold:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx kitcn@latest init -t expo --yes
|
|
38
|
+
npx kitcn add auth --yes
|
|
39
|
+
npx kitcn add auth --schema --yes
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This writes:
|
|
43
|
+
|
|
44
|
+
- `src/lib/convex/auth-client.ts`
|
|
45
|
+
- `src/lib/convex/convex-provider.tsx`
|
|
46
|
+
- `src/app/auth.tsx`
|
|
47
|
+
- `convex/functions/auth.config.ts`
|
|
48
|
+
- `convex/functions/auth.ts`
|
|
49
|
+
- auth-owned blocks in `convex/functions/schema.ts`
|
|
50
|
+
|
|
51
|
+
Expo auth keeps managed schema refresh. It is not a separate preset.
|
|
52
|
+
|
|
53
|
+
## Env contract
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
EXPO_PUBLIC_CONVEX_URL=http://127.0.0.1:3210
|
|
57
|
+
EXPO_PUBLIC_CONVEX_SITE_URL=http://127.0.0.1:3211
|
|
58
|
+
EXPO_PUBLIC_SITE_URL=http://localhost:3000
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use `process.env.EXPO_PUBLIC_*` directly in client code.
|
|
62
|
+
|
|
63
|
+
## Run it
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# terminal 1
|
|
67
|
+
npx kitcn dev
|
|
68
|
+
|
|
69
|
+
# terminal 2
|
|
70
|
+
bun run start
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The starter app opens to one native messages screen backed by Convex.
|
|
@@ -107,6 +107,12 @@ npx kitcn@latest --backend concave init --yes
|
|
|
107
107
|
# New Next.js app with deterministic shadcn bootstrap + first local Convex bootstrap
|
|
108
108
|
npx kitcn@latest init -t next --yes
|
|
109
109
|
|
|
110
|
+
# New Expo app with the official create-expo-app shell + first local Convex bootstrap
|
|
111
|
+
npx kitcn@latest init -t expo --yes
|
|
112
|
+
|
|
113
|
+
# New TanStack Start app with the official shadcn Start shell + first local Convex bootstrap
|
|
114
|
+
npx kitcn@latest init -t start --yes
|
|
115
|
+
|
|
110
116
|
# New Vite app with the React baseline + first local Convex bootstrap
|
|
111
117
|
npx kitcn@latest init -t vite --yes
|
|
112
118
|
|
|
@@ -175,6 +181,8 @@ Universal scaffold rule:
|
|
|
175
181
|
Public template keys stay concrete:
|
|
176
182
|
|
|
177
183
|
- `next`
|
|
184
|
+
- `expo`
|
|
185
|
+
- `start`
|
|
178
186
|
- `vite`
|
|
179
187
|
|
|
180
188
|
Internal scaffold modes stay broad:
|
|
@@ -184,6 +192,7 @@ Internal scaffold modes stay broad:
|
|
|
184
192
|
|
|
185
193
|
Framework mapping:
|
|
186
194
|
|
|
195
|
+
- `expo` -> `expo`
|
|
187
196
|
- `next-app` -> `next-app`
|
|
188
197
|
- `next-pages`, `vite`, `react-router`, `tanstack-start`, `manual` -> `react`
|
|
189
198
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## 5. Core Backend
|
|
2
2
|
|
|
3
|
-
For production bootstrap, start in the CLI Registry: use `npx kitcn@latest init -t <next|vite> --yes` for the shortest fresh local path, `npx kitcn@latest init --yes` to adopt the current app and finish the first local Convex bootstrap in one command, and `bunx kitcn add <plugin>` for feature layers. This file is the manual backend wiring reference.
|
|
3
|
+
For production bootstrap, start in the CLI Registry: use `npx kitcn@latest init -t <next|expo|start|vite> --yes` for the shortest fresh local path, `npx kitcn@latest init --yes` to adopt the current app and finish the first local Convex bootstrap in one command, and `bunx kitcn add <plugin>` for feature layers. This file is the manual backend wiring reference.
|
|
4
4
|
|
|
5
5
|
### 5.1 Define schema and relations
|
|
6
6
|
|