@samebase/convex-hosting 0.8.0 → 0.10.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +114 -289
  3. package/dist/cli/files.js +5 -5
  4. package/dist/cli/files.js.map +1 -1
  5. package/dist/cli/main.js +1 -1
  6. package/dist/cli/main.js.map +1 -1
  7. package/dist/client/index.d.ts +10 -11
  8. package/dist/client/index.js +37 -16
  9. package/dist/client/index.js.map +1 -1
  10. package/dist/component/lib.js +5 -5
  11. package/dist/component/lib.js.map +1 -1
  12. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/analytics.js.map +1 -0
  13. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/compatibility-flags.js.map +1 -0
  14. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/configuration.js.map +1 -0
  15. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/constants.js.map +1 -0
  16. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/handler.js.map +1 -0
  17. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/types.js.map +1 -0
  18. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/utils/base-path.js.map +1 -0
  19. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/utils/headers.js.map +1 -0
  20. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/utils/rules-engine.js.map +1 -0
  21. package/dist/workers-sdk/packages/workers-shared/asset-worker/src/worker.js.map +1 -0
  22. package/dist/workers-sdk/packages/workers-shared/utils/base-path.js.map +1 -0
  23. package/dist/workers-sdk/packages/workers-shared/utils/configuration/constants.js.map +1 -0
  24. package/dist/workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.js.map +1 -0
  25. package/dist/workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.js.map +1 -0
  26. package/dist/workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.js.map +1 -0
  27. package/dist/workers-sdk/packages/workers-shared/utils/configuration/parseStaticRouting.js.map +1 -0
  28. package/dist/workers-sdk/packages/workers-shared/utils/configuration/types.js.map +1 -0
  29. package/dist/workers-sdk/packages/workers-shared/utils/configuration/validateURL.js.map +1 -0
  30. package/dist/workers-sdk/packages/workers-shared/utils/constants.js.map +1 -0
  31. package/dist/workers-sdk/packages/workers-shared/utils/helpers.js.map +1 -0
  32. package/dist/workers-sdk/packages/workers-shared/utils/responses.js.map +1 -0
  33. package/dist/workers-sdk/packages/workers-shared/utils/tracing.js.map +1 -0
  34. package/dist/workers-sdk/packages/workers-shared/utils/types.js.map +1 -0
  35. package/package.json +3 -2
  36. package/dist/workers-shared/asset-worker/src/analytics.js.map +0 -1
  37. package/dist/workers-shared/asset-worker/src/compatibility-flags.js.map +0 -1
  38. package/dist/workers-shared/asset-worker/src/configuration.js.map +0 -1
  39. package/dist/workers-shared/asset-worker/src/constants.js.map +0 -1
  40. package/dist/workers-shared/asset-worker/src/handler.js.map +0 -1
  41. package/dist/workers-shared/asset-worker/src/types.js.map +0 -1
  42. package/dist/workers-shared/asset-worker/src/utils/base-path.js.map +0 -1
  43. package/dist/workers-shared/asset-worker/src/utils/headers.js.map +0 -1
  44. package/dist/workers-shared/asset-worker/src/utils/rules-engine.js.map +0 -1
  45. package/dist/workers-shared/asset-worker/src/worker.js.map +0 -1
  46. package/dist/workers-shared/utils/base-path.js.map +0 -1
  47. package/dist/workers-shared/utils/configuration/constants.js.map +0 -1
  48. package/dist/workers-shared/utils/configuration/constructConfiguration.js.map +0 -1
  49. package/dist/workers-shared/utils/configuration/parseHeaders.js.map +0 -1
  50. package/dist/workers-shared/utils/configuration/parseRedirects.js.map +0 -1
  51. package/dist/workers-shared/utils/configuration/parseStaticRouting.js.map +0 -1
  52. package/dist/workers-shared/utils/configuration/types.js.map +0 -1
  53. package/dist/workers-shared/utils/configuration/validateURL.js.map +0 -1
  54. package/dist/workers-shared/utils/constants.js.map +0 -1
  55. package/dist/workers-shared/utils/helpers.js.map +0 -1
  56. package/dist/workers-shared/utils/responses.js.map +0 -1
  57. package/dist/workers-shared/utils/tracing.js.map +0 -1
  58. package/dist/workers-shared/utils/types.js.map +0 -1
  59. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/analytics.d.ts +0 -0
  60. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/analytics.js +0 -0
  61. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/compatibility-flags.d.ts +0 -0
  62. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/compatibility-flags.js +0 -0
  63. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/configuration.d.ts +0 -0
  64. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/configuration.js +0 -0
  65. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/constants.d.ts +0 -0
  66. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/constants.js +0 -0
  67. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/handler.d.ts +0 -0
  68. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/handler.js +0 -0
  69. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/types.d.ts +0 -0
  70. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/types.js +0 -0
  71. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/base-path.d.ts +0 -0
  72. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/base-path.js +0 -0
  73. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/headers.d.ts +0 -0
  74. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/headers.js +0 -0
  75. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/rules-engine.d.ts +0 -0
  76. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/utils/rules-engine.js +0 -0
  77. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/worker.d.ts +0 -0
  78. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/asset-worker/src/worker.js +0 -0
  79. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/base-path.d.ts +0 -0
  80. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/base-path.js +0 -0
  81. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/constants.d.ts +0 -0
  82. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/constants.js +0 -0
  83. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/constructConfiguration.d.ts +0 -0
  84. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/constructConfiguration.js +0 -0
  85. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseHeaders.d.ts +0 -0
  86. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseHeaders.js +0 -0
  87. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseRedirects.d.ts +0 -0
  88. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseRedirects.js +0 -0
  89. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseStaticRouting.d.ts +0 -0
  90. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/parseStaticRouting.js +0 -0
  91. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/types.d.ts +0 -0
  92. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/types.js +0 -0
  93. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/validateURL.d.ts +0 -0
  94. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/configuration/validateURL.js +0 -0
  95. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/constants.d.ts +0 -0
  96. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/constants.js +0 -0
  97. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/helpers.d.ts +0 -0
  98. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/helpers.js +0 -0
  99. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/responses.d.ts +0 -0
  100. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/responses.js +0 -0
  101. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/tracing.d.ts +0 -0
  102. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/tracing.js +0 -0
  103. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/types.d.ts +0 -0
  104. /package/dist/{workers-shared → workers-sdk/packages/workers-shared}/utils/types.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0
4
+
5
+ - `routeAll(http, component, versionId, worker?)` replaces `serveSite`. It builds the site's HTTP
6
+ action with Convex's `httpActionGeneric` and routes it for every method Convex routes, at every
7
+ path, so `convex/http.ts` reads `routeAll(http, components.hosting, versionId, server)`: no method
8
+ loop and no `httpAction`. It returns the action for the exact routes an app registers past a
9
+ component's HTTP prefix, such as cookie-session routes under Convex Auth's `/auth`. Breaking:
10
+ `serveSite` is gone.
11
+
12
+ ## 0.9.0
13
+
14
+ - `serveSite(component, versionId, worker?)` returns the handler of the site routes, so
15
+ `convex/http.ts` reads `httpAction(serveSite(components.hosting, versionId, server))`. The third
16
+ argument is the Worker script itself, the object with `fetch(request)` that the app's server entry
17
+ exports, in place of a `render` callback that closed over the request. Breaking: the old
18
+ `serveSite(ctx, component, request, versionId, render?)` is gone.
19
+ - `convex/http.ts` registers the handler for every method, as every request reaches a Cloudflare
20
+ Worker: a file answers 405 to any method but GET and HEAD, a miss goes to the Worker or answers
21
+ 404 without one. The README and the examples show the loop; the package code is unchanged.
22
+
3
23
  ## 0.8.0
4
24
 
5
25
  - `serveSite` without `render` routes like a Cloudflare Worker without a script:
package/README.md CHANGED
@@ -1,315 +1,140 @@
1
1
  # Convex Hosting
2
2
 
3
- Host a web app on Convex, next to its backend: the files of a build and, when the app renders pages,
4
- those pages. The site is at `https://<deployment>.convex.site`.
5
-
6
- It works like
7
- [Cloudflare Workers with static assets](https://developers.cloudflare.com/workers/static-assets/):
8
- the same `_headers`, `_redirects`, and `.assetsignore` files, the same `html_handling` and
9
- `not_found_handling` options, and the same responses, computed by Cloudflare's own asset-serving
10
- code.
11
-
12
- ## Setup
3
+ Serves a web app from its own Convex deployment, at `https://<deployment>.convex.site`: the files of
4
+ a build, and the pages the app renders.
5
+
6
+ The serving code is Cloudflare's. The asset Worker behind
7
+ [Cloudflare Workers with static assets](https://developers.cloudflare.com/workers/static-assets/) is
8
+ copied from [cloudflare/workers-sdk](https://github.com/cloudflare/workers-sdk) at a pinned commit
9
+ and runs inside a Convex HTTP action. So `_headers`, `_redirects`, `.assetsignore`, `html_handling`,
10
+ and `not_found_handling` mean what they mean on Cloudflare, and a request gets the response a Worker
11
+ sends. This repository's CI runs Cloudflare's own tests against it: its
12
+ [196 cases](https://github.com/samebase/convex-hosting/blob/main/packages/convex-hosting/src/component/conformance.test.ts)
13
+ for `html_handling` and path encoding, and its
14
+ [integration test](https://github.com/samebase/convex-hosting/tree/main/packages/convex-hosting/src/workers-sdk/fixtures/workers-with-assets-only)
15
+ for a files-only site, unchanged, on a local Convex deployment.
16
+
17
+ An app that renders pages takes the place of the Worker script: an object with `fetch(request)` that
18
+ answers what no file answers. TanStack Start has
19
+ [an adapter](https://github.com/samebase/convex-hosting/tree/main/packages/convex-hosting-tanstack-start),
20
+ with streamed pages, server functions, server routes, request middleware, and cookie sessions. The
21
+ [TanStack Start example](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-ssr)
22
+ is deployed here and, from the same source, as a real Worker; CI keeps the two byte-identical but
23
+ for the files that name the host.
24
+
25
+ Use it when the backend is Convex and a second host for the frontend is one host too many. A Worker
26
+ has what Convex does not: the data center nearest the visitor, Node's built-in modules, an edge
27
+ cache, and WebSockets. The list, with numbers, is in
28
+ [What differs from a Worker](https://github.com/samebase/convex-hosting/blob/main/docs/workers.md).
29
+
30
+ ## Use
13
31
 
14
32
  Requires `convex` 1.46 or later.
15
33
 
16
- 1. Install:
17
-
18
- ```sh
19
- npm install @samebase/convex-hosting
20
- ```
21
-
22
- 2. `convex/convex.config.ts` mounts the component:
23
-
24
- ```ts
25
- import { defineApp } from "convex/server";
26
- import hosting from "@samebase/convex-hosting/convex.config";
27
-
28
- const app = defineApp();
29
- app.use(hosting);
30
-
31
- export default app;
32
- ```
33
-
34
- 3. `convex/http.ts` has one `GET` route for the site. Convex answers `HEAD` through it.
35
-
36
- ```ts
37
- import { httpRouter } from "convex/server";
38
- import { serveSite } from "@samebase/convex-hosting";
39
- import { components } from "./_generated/api.js";
40
- import { httpAction } from "./_generated/server.js";
41
- import { versionId } from "../.convex-hosting/version.js";
42
-
43
- const http = httpRouter();
44
-
45
- http.route({
46
- pathPrefix: "/",
47
- method: "GET",
48
- handler: httpAction((ctx, request) => serveSite(ctx, components.hosting, request, versionId)),
49
- });
50
-
51
- export default http;
52
- ```
53
-
54
- 4. Deploy once before the first `npx convex dev` push. `convex/http.ts` imports
55
- `.convex-hosting/version.js`, which only a deploy writes, and the deploy's build needs the
56
- deployment's URL, which only `npx convex dev` writes to `.env.local`. So on a fresh clone:
57
-
58
- ```sh
59
- npx convex dev --skip-push # creates your dev deployment and .env.local, no push
60
- npx convex-hosting deploy --dev --build "vite build" --dist dist --not-found-handling single-page-application
61
- npx convex dev # then work as usual
62
- ```
63
-
64
- The `deploy --dev` line builds, uploads, writes `.convex-hosting/version.js`, and pushes. If
65
- `.convex-hosting/` is deleted later, `npx convex dev` fails with
66
- `Could not resolve "../.convex-hosting/version.js"`, and `deploy --dev` fixes it.
67
-
68
- 5. Deploy production, from CI or a terminal:
69
-
70
- ```sh
71
- npx convex-hosting deploy --build "vite build" --dist dist --not-found-handling single-page-application
72
- ```
73
-
74
- An app set up this way: the
75
- [SPA example](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-spa).
76
-
77
- `convex-hosting` keeps its state in `.convex-hosting/` at the project root, next to `convex/`, like
78
- Wrangler's `.wrangler/`. The folder has its own `.gitignore`, so git ignores it. The package
79
- declares the type of `.convex-hosting/version.js`, so the app typechecks without it. A
80
- server-rendered app gets the type of its server build from the framework adapter.
81
-
82
- ## Rules
83
-
84
- - Deploy production and previews with `convex-hosting deploy`, never with a plain
85
- `npx convex deploy`. A plain push sends whatever version `.convex-hosting/version.js` names, the
86
- version of this checkout's last deploy, which is often another deployment's: the site answers 404
87
- until the next `convex-hosting deploy`.
88
- - Do not commit `.convex-hosting/`. It ignores itself.
89
- - Do not change directory in `--build`. The build and the upload run in the project directory.
34
+ ```sh
35
+ npm install @samebase/convex-hosting
36
+ ```
90
37
 
91
- ## Deploy
38
+ `convex/convex.config.ts` mounts the component:
92
39
 
93
- `deploy` runs `npx convex deploy` with your build and the upload of `--dist` as its `--cmd`. The
94
- pushed code names the version it was built with, so the push switches the site. Then the command
95
- prints the site URL, which it asks the deployment for (`CONVEX_SITE_URL`), and ends. The first
96
- request that the new code serves marks its version live, which deletes the versions that were live
97
- before it. A version that never becomes live, from a deploy that failed, is deleted when it is a day
98
- old, with the stored files that no version uses. Nothing is deleted while a site gets no request.
40
+ ```ts
41
+ import { defineApp } from "convex/server";
42
+ import hosting from "@samebase/convex-hosting/convex.config";
99
43
 
100
- `deploy` goes to production. `--preview-name <name>` sends it to that preview (with a login or a
101
- project's preview deploy key; always pass the name with that key), and `--dev` to the development
102
- deployment (see [Development](#development)). A deploy key in `CONVEX_DEPLOY_KEY` or
103
- `CONVEX_DEPLOYMENT_TOKEN` (from the environment or `.env.local`) selects its own deployment instead,
104
- and so does `CONVEX_SELF_HOSTED_URL` for a self-hosted deployment.
44
+ const app = defineApp();
45
+ app.use(hosting);
105
46
 
106
- The first deploy to a deployment pushes the component, then uploads the files. Until that upload
107
- ends, the site answers 404.
47
+ export default app;
48
+ ```
108
49
 
109
- Run one deploy at a time per deployment; the examples'
110
- [deploy workflow](https://github.com/samebase/convex-hosting/blob/main/.github/workflows/deploy-examples.yml)
111
- queues them, with one `concurrency` group per deployment.
50
+ `convex/http.ts` registers the site, every method at every path, as every request reaches a
51
+ Cloudflare Worker:
112
52
 
113
- ## Deploy tools and CI
53
+ ```ts
54
+ import { httpRouter } from "convex/server";
55
+ import { routeAll } from "@samebase/convex-hosting";
56
+ import { components } from "./_generated/api.js";
57
+ import { versionId } from "../.convex-hosting/version.js";
114
58
 
115
- - **The deploy keys** go into repository secrets. Create the production key with the Convex CLI and
116
- hand it to `gh secret set` on standard input, which keeps it off the screen and out of process
117
- arguments:
118
-
119
- ```sh
120
- key=$(npx convex deployment token create "<repository> deploy.yml" --prod) && printf '%s' "$key" | gh secret set CONVEX_DEPLOY_KEY
121
- ```
122
-
123
- The CLI cannot create a project's preview deploy key, so use the management API, with a personal
124
- or team access token from the Convex dashboard in `CONVEX_TOKEN`:
125
-
126
- ```sh
127
- key=$(curl -s -X POST "https://api.convex.dev/v1/projects/<project id>/create_preview_deploy_key" \
128
- -H "Authorization: Bearer $CONVEX_TOKEN" -H "Content-Type: application/json" \
129
- -d '{"name": "<repository> preview.yml"}' | jq -er .previewDeployKey) && printf '%s' "$key" | gh secret set CONVEX_PREVIEW_DEPLOY_KEY
130
- ```
131
-
132
- A failed first command stops before anything is stored.
133
-
134
- - **A tool that runs `convex deploy` itself**, such as Alchemy's `Convex.Code`, has no place for the
135
- upload, which must happen between the build and the push. Run `convex-hosting deploy` in place of
136
- that tool's push step, with the deploy key in `CONVEX_DEPLOY_KEY`.
137
- - **A deploy key limited to some actions** needs `deployment:deploy`,
138
- `deployment:functions:runInternalQueries`, `deployment:functions:runInternalMutations`,
139
- `deployment:functions:runInternalActions` (the upload calls one internal action), and
140
- `deployment:functions:runTestQuery` (the first-install check and the site URL are inline queries).
141
- - **Checks that must stop a release** run before `convex-hosting deploy`, because its push switches
142
- the site. Checks that need the new functions run after it.
143
- - **A re-run of an old workflow run** checks out its old commit, and its push puts older code over
144
- newer code; a `concurrency` group orders runs but does not refuse a stale one. So the examples'
145
- workflows check, right before the deploy, that the commit is still the head of `main`, or of the
146
- pull request for a preview, and fail otherwise.
147
- - **A step that needs the site URL**, such as a preview comment, reads it from the deploy step: when
148
- `GITHUB_OUTPUT` is set, `deploy` appends `url=<site URL>` to it, so give the deploy step an `id`
149
- and read `steps.<id>.outputs.url`.
150
-
151
- ## Your own domain
152
-
153
- A custom domain needs the Convex Pro plan. Add it to the deployment in the dashboard, under
154
- Deployment Settings, Custom Domains, with "HTTP Actions" as the destination, or with the management
155
- API: `POST https://api.convex.dev/v1/deployments/<deployment>/create_custom_domain` with
156
- `{"domain": "<domain>", "requestDestination": "convexSite"}`.
157
-
158
- Then create the two records that the dashboard shows: a `CNAME` from the domain to `convex.domains`,
159
- and a `TXT` record at `_convex_domains.<domain>` whose value is the deployment's name. On
160
- Cloudflare, make the `CNAME` DNS only; Convex documents a proxied record as an
161
- [advanced setup](https://docs.convex.dev/production/abuse-protection). Verification can take up to
162
- 30 minutes.
59
+ const http = httpRouter();
163
60
 
164
- Do not choose the domain under "Override Environment Variables". That changes `CONVEX_SITE_URL`
165
- everywhere in the app, and Convex Auth uses it as the token issuer and in its redirect URLs.
166
-
167
- An apex domain, such as `example.com`, relies on Cloudflare's CNAME flattening and is not tested
168
- yet.
169
-
170
- ## Development
171
-
172
- The inner loop is your framework's dev server, such as Vite's, which serves the frontend locally
173
- with hot reload against the development deployment's URL from `.env.local`, plus `npx convex dev`,
174
- which pushes your function changes. Neither needs a deploy.
175
-
176
- When the development deployment should serve the current build, run the one-shot command:
61
+ routeAll(http, components.hosting, versionId);
177
62
 
178
- ```sh
179
- npx convex-hosting deploy --dev --build "vite build" --dist dist --not-found-handling single-page-application
63
+ export default http;
180
64
  ```
181
65
 
182
- `deploy --dev` goes to the development deployment of this checkout, the one in `.env.local`. It runs
183
- the build itself, uploads `--dist`, writes `.convex-hosting/version.js`, and pushes with
184
- `npx convex run --push`, which works whether or not `npx convex dev` runs. The build runs with your
185
- environment, so the framework reads the deployment's URL from `.env.local` (Vite reads
186
- `VITE_CONVEX_URL`). Against an anonymous local deployment, `deploy --dev` needs `npx convex dev`
187
- running, because without it every Convex CLI call starts and stops its own backend and the upload's
188
- requests find nothing; cloud development deployments do not have this constraint. There is no watch
189
- mode: a build, an upload, and a push per change is not an inner loop, and Cloudflare's own tooling
190
- works the same way, with a local dev server and a push on demand.
191
-
192
- Two cases are transient:
193
-
194
- - A server-rendered app imports its server build in `convex/http.ts`, so a running `npx convex dev`
195
- pushes after the build, before `deploy --dev` writes the new version. Until `deploy --dev` ends,
196
- the new pages refer to files that answer 404.
197
- - A production deploy writes production's version to the version file, and a running
198
- `npx convex dev` pushes it to the development deployment, where that version does not exist, until
199
- the next `deploy --dev`. Run production deploys in CI or in a separate checkout.
200
-
201
- ## Options
202
-
203
- | Option | Values |
204
- | ------------------------------ | -------------------------------------------------------------------------------------- |
205
- | `--dev` | The development deployment of this checkout, instead of production |
206
- | `--preview-name <name>` | The preview deployment with this name, instead of production |
207
- | `--html-handling <value>` | `auto-trailing-slash` (default), `force-trailing-slash`, `drop-trailing-slash`, `none` |
208
- | `--not-found-handling <value>` | `none` (default), `single-page-application`, `404-page` |
209
- | `--component <name>` | The component instance, `hosting` by default |
210
-
211
- The two handling options work as
212
- [Cloudflare documents them](https://developers.cloudflare.com/workers/static-assets/routing/).
213
-
214
- Each file of `--dist` must be 25 MiB or smaller, and the CLI names a file that is larger. This is
215
- Cloudflare's limit per asset, and the HTTP action that serves a file cannot answer more than
216
- Convex's 100 MiB response limit anyway.
217
-
218
- ## `_headers`, `_redirects`, and `.assetsignore`
219
-
220
- Put them at the root of `--dist`, as for Cloudflare:
221
- [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/),
222
- [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/), and
223
- [`.assetsignore`](https://developers.cloudflare.com/workers/static-assets/binding/#ignoring-assets).
224
- For a Vite app, put them in `public/`, which Vite copies into `dist/`. They are not served. Symbolic
225
- links in `--dist` are followed, as Wrangler follows them, also when they point outside the folder; a
226
- link to nothing, or to a folder that contains it, is skipped with a message, and a link to another
227
- folder in `--dist` uploads its files under both paths. `.assetsignore` excludes what a link should
228
- not publish.
229
-
230
- Every asset has `Cache-Control: public, max-age=0, must-revalidate` and an `ETag`. To cache hashed
231
- files for a year, add a `_headers` rule:
66
+ Deploy:
232
67
 
68
+ ```sh
69
+ npx convex-hosting deploy --build "vite build" --dist dist --not-found-handling single-page-application
233
70
  ```
234
- /assets/*
235
- Cache-Control: public, max-age=31536000, immutable
236
- ```
237
-
238
- ## Routing
239
-
240
- `serveSite` answers with the file that matches, else with the page that `render` returns (see
241
- [Server-rendered pages](#server-rendered-pages)), else 404. `render` is the code that runs on a
242
- miss, with the request in its closure. Everything it returns gets `Cache-Control: no-store`, and so
243
- does a 404, because the `*.convex.site` front caches paths with an extension. The front keeps
244
- `no-store` for a path without an extension and replaces it with a four-hour browser `max-age` for a
245
- path with one, so a browser that asks for a script before its upload ended keeps the 404; the deploy
246
- order prevents that case, because no page refers to a file that is not uploaded yet. When the
247
- version does not exist or is still uploading, it answers 404 naming the version. At the first
248
- request for a new version, it marks the version live.
249
-
250
- As on Cloudflare, the presence of code decides where `not_found_handling` (the single-page fallback
251
- or the 404 page) applies:
252
-
253
- - Without `render`, the site is files only, like a Worker without a script: `not_found_handling`
254
- applies to every request. `curl`, uptime monitors, and link-preview bots get what a browser gets.
255
- - With `render`, your code is the Worker: `not_found_handling` applies to navigation requests
256
- (`Sec-Fetch-Mode: navigate`) only, and other requests that match no file reach your code. Browsers
257
- send that header whenever they open a page. `curl`, `fetch` in scripts and tests, uptime monitors,
258
- and link-preview bots do not. To test a deep link as a browser opens it, send the header:
259
- `curl -H "Sec-Fetch-Mode: navigate"`, or `node:http` in Node, whose `fetch` refuses to set it.
260
71
 
261
- On a files-only single-page app, a missing hashed file such as `/assets/old.js` gets the shell, with
262
- 200 and `text/html`, as on Cloudflare. A `_headers` rule for its path applies to it too, so with the
263
- one-year rule above a browser keeps that HTML for a year; without a rule, the deployment's
264
- Cloudflare front gives a path with an extension a four-hour browser `max-age`. Hashed names do not
265
- come back.
72
+ It builds, uploads `dist`, pushes the functions, and prints
73
+ `Deployed version <id> to https://<deployment>.convex.site.` Deploy production with this command,
74
+ never with a plain `npx convex deploy`: a plain push uploads no files, and the site answers 404
75
+ until the next `convex-hosting deploy`.
266
76
 
267
- One difference from Cloudflare follows from Convex's router: an exact route in `convex/http.ts` wins
268
- over an asset at the same path.
77
+ On a fresh clone, `npx convex dev` fails until the first deploy: `convex/http.ts` imports
78
+ `.convex-hosting/version.js`, which only a deploy writes, and the deploy's build needs the
79
+ deployment URL, which only `npx convex dev` writes to `.env.local`. So the first time:
269
80
 
270
- ## Open tabs after a deploy
271
-
272
- A page opened before a deploy keeps asking for its hashed files, which the new version does not
273
- have, as on Cloudflare: they answer 404, or the shell on a files-only single-page app. To reload
274
- open tabs on a new version, add a query that returns the bundled version:
275
-
276
- ```ts
277
- // convex/siteVersion.ts
278
- import { v } from "convex/values";
279
- import { query } from "./_generated/server.js";
280
- import { versionId } from "../.convex-hosting/version.js";
281
-
282
- export const get = query({ args: {}, returns: v.string(), handler: () => versionId });
283
- ```
284
-
285
- and reload when its value changes after the first one:
286
-
287
- ```tsx
288
- import { useQuery } from "convex/react";
289
- import { useEffect, useRef } from "react";
290
- import { api } from "../convex/_generated/api";
291
-
292
- export function useReloadOnNewVersion() {
293
- const versionId = useQuery(api.siteVersion.get);
294
- const first = useRef<string | undefined>(undefined);
295
- useEffect(() => {
296
- if (versionId === undefined) return;
297
- first.current ??= versionId;
298
- if (versionId !== first.current) location.reload();
299
- }, [versionId]);
300
- }
81
+ ```sh
82
+ npx convex dev --skip-push # creates your dev deployment and .env.local, no push
83
+ npx convex-hosting deploy --dev --build "vite build" --dist dist --not-found-handling single-page-application
84
+ npx convex dev # then work as usual
301
85
  ```
302
86
 
303
- ## Server-rendered pages
304
-
305
- `serveSite` takes a fifth argument, `render`, a function that returns the page's response, and calls
306
- it when no file matches. `convex/http.ts` imports the server build directly, such as
307
- `../dist/server/server.js` for TanStack Start, so `npx convex dev` bundles it only after a build: on
308
- a fresh clone, the first `deploy --dev` builds before the first push (see [Setup](#setup)).
309
- [`@samebase/convex-hosting-tanstack-start`](https://github.com/samebase/convex-hosting/tree/main/packages/convex-hosting-tanstack-start)
310
- renders TanStack Start pages in it. See the
311
- [TanStack Start example](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-ssr),
312
- live at [gallant-llama-40.convex.site](https://gallant-llama-40.convex.site).
87
+ For pages rendered on the server, pass the app's server entry, the object with `fetch(request)`, as
88
+ the fourth argument of `routeAll`. The
89
+ [adapter](https://github.com/samebase/convex-hosting/tree/main/packages/convex-hosting-tanstack-start)
90
+ shows it for TanStack Start.
91
+
92
+ ## How a deploy switches the site
93
+
94
+ On Cloudflare, `wrangler deploy` uploads the files and the Worker code as one version, so the switch
95
+ is atomic. Here two systems hold the two halves: the component's storage holds the files, and
96
+ `npx convex deploy` pushes the code. `deploy` binds them the same way. It uploads the files as a new
97
+ version, writes that version's id to `.convex-hosting/version.js`, and then pushes the code, which
98
+ imports the file and asks the component for exactly that version. The push is the switch: no pointer
99
+ moves in a second step, so there is no moment when new code serves old files, and no page refers to
100
+ a file that is not uploaded yet. The first request the new code serves marks its version live and
101
+ deletes the versions that were live before it. A version whose push never came is deleted at a later
102
+ switch, once it is a day old; nothing is deleted by the clock alone. The one rule: run one deploy at
103
+ a time per deployment. The
104
+ [design](https://github.com/samebase/convex-hosting/blob/main/docs/design.md#orderings-and-timing)
105
+ works through every interleaving.
106
+
107
+ ## Examples
108
+
109
+ - [tanstack-spa](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-spa): a
110
+ single-page app, live at [quick-fish-630.convex.site](https://quick-fish-630.convex.site).
111
+ - [tanstack-ssr](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-ssr): pages
112
+ rendered per request, with cookie sessions, live at
113
+ [gallant-llama-40.convex.site](https://gallant-llama-40.convex.site). Its
114
+ [Worker twin](https://github.com/samebase/convex-hosting/tree/main/examples/tanstack-ssr-workers)
115
+ is live at
116
+ [convex-hosting-tanstack-ssr-workers.pfp.workers.dev](https://convex-hosting-tanstack-ssr-workers.pfp.workers.dev).
117
+
118
+ ## Documentation
119
+
120
+ - [Deploy](https://github.com/samebase/convex-hosting/blob/main/docs/deploy.md): what `deploy` does,
121
+ previews, deploy keys, CI, and the options.
122
+ - [Development](https://github.com/samebase/convex-hosting/blob/main/docs/development.md): the inner
123
+ loop, `deploy --dev`, and reloading open tabs after a deploy.
124
+ - [Serving](https://github.com/samebase/convex-hosting/blob/main/docs/serving.md): `_headers`,
125
+ `_redirects`, `.assetsignore`, caching, routing, and server-rendered pages.
126
+ - [Your own domain](https://github.com/samebase/convex-hosting/blob/main/docs/domains.md).
127
+ - [What differs from a Worker](https://github.com/samebase/convex-hosting/blob/main/docs/workers.md),
128
+ and the same app deployed as one.
129
+ - [Design](https://github.com/samebase/convex-hosting/blob/main/docs/design.md): why each piece is
130
+ what it is.
131
+ - [Changelog](https://github.com/samebase/convex-hosting/blob/main/packages/convex-hosting/CHANGELOG.md).
132
+
133
+ ## Status
134
+
135
+ Version 0.9, before 1.0: a minor release can change the API, and the changelog says what changed.
136
+ The author's apps run on it, among them [Scout](https://github.com/samebase/scout) and
137
+ [chessmerge.com](https://chessmerge.com).
313
138
 
314
139
  ## License
315
140
 
package/dist/cli/files.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { existsSync, readdirSync, readFileSync, realpathSync, statSync } from "node:fs";
3
3
  import { join, relative } from "node:path";
4
- import { constructHeaders, constructRedirects, } from "../workers-shared/utils/configuration/constructConfiguration.js";
5
- import { parseHeaders } from "../workers-shared/utils/configuration/parseHeaders.js";
6
- import { parseRedirects } from "../workers-shared/utils/configuration/parseRedirects.js";
7
- import { HEADERS_FILENAME, MAX_ASSET_SIZE, REDIRECTS_FILENAME, } from "../workers-shared/utils/constants.js";
8
- import { createAssetsIgnoreFunction, getContentType, maybeGetFile, normalizeFilePath, } from "../workers-shared/utils/helpers.js";
4
+ import { constructHeaders, constructRedirects, } from "../workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.js";
5
+ import { parseHeaders } from "../workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.js";
6
+ import { parseRedirects } from "../workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.js";
7
+ import { HEADERS_FILENAME, MAX_ASSET_SIZE, REDIRECTS_FILENAME, } from "../workers-sdk/packages/workers-shared/utils/constants.js";
8
+ import { createAssetsIgnoreFunction, getContentType, maybeGetFile, normalizeFilePath, } from "../workers-sdk/packages/workers-shared/utils/helpers.js";
9
9
  /**
10
10
  * Convex limits a document to 1 MiB. The version document holds the config next to two short
11
11
  * fields, and the encoding needs room too.
@@ -1 +1 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/cli/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,sCAA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from "node:util";
6
6
  import { z } from "zod";
7
7
  import { internal } from "../component/_generated/api.js";
8
- import { AssetConfigSchema } from "../workers-shared/utils/types.js";
8
+ import { AssetConfigSchema } from "../workers-sdk/packages/workers-shared/utils/types.js";
9
9
  import { deploymentSelector, probeComponent, runComponent, siteUrl, } from "./convex.js";
10
10
  import { readDist } from "./files.js";
11
11
  const USAGE = `Usage:
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,OAAO,GAIR,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAwC,MAAM,YAAY,CAAC;AAE5E,MAAM,KAAK,GAAG;;;;;;;;;;;;0CAY4B,CAAC;AAE3C;;;GAGG;AACH,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,oBAAoB,GAAG,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAE9D,sDAAsD;AACtD,MAAM,kBAAk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AS,CAAC;AACzF,CAAC;AAED;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAiB,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;AAEvF,SAAS,aAAa,CAAI,KAAU;IAClC,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,IAAI,KAAK,GAAQ,EAAE,CAAC;IACpB,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QACnD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,UAAU,GAAG,mBAAmB,EAAE,CAAC;YAClE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,KAAK,GAAG,EAAE,CAAC;YACX,MAAM,GAAG,CAAC,CAAC;QACb,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,MAAM,IAAI,UAAU,CAAC;IACvB,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,15 +1,14 @@
1
- import type { GenericActionCtx, GenericDataModel } from "convex/server";
1
+ import { type HttpRouter, type PublicHttpAction } from "convex/server";
2
2
  import type { ComponentApi } from "../component/_generated/component.js";
3
3
  /**
4
- * Answers `request` with the file of version `versionId`, else with the page that `render`
5
- * returns, else 404. `render` is the Worker script: the code that runs on a miss, with the request
6
- * in its closure. As on Cloudflare, the presence of code decides how `not_found_handling` applies:
7
- * with `render`, it applies to navigations only and `render` answers the other misses; without
8
- * `render`, the site is files only, so it applies to every request.
4
+ * Routes the site on the app's router: `serveSite`'s action for every method Convex routes, at
5
+ * every path, as every request reaches a Cloudflare Worker with static assets. Convex answers HEAD
6
+ * through GET.
9
7
  *
10
- * A page and a 404 answer `Cache-Control: no-store`. The deployment's Cloudflare front keeps that
11
- * for a path without an extension and replaces it with a four-hour browser `max-age` for a path
12
- * with one, so a browser that asks for a script before its upload ended keeps the 404; the deploy
13
- * order prevents that case, because no page refers to a file that is not uploaded yet.
8
+ * Returns the action, for the paths that a component's HTTP prefix would otherwise take: Convex
9
+ * picks an exact route first, then the longest prefix, so an app whose session routes sit under a
10
+ * component's prefix registers them with `http.route({ path, method, handler })`.
14
11
  */
15
- export declare function serveSite(ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, component: ComponentApi, request: Request, versionId: string, render?: () => Promise<Response>): Promise<Response>;
12
+ export declare function routeAll(http: HttpRouter, component: ComponentApi, versionId: string, worker?: {
13
+ fetch(request: Request): Promise<Response>;
14
+ }): PublicHttpAction;