You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create a distilled version of `npx convex deploy` that only has the flags and behavior necessary for self-hosting.
1. refactored deployment-agnostic options into the Command interface
2. refactor out `deployToDeployment`, which is the stuff that `npx convex deploy` runs after it knows what deployment it wants to talk to.
3. create command `npx convex self-host deploy` that deploys to a self-hosted deployment
note the `handleManuallySetUrlAndAdminKey` writes VITE_CONVEX_URL to .env.local, which I think only `npx convex self-host dev` wants to do.
The flow I imagine is similar to existing `npx convex dev` and `npx convex deploy`: while developing locally you run `npx convex self-host dev`, and it uses env variables from .env.local. Then when you git push, Vercel (or whatever hosting provider) runs `npx convex self-host deploy`, which uses env variables from vercel, and pushes to potentially a different self-hosted deployment. The point of these commands is they talk to a deployment directly via url and admin key, and never have to talk to big-brain.
GitOrigin-RevId: e0d5793528f1a7a61e05567fe916605744476d3a
@@ -43,45 +43,7 @@ export const deploy = new Command("deploy")
43
43
"Deploys to a preview deployment if the `CONVEX_DEPLOY_KEY` environment variable is set to a Preview Deploy Key.",
44
44
)
45
45
.allowExcessArguments(false)
46
-
.option("-v, --verbose","Show full listing of changes")
47
-
.option(
48
-
"--dry-run",
49
-
"Print out the generated configuration without deploying to your Convex deployment",
50
-
)
51
-
.option("-y, --yes","Skip confirmation prompt when running locally")
52
-
.addOption(
53
-
newOption(
54
-
"--typecheck <mode>",
55
-
`Whether to check TypeScript files with \`tsc --noEmit\` before deploying.`,
56
-
)
57
-
.choices(["enable","try","disable"]asconst)
58
-
.default("try"asconst),
59
-
)
60
-
.option(
61
-
"--typecheck-components",
62
-
"Check TypeScript files within component implementations with `tsc --noEmit`.",
63
-
false,
64
-
)
65
-
.addOption(
66
-
newOption(
67
-
"--codegen <mode>",
68
-
"Whether to regenerate code in `convex/_generated/` before pushing.",
69
-
)
70
-
.choices(["enable","disable"]asconst)
71
-
.default("enable"asconst),
72
-
)
73
-
.addOption(
74
-
newOption(
75
-
"--cmd <command>",
76
-
"Command to run as part of deploying your app (e.g. `vite build`). This command can depend on the environment variables specified in `--cmd-url-env-var-name` being set.",
77
-
),
78
-
)
79
-
.addOption(
80
-
newOption(
81
-
"--cmd-url-env-var-name <name>",
82
-
"Environment variable name to set Convex deployment URL (e.g. `VITE_CONVEX_URL`) when using `--cmd`",
83
-
),
84
-
)
46
+
.addDeployOptions()
85
47
.addOption(
86
48
newOption(
87
49
"--preview-run <functionName>",
@@ -103,12 +65,9 @@ export const deploy = new Command("deploy")
returnthis.option("-v, --verbose","Show full listing of changes")
215
+
.option(
216
+
"--dry-run",
217
+
"Print out the generated configuration without deploying to your Convex deployment",
218
+
)
219
+
.option("-y, --yes","Skip confirmation prompt when running locally")
220
+
.addOption(
221
+
newOption(
222
+
"--typecheck <mode>",
223
+
`Whether to check TypeScript files with \`tsc --noEmit\` before deploying.`,
224
+
)
225
+
.choices(["enable","try","disable"]asconst)
226
+
.default("try"asconst),
227
+
)
228
+
.option(
229
+
"--typecheck-components",
230
+
"Check TypeScript files within component implementations with `tsc --noEmit`.",
231
+
false,
232
+
)
233
+
.addOption(
234
+
newOption(
235
+
"--codegen <mode>",
236
+
"Whether to regenerate code in `convex/_generated/` before pushing.",
237
+
)
238
+
.choices(["enable","disable"]asconst)
239
+
.default("enable"asconst),
240
+
)
241
+
.addOption(
242
+
newOption(
243
+
"--cmd <command>",
244
+
"Command to run as part of deploying your app (e.g. `vite build`). This command can depend on the environment variables specified in `--cmd-url-env-var-name` being set.",
245
+
),
246
+
)
247
+
.addOption(
248
+
newOption(
249
+
"--cmd-url-env-var-name <name>",
250
+
"Environment variable name to set Convex deployment URL (e.g. `VITE_CONVEX_URL`) when using `--cmd`",
0 commit comments