Skip to content

Commit ec02951

Browse files
authored
Merge pull request #18 from get-convex/magicseth/check-gh-issues
Clarify --component flag refers to module name
2 parents 47234cd + 29a5606 commit ec02951

5 files changed

Lines changed: 15 additions & 8 deletions

File tree

INTEGRATION.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,12 @@ npm install @convex-dev/static-hosting
295295
- You must create `convex/http.ts` and register routes
296296
- Run `npx convex dev` to regenerate types after adding http.ts
297297

298-
### Component name mismatch
299-
Default component name is `staticHosting`. If you named your file differently or used a different component name in config, specify it:
298+
### `--component` is the module name, not the component name
299+
Despite its name, `--component <name>` refers to the **Convex module** where you exposed the upload API (i.e. `convex/<name>.ts`), not the component name registered in `convex.config.ts`. If you put the `exposeUploadApi(...)` re-exports in `convex/myCustomName.ts`, pass:
300300
```bash
301301
npx @convex-dev/static-hosting upload --component myCustomName
302302
```
303+
Default is `staticHosting` (i.e. `convex/staticHosting.ts`).
303304

304305
## API Reference
305306

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ npx @convex-dev/static-hosting upload [options]
127127

128128
Options:
129129
-d, --dist <path> Path to dist directory (default: ./dist)
130-
-c, --component <name> Convex component name (default: staticHosting)
130+
-c, --component <module> Module name where upload API is exposed — i.e.
131+
convex/<module>.ts (default: staticHosting)
131132
--prod Deploy to production Convex deployment
132133
--dev Deploy to dev deployment (default)
133134
-b, --build Run 'npm run build' with correct VITE_CONVEX_URL
@@ -203,7 +204,8 @@ npx @convex-dev/static-hosting deploy [options]
203204

204205
Options:
205206
-d, --dist <path> Path to dist directory (default: ./dist)
206-
-c, --component <name> Convex component name (default: staticHosting)
207+
-c, --component <module> Module name where upload API is exposed — i.e.
208+
convex/<module>.ts (default: staticHosting)
207209
--skip-build Skip the build step (use existing dist)
208210
--skip-convex Skip Convex backend deployment
209211
-h, --help Show help

src/cli/deploy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ Minimizes the inconsistency window between backend and frontend updates.
6565
6666
Options:
6767
-d, --dist <path> Path to dist directory (default: ./dist)
68-
-c, --component <name> Convex component name (default: staticHosting)
68+
-c, --component <module> Module name where upload API is exposed — i.e.
69+
convex/<module>.ts (default: staticHosting). Not
70+
the registered component name from convex.config.ts.
6971
--skip-build Skip the build step (use existing dist)
7072
--skip-convex Skip Convex backend deployment
7173
--cdn Upload non-HTML assets to convex-fs CDN

src/cli/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ npx @convex-dev/static-hosting upload [options]
161161
162162
Options:
163163
-d, --dist <path> Path to dist directory (default: ./dist)
164-
-c, --component <name> Convex component name (default: staticHosting)
164+
-c, --component <module> Module name where upload API is exposed — i.e. convex/<module>.ts (default: staticHosting)
165165
--prod Deploy to production Convex deployment
166166
--dev Deploy to dev deployment (default)
167167
-b, --build Run 'npm run build' with correct VITE_CONVEX_URL

src/cli/upload.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Options:
99
* --dist <path> Path to dist directory (default: ./dist)
10-
* --component <name> Convex component with upload functions (default: staticHosting)
10+
* --component <module> Module name where upload API is exposed — i.e. convex/<module>.ts (default: staticHosting)
1111
* --prod Deploy to production deployment
1212
* --help Show help
1313
*/
@@ -102,7 +102,9 @@ Upload static files from a dist directory to Convex storage.
102102
103103
Options:
104104
-d, --dist <path> Path to dist directory (default: ./dist)
105-
-c, --component <name> Convex component with upload functions (default: staticHosting)
105+
-c, --component <module> Module name where upload API is exposed — i.e.
106+
convex/<module>.ts (default: staticHosting). Not
107+
the registered component name from convex.config.ts.
106108
--prod Deploy to production deployment
107109
-b, --build Run 'npm run build' with correct VITE_CONVEX_URL before uploading
108110
--cdn Upload non-HTML assets to convex-fs CDN instead of Convex storage

0 commit comments

Comments
 (0)