@samebase/convex-hosting 0.3.2 → 0.4.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/CHANGELOG.md +10 -134
- package/README.md +136 -398
- package/dist/cli/convex.d.ts +63 -0
- package/dist/cli/convex.js +108 -0
- package/dist/cli/convex.js.map +1 -0
- package/dist/cli/files.d.ts +18 -0
- package/dist/cli/files.js +106 -0
- package/dist/cli/files.js.map +1 -0
- package/dist/cli/index.d.ts +1 -11
- package/dist/cli/index.js +3 -58
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.js +346 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/client/index.d.ts +8 -115
- package/dist/client/index.js +65 -242
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +5 -0
- package/dist/client/version-module.d.ts +6 -0
- package/dist/component/_generated/api.d.ts +0 -5
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +20 -18
- package/dist/component/_generated/dataModel.d.ts +0 -1
- package/dist/component/_generated/server.d.ts +12 -1
- package/dist/component/_generated/server.js +2 -0
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/convex.config.d.ts +0 -1
- package/dist/component/lib.d.ts +175 -156
- package/dist/component/lib.js +396 -710
- package/dist/component/lib.js.map +1 -1
- package/dist/component/schema.d.ts +76 -72
- package/dist/component/schema.js +35 -59
- package/dist/component/schema.js.map +1 -1
- package/dist/workers-shared/asset-worker/src/analytics.d.ts +39 -0
- package/dist/workers-shared/asset-worker/src/analytics.js +86 -0
- package/dist/workers-shared/asset-worker/src/analytics.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/compatibility-flags.d.ts +19 -0
- package/dist/workers-shared/asset-worker/src/compatibility-flags.js +29 -0
- package/dist/workers-shared/asset-worker/src/compatibility-flags.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/configuration.d.ts +3 -0
- package/dist/workers-shared/asset-worker/src/configuration.js +30 -0
- package/dist/workers-shared/asset-worker/src/configuration.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/constants.d.ts +1 -0
- package/dist/workers-shared/asset-worker/src/constants.js +3 -0
- package/dist/workers-shared/asset-worker/src/constants.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/handler.d.ts +28 -0
- package/dist/workers-shared/asset-worker/src/handler.js +717 -0
- package/dist/workers-shared/asset-worker/src/handler.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/types.d.ts +13 -0
- package/dist/workers-shared/asset-worker/src/types.js +2 -0
- package/dist/workers-shared/asset-worker/src/types.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/utils/base-path.d.ts +29 -0
- package/dist/workers-shared/asset-worker/src/utils/base-path.js +56 -0
- package/dist/workers-shared/asset-worker/src/utils/base-path.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/utils/headers.d.ts +11 -0
- package/dist/workers-shared/asset-worker/src/utils/headers.js +77 -0
- package/dist/workers-shared/asset-worker/src/utils/headers.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/utils/rules-engine.d.ts +23 -0
- package/dist/workers-shared/asset-worker/src/utils/rules-engine.js +133 -0
- package/dist/workers-shared/asset-worker/src/utils/rules-engine.js.map +1 -0
- package/dist/workers-shared/asset-worker/src/worker.d.ts +14 -0
- package/dist/workers-shared/asset-worker/src/worker.js +12 -0
- package/dist/workers-shared/asset-worker/src/worker.js.map +1 -0
- package/dist/workers-shared/utils/base-path.d.ts +32 -0
- package/dist/workers-shared/utils/base-path.js +94 -0
- package/dist/workers-shared/utils/base-path.js.map +1 -0
- package/dist/workers-shared/utils/configuration/constants.d.ts +15 -0
- package/dist/workers-shared/utils/configuration/constants.js +16 -0
- package/dist/workers-shared/utils/configuration/constants.js.map +1 -0
- package/dist/workers-shared/utils/configuration/constructConfiguration.d.ts +12 -0
- package/dist/workers-shared/utils/configuration/constructConfiguration.js +103 -0
- package/dist/workers-shared/utils/configuration/constructConfiguration.js.map +1 -0
- package/dist/workers-shared/utils/configuration/parseHeaders.d.ts +5 -0
- package/dist/workers-shared/utils/configuration/parseHeaders.js +181 -0
- package/dist/workers-shared/utils/configuration/parseHeaders.js.map +1 -0
- package/dist/workers-shared/utils/configuration/parseRedirects.d.ts +8 -0
- package/dist/workers-shared/utils/configuration/parseRedirects.js +129 -0
- package/dist/workers-shared/utils/configuration/parseRedirects.js.map +1 -0
- package/dist/workers-shared/utils/configuration/parseStaticRouting.d.ts +2 -0
- package/dist/workers-shared/utils/configuration/parseStaticRouting.js +94 -0
- package/dist/workers-shared/utils/configuration/parseStaticRouting.js.map +1 -0
- package/dist/workers-shared/utils/configuration/types.d.ts +38 -0
- package/dist/workers-shared/utils/configuration/types.js +2 -0
- package/dist/workers-shared/utils/configuration/types.js.map +1 -0
- package/dist/workers-shared/utils/configuration/validateURL.d.ts +3 -0
- package/dist/workers-shared/utils/configuration/validateURL.js +56 -0
- package/dist/workers-shared/utils/configuration/validateURL.js.map +1 -0
- package/dist/workers-shared/utils/constants.d.ts +28 -0
- package/dist/workers-shared/utils/constants.js +34 -0
- package/dist/workers-shared/utils/constants.js.map +1 -0
- package/dist/workers-shared/utils/helpers.d.ts +22 -0
- package/dist/workers-shared/utils/helpers.js +73 -0
- package/dist/workers-shared/utils/helpers.js.map +1 -0
- package/dist/workers-shared/utils/responses.d.ts +43 -0
- package/dist/workers-shared/utils/responses.js +125 -0
- package/dist/workers-shared/utils/responses.js.map +1 -0
- package/dist/workers-shared/utils/tracing.d.ts +3 -0
- package/dist/workers-shared/utils/tracing.js +29 -0
- package/dist/workers-shared/utils/tracing.js.map +1 -0
- package/dist/workers-shared/utils/types.d.ts +131 -0
- package/dist/workers-shared/utils/types.js +72 -0
- package/dist/workers-shared/utils/types.js.map +1 -0
- package/package.json +16 -32
- package/INTEGRATION.md +0 -399
- package/dist/cli/args.d.ts +0 -28
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -148
- package/dist/cli/args.js.map +0 -1
- package/dist/cli/argumentChunks.d.ts +0 -3
- package/dist/cli/argumentChunks.d.ts.map +0 -1
- package/dist/cli/argumentChunks.js +0 -29
- package/dist/cli/argumentChunks.js.map +0 -1
- package/dist/cli/collectFiles.d.ts +0 -10
- package/dist/cli/collectFiles.d.ts.map +0 -1
- package/dist/cli/collectFiles.js +0 -53
- package/dist/cli/collectFiles.js.map +0 -1
- package/dist/cli/commands.d.ts +0 -8
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js +0 -56
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/componentName.d.ts +0 -32
- package/dist/cli/componentName.d.ts.map +0 -1
- package/dist/cli/componentName.js +0 -43
- package/dist/cli/componentName.js.map +0 -1
- package/dist/cli/deploy.d.ts +0 -16
- package/dist/cli/deploy.d.ts.map +0 -1
- package/dist/cli/deploy.js +0 -283
- package/dist/cli/deploy.js.map +0 -1
- package/dist/cli/deployEnvironment.d.ts +0 -10
- package/dist/cli/deployEnvironment.d.ts.map +0 -1
- package/dist/cli/deployEnvironment.js +0 -12
- package/dist/cli/deployEnvironment.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/upload.d.ts +0 -22
- package/dist/cli/upload.d.ts.map +0 -1
- package/dist/cli/upload.js +0 -630
- package/dist/cli/upload.js.map +0 -1
- package/dist/client/_generated/_ignore.d.ts +0 -1
- package/dist/client/_generated/_ignore.d.ts.map +0 -1
- package/dist/client/_generated/_ignore.js +0 -3
- package/dist/client/_generated/_ignore.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/component/_generated/api.d.ts.map +0 -1
- package/dist/component/_generated/component.d.ts.map +0 -1
- package/dist/component/_generated/dataModel.d.ts.map +0 -1
- package/dist/component/_generated/server.d.ts.map +0 -1
- package/dist/component/convex.config.d.ts.map +0 -1
- package/dist/component/http.d.ts +0 -4
- package/dist/component/http.d.ts.map +0 -1
- package/dist/component/http.js +0 -113
- package/dist/component/http.js.map +0 -1
- package/dist/component/lib.d.ts.map +0 -1
- package/dist/component/schema.d.ts.map +0 -1
- package/dist/component/serving.d.ts +0 -23
- package/dist/component/serving.d.ts.map +0 -1
- package/dist/component/serving.js +0 -161
- package/dist/component/serving.js.map +0 -1
- package/dist/react/index.d.ts +0 -59
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -137
- package/dist/react/index.js.map +0 -1
- package/src/cli/args.test.ts +0 -79
- package/src/cli/args.ts +0 -153
- package/src/cli/argumentChunks.test.ts +0 -27
- package/src/cli/argumentChunks.ts +0 -40
- package/src/cli/collectFiles.test.ts +0 -26
- package/src/cli/collectFiles.ts +0 -59
- package/src/cli/commands.ts +0 -68
- package/src/cli/componentName.test.ts +0 -41
- package/src/cli/componentName.ts +0 -46
- package/src/cli/deploy.ts +0 -336
- package/src/cli/deployEnvironment.test.ts +0 -27
- package/src/cli/deployEnvironment.ts +0 -17
- package/src/cli/index.ts +0 -65
- package/src/cli/upload.ts +0 -837
- package/src/client/_generated/_ignore.ts +0 -1
- package/src/client/index.test.ts +0 -549
- package/src/client/index.ts +0 -344
- package/src/client/setup.test.ts +0 -22
- package/src/component/_generated/api.ts +0 -54
- package/src/component/_generated/component.ts +0 -55
- package/src/component/_generated/dataModel.ts +0 -60
- package/src/component/_generated/server.ts +0 -156
- package/src/component/convex.config.ts +0 -3
- package/src/component/http.test.ts +0 -254
- package/src/component/http.ts +0 -133
- package/src/component/lib.test.ts +0 -1007
- package/src/component/lib.ts +0 -862
- package/src/component/schema.ts +0 -75
- package/src/component/serving.ts +0 -170
- package/src/component/setup.test.ts +0 -11
- package/src/react/index.tsx +0 -197
- package/src/test.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,139 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.4.0
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for a missing script for hours, even after the file was uploaded.
|
|
5
|
+
A new install. 0.4 does not read the data of 0.3.x and has no migration: delete the tables of the
|
|
6
|
+
old component by hand, then set up the app as the README says.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
- One command, `convex-hosting deploy`, for production, a preview (`--preview-name <name>`), and the
|
|
9
|
+
development deployment (`--dev`). The push switches the site.
|
|
10
|
+
- Cloudflare's asset handler serves the files, with `_headers`, `_redirects`, `.assetsignore`,
|
|
11
|
+
`html_handling`, and `not_found_handling`.
|
|
12
|
+
- The first request that new code serves marks its version live and deletes the versions live before
|
|
13
|
+
it. A version that never becomes live is deleted when it is a day old.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
Cloudflare and Netlify read these files as hosting rules. Before this change the site served them
|
|
13
|
-
as public files.
|
|
14
|
-
|
|
15
|
-
## 0.3.0
|
|
16
|
-
|
|
17
|
-
First release as `@samebase/convex-hosting`, Samebase's fork of `@convex-dev/static-hosting`. See
|
|
18
|
-
"Switching from @convex-dev/static-hosting" in the README.
|
|
19
|
-
|
|
20
|
-
- The package, the CLI command (`convex-hosting`), the component (`hosting`), the default deployment
|
|
21
|
-
query module (`convex/hosting.ts`), and the `CONVEX_HOSTING_BASE_PATH` build variable share one
|
|
22
|
-
name. The CLI still finds an instance named `staticHosting`.
|
|
23
|
-
- `serveStaticAsset` serves one uploaded file from your own HTTP route, for custom routing and
|
|
24
|
-
server rendering.
|
|
25
|
-
- `upload --preview-name` uploads to a named preview deployment.
|
|
26
|
-
- Replaced files stay available for at least seven days, so pages that are already open can still
|
|
27
|
-
load their scripts.
|
|
28
|
-
- The `setup` and `init` commands are removed. The README describes the setup steps.
|
|
29
|
-
|
|
30
|
-
Versions up to 0.2.1 were released as `@convex-dev/static-hosting`.
|
|
31
|
-
|
|
32
|
-
## 0.2.1
|
|
33
|
-
|
|
34
|
-
- Smoother migration story, with more automatic fallbacks to the old component name.
|
|
35
|
-
|
|
36
|
-
## 0.2.0
|
|
37
|
-
|
|
38
|
-
Component-owned HTTP and storage.
|
|
39
|
-
|
|
40
|
-
**Breaking — redeploy your static assets after upgrading.**
|
|
41
|
-
|
|
42
|
-
See the [0.1.x to 0.2.x migration guide](./MIGRATION.md) before upgrading an existing deployment.
|
|
43
|
-
|
|
44
|
-
- The component now hosts its own HTTP endpoints and owns the file storage that serves them. Wire it
|
|
45
|
-
up with `app.use(staticHosting, { httpPrefix: "/" })` and delete related code in`convex/http.ts` +
|
|
46
|
-
the upload-API re-exports from `convex/staticHosting.ts`.
|
|
47
|
-
- Removed `exposeUploadApi` from the client API. Uploads and file lifecycle are now handled by
|
|
48
|
-
private component functions.
|
|
49
|
-
- `registerStaticRoutes` remains as a compatibility mode for apps that need to keep existing auth,
|
|
50
|
-
webhook, or API routes at the root. It serves the new component-owned files from the app's
|
|
51
|
-
existing `convex/http.ts` catch-all. During a same-name v1→v2 migration it also serves inherited
|
|
52
|
-
v1 files straight from the app's own storage, so the live site stays up with no re-upload gap.
|
|
53
|
-
Mounting the component's own handler is still the faster default.
|
|
54
|
-
- `exposeDeploymentQuery` and `getConvexUrl` remain if you use the UpdateBanner.
|
|
55
|
-
- The component is now named `staticHosting` (previously `selfHosting`). The CLI invokes it directly
|
|
56
|
-
via `npx convex run --component staticHosting lib:...`. If you mount the component under a
|
|
57
|
-
different name, pass `--component <your-name>`. For a smooth upgrade, pass {name: "selfHosting} to
|
|
58
|
-
`app.use(staticHosting, { name: "selfHosting" })`
|
|
59
|
-
- `useDeploymentUpdates` / `UpdateBanner` use `useQuery_experimental` and default to
|
|
60
|
-
`api.staticHosting.getCurrentDeployment`. If you don't surface deployment updates, you no longer
|
|
61
|
-
need to expose anything.
|
|
62
|
-
- Assets uploaded under 0.1.x lived in the app's storage — the component-owned HTTP handler can't
|
|
63
|
-
resolve those references in 0.2.x. Run `npx @convex-dev/static-hosting deploy` to repopulate. (In
|
|
64
|
-
app-owned root routing the app-side handler keeps serving those v1 files from app storage until
|
|
65
|
-
the first upload replaces them, so that mode has no asset-less window.) The first 0.2.x upload
|
|
66
|
-
safely discards those legacy storage references instead of trying to delete them from component
|
|
67
|
-
storage. The old blobs remain in app storage until you explicitly clean them up after the rollback
|
|
68
|
-
window. Older 0.1.x deploys may also have left historical blobs that the current asset manifest no
|
|
69
|
-
longer lists, so follow the migration guide's app-storage audit before cleanup.
|
|
70
|
-
- Default setup prefixes your own HTTP routes with `defineApp({ httpPrefix: "/api" })` so the static
|
|
71
|
-
site can own the root without the catch-all route shadowing them. Use `registerStaticRoutes` when
|
|
72
|
-
those existing root route URLs cannot move.
|
|
73
|
-
- SPA fallback is now configurable per deployment. Deploy with `--no-spa` (`deploy` or `upload`) to
|
|
74
|
-
make extension-less misses return 404 instead of `index.html`. The setting is stored on the
|
|
75
|
-
deployment record, so it travels with the code you ship.
|
|
76
|
-
- Hashed-asset caching recognizes Vite's base64url hashes (including `-`) and numeric extensions
|
|
77
|
-
such as `.woff2`. HTML always uses revalidation, even if its filename looks content-hashed.
|
|
78
|
-
- The `cdnBaseUrl` override remains available in `registerStaticRoutes` compatibility mode.
|
|
79
|
-
Component-owned HTTP routes redirect CDN blobs to the deployment's own `{origin}/fs/blobs`.
|
|
80
|
-
- `--cdn` is now documented as a legacy option. Its setup guide targeted an old unauthenticated
|
|
81
|
-
convex-fs API and does not work with current ConvexFS. New integrations should use Convex storage
|
|
82
|
-
until authenticated CDN uploads are designed.
|
|
83
|
-
- Storage and legacy CDN assets, deployment settings, and old-file cleanup are published in one
|
|
84
|
-
atomic mutation after all uploads finish. New HTML cannot race ahead of its referenced asset
|
|
85
|
-
records, and a failed publish leaves the previous deployment live. Replaced CDN blob IDs are
|
|
86
|
-
retained for cleanup.
|
|
87
|
-
- Upload errors now report the failing file and HTTP status. Oversized manifests fail with a clear
|
|
88
|
-
size error, and newly uploaded component files are removed after a failed upload or publish.
|
|
89
|
-
- Static handlers decode percent-encoded paths, accept weak or listed ETags, and return a
|
|
90
|
-
non-cacheable HTTP 503 setup page until the first upload succeeds.
|
|
91
|
-
- Removed the install-time console banner.
|
|
92
|
-
|
|
93
|
-
## 0.1.5
|
|
94
|
-
|
|
95
|
-
- Forward-compatibility for 0.2.x rollbacks. The `deploymentInfo` schema and the
|
|
96
|
-
`getCurrentDeployment` return validator now allow the optional `spaFallback` (boolean) and
|
|
97
|
-
`pendingBlobCleanupCount` (number) fields that 0.2.x writes to the deployment record. 0.1.5
|
|
98
|
-
ignores them, but allowing them means a deployment upgraded to 0.2.x and later rolled back to
|
|
99
|
-
0.1.x keeps validating. No behavior change for 0.1.x users; upgrade to 0.1.5 before trying 0.2.x
|
|
100
|
-
if you want a clean rollback path. (0.2.x also creates additional tables such as `stagedAssets`
|
|
101
|
-
and `cleanupState`; extra tables don't fail 0.1.x schema validation, so they need no entry here.)
|
|
102
|
-
|
|
103
|
-
## 0.1.4
|
|
104
|
-
|
|
105
|
-
- Added support for Windows
|
|
106
|
-
|
|
107
|
-
## 0.1.3
|
|
108
|
-
|
|
109
|
-
- Fix missing README in published package
|
|
110
|
-
|
|
111
|
-
## 0.1.2
|
|
112
|
-
|
|
113
|
-
- Rename package from `@convex-dev/self-hosting` to `@convex-dev/static-hosting`
|
|
114
|
-
|
|
115
|
-
## 0.1.1-alpha.0
|
|
116
|
-
|
|
117
|
-
- Add optional convex-fs CDN mode for static asset serving (`--cdn` flag)
|
|
118
|
-
- Non-HTML assets can be served from CDN edge network via convex-fs
|
|
119
|
-
- New `cdnBaseUrl` option on `registerStaticRoutes`
|
|
120
|
-
- Schema: `storageId` now optional, new `blobId` field for CDN assets
|
|
121
|
-
- `gcOldAssets` returns `{ deleted, blobIds }` (breaking change from number return)
|
|
122
|
-
|
|
123
|
-
## 0.1.2-alpha.1
|
|
124
|
-
|
|
125
|
-
removed cloudflare for now.
|
|
126
|
-
|
|
127
|
-
## 0.1.1
|
|
128
|
-
|
|
129
|
-
- Setup wizard now configures custom domains for Cloudflare Workers
|
|
130
|
-
- Added note about running `convex dev` for HTTP actions error
|
|
131
|
-
- Added documentation for non-Vite bundlers (Expo, Next.js)
|
|
132
|
-
|
|
133
|
-
## 0.1.0
|
|
134
|
-
|
|
135
|
-
- Migrated from Cloudflare Pages to Workers Static Assets
|
|
136
|
-
|
|
137
|
-
## 0.0.0
|
|
138
|
-
|
|
139
|
-
- Initial release.
|
|
15
|
+
Earlier versions: see the [release history](https://github.com/samebase/convex-hosting/releases).
|