@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samebase/convex-hosting",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A Convex component that hosts a web app: static files, with optional server rendering.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -22,60 +22,44 @@
|
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
|
-
"src",
|
|
26
25
|
"CHANGELOG.md",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
26
|
+
"NOTICE",
|
|
27
|
+
"README.md"
|
|
29
28
|
],
|
|
30
29
|
"type": "module",
|
|
31
|
-
"
|
|
32
|
-
"types": "./dist/client/index.d.ts",
|
|
30
|
+
"types": "./dist/client/types.d.ts",
|
|
33
31
|
"exports": {
|
|
34
|
-
"./package.json": "./package.json",
|
|
35
32
|
".": {
|
|
36
|
-
"types": "./dist/client/
|
|
33
|
+
"types": "./dist/client/types.d.ts",
|
|
37
34
|
"default": "./dist/client/index.js"
|
|
38
35
|
},
|
|
39
|
-
"./react": {
|
|
40
|
-
"types": "./dist/react/index.d.ts",
|
|
41
|
-
"default": "./dist/react/index.js"
|
|
42
|
-
},
|
|
43
|
-
"./test": "./src/test.ts",
|
|
44
|
-
"./_generated/component.js": {
|
|
45
|
-
"types": "./dist/component/_generated/component.d.ts"
|
|
46
|
-
},
|
|
47
|
-
"./_generated/component": {
|
|
48
|
-
"types": "./dist/component/_generated/component.d.ts"
|
|
49
|
-
},
|
|
50
|
-
"./convex.config.js": {
|
|
51
|
-
"types": "./dist/component/convex.config.d.ts",
|
|
52
|
-
"default": "./dist/component/convex.config.js"
|
|
53
|
-
},
|
|
54
36
|
"./convex.config": {
|
|
55
37
|
"types": "./dist/component/convex.config.d.ts",
|
|
56
38
|
"default": "./dist/component/convex.config.js"
|
|
39
|
+
},
|
|
40
|
+
"./_generated/component.js": {
|
|
41
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
57
42
|
}
|
|
58
43
|
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"ignore": "7.0.12",
|
|
46
|
+
"mime": "4.1.0",
|
|
47
|
+
"zod": "4.6.5"
|
|
48
|
+
},
|
|
59
49
|
"devDependencies": {
|
|
60
50
|
"@types/node": "24.10.8",
|
|
61
|
-
"@types/react": "19.2.8",
|
|
62
|
-
"@types/react-dom": "19.2.3",
|
|
63
51
|
"convex": "1.46.0",
|
|
64
52
|
"convex-test": "0.0.40",
|
|
65
|
-
"react": "19.2.3",
|
|
66
|
-
"react-dom": "19.2.3",
|
|
67
53
|
"typescript": "5.9.3",
|
|
68
54
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
|
|
69
55
|
"vite-plus": "0.3.3"
|
|
70
56
|
},
|
|
71
57
|
"peerDependencies": {
|
|
72
|
-
"convex": "^1.
|
|
73
|
-
"react": "^18.3.1 || ^19.0.0"
|
|
58
|
+
"convex": "^1.46.0"
|
|
74
59
|
},
|
|
75
60
|
"scripts": {
|
|
76
|
-
"build": "tsc --build ./tsconfig.build.json --force",
|
|
61
|
+
"build": "tsc --build ./tsconfig.build.json --force && node scripts/copy-declarations.ts",
|
|
77
62
|
"build:codegen": "convex codegen --component-dir ./src/component && pnpm run build",
|
|
78
|
-
"typecheck": "tsc --noEmit"
|
|
79
|
-
"watch": "tsc --build ./tsconfig.build.json --watch --preserveWatchOutput"
|
|
63
|
+
"typecheck": "tsc --noEmit"
|
|
80
64
|
}
|
|
81
65
|
}
|
package/INTEGRATION.md
DELETED
|
@@ -1,399 +0,0 @@
|
|
|
1
|
-
# Integration Guide: @samebase/convex-hosting
|
|
2
|
-
|
|
3
|
-
This guide walks you through hosting a static React/Vite app on Convex using the
|
|
4
|
-
`@samebase/convex-hosting` component. Your frontend ends up at `https://<deployment>.convex.site`,
|
|
5
|
-
served alongside your Convex backend with SPA routing and smart caching.
|
|
6
|
-
|
|
7
|
-
## What this component gives you
|
|
8
|
-
|
|
9
|
-
- A drop-in HTTP handler that serves your static files from Convex storage
|
|
10
|
-
- One CLI command (`deploy`) that builds, deploys the backend, and uploads files
|
|
11
|
-
- SPA fallback to `index.html` for client-side routing
|
|
12
|
-
- Long-term cache headers on hashed assets and ETag-based revalidation on HTML
|
|
13
|
-
- Optional live-reload notifications when a new deploy ships
|
|
14
|
-
- Authenticated uploads via the Convex CLI (no public upload endpoint)
|
|
15
|
-
|
|
16
|
-
## Quick Start
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @samebase/convex-hosting
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Register the component and add a `deploy` script as described in [Manual Setup](#manual-setup).
|
|
23
|
-
Then:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm run deploy
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Manual Setup
|
|
30
|
-
|
|
31
|
-
### `convex/convex.config.ts`
|
|
32
|
-
|
|
33
|
-
The default setup mounts the component's HTTP handler at the root and moves app-owned routes under
|
|
34
|
-
`/api`.
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import { defineApp } from "convex/server";
|
|
38
|
-
import hosting from "@samebase/convex-hosting/convex.config";
|
|
39
|
-
|
|
40
|
-
// Serve your own HTTP endpoints (convex/http.ts) under /api so the static
|
|
41
|
-
// site can own the root.
|
|
42
|
-
const app = defineApp({ httpPrefix: "/api" });
|
|
43
|
-
app.use(hosting, { httpPrefix: "/" });
|
|
44
|
-
|
|
45
|
-
export default app;
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
This is the fastest serving mode because the component reads its storage directly. It is appropriate
|
|
49
|
-
for new apps and apps whose HTTP routes can live under `/api`.
|
|
50
|
-
|
|
51
|
-
If existing webhook, auth, or API routes must stay at the root, use
|
|
52
|
-
[App-owned root routing](#app-owned-root-routing). To host the static site under a sub-path, see
|
|
53
|
-
[Mounting under a sub-path](#mounting-under-a-sub-path).
|
|
54
|
-
|
|
55
|
-
> Run `npx convex dev` after editing `convex.config.ts` so codegen picks up the component.
|
|
56
|
-
|
|
57
|
-
### App-owned root routing
|
|
58
|
-
|
|
59
|
-
Keep the app in control of `convex/http.ts` when changing existing route URLs would break clients or
|
|
60
|
-
third-party callbacks.
|
|
61
|
-
|
|
62
|
-
`convex/convex.config.ts`:
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
import { defineApp } from "convex/server";
|
|
66
|
-
import hosting from "@samebase/convex-hosting/convex.config";
|
|
67
|
-
|
|
68
|
-
const app = defineApp();
|
|
69
|
-
app.use(hosting); // no httpPrefix
|
|
70
|
-
|
|
71
|
-
export default app;
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
`convex/http.ts`:
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
import { httpRouter } from "convex/server";
|
|
78
|
-
import { registerStaticRoutes } from "@samebase/convex-hosting";
|
|
79
|
-
import { components } from "./_generated/api";
|
|
80
|
-
|
|
81
|
-
const http = httpRouter();
|
|
82
|
-
|
|
83
|
-
// Keep existing exact routes at their current URLs.
|
|
84
|
-
// auth.addHttpRoutes(http);
|
|
85
|
-
registerStaticRoutes(http, components.hosting);
|
|
86
|
-
|
|
87
|
-
export default http;
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Exact routes win over the static catch-all. Uploads, deployment metadata, SPA configuration, and
|
|
91
|
-
file storage remain inside the component, so you can remove the old `exposeUploadApi` wrappers.
|
|
92
|
-
During a same-name 0.1.x→0.2.x migration this mode also keeps serving your existing v1 files from
|
|
93
|
-
app storage until the first 0.2.x upload, so the live site never drops to the setup page. This
|
|
94
|
-
compatibility mode adds an internal query and storage fetch on uncached requests. Use the
|
|
95
|
-
component-owned handler when preserving root-level app routes is not necessary.
|
|
96
|
-
|
|
97
|
-
### `package.json`
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"scripts": {
|
|
102
|
-
"deploy": "npx @samebase/convex-hosting deploy"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Deployment
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
# First time
|
|
111
|
-
npx convex login
|
|
112
|
-
|
|
113
|
-
# Build + backend deploy + upload static files
|
|
114
|
-
npx @samebase/convex-hosting deploy
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Two-step alternative:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
npx convex deploy
|
|
121
|
-
npx @samebase/convex-hosting upload --build --prod
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Your app is live at `https://<deployment>.convex.site`.
|
|
125
|
-
|
|
126
|
-
## Development workflow
|
|
127
|
-
|
|
128
|
-
Do not use uploaded static files as the main development loop. Run the normal frontend dev server
|
|
129
|
-
alongside Convex:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npx convex dev
|
|
133
|
-
npm run dev
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
Vite keeps HMR, source maps, and transient UI state intact. Agent-written code does not change that
|
|
137
|
-
tradeoff. HMR may matter less while code is being produced, but it still matters when a person
|
|
138
|
-
verifies visuals and debugs interactions.
|
|
139
|
-
|
|
140
|
-
Use the hosted development deployment as a smoke-test target before release:
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
npx @samebase/convex-hosting upload --build
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
That catches differences in HTTP routing, cache headers, SPA fallback, and base paths. Production
|
|
147
|
-
remains the one-command `deploy` flow.
|
|
148
|
-
|
|
149
|
-
## Live reload banner (optional)
|
|
150
|
-
|
|
151
|
-
Show users a banner when a new version is deployed:
|
|
152
|
-
|
|
153
|
-
### `convex/hosting.ts`
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
import { exposeDeploymentQuery } from "@samebase/convex-hosting";
|
|
157
|
-
import { components } from "./_generated/api";
|
|
158
|
-
|
|
159
|
-
export const { getCurrentDeployment } = exposeDeploymentQuery(components.hosting);
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Frontend
|
|
163
|
-
|
|
164
|
-
```tsx
|
|
165
|
-
import { UpdateBanner } from "@samebase/convex-hosting/react";
|
|
166
|
-
|
|
167
|
-
function App() {
|
|
168
|
-
return (
|
|
169
|
-
<>
|
|
170
|
-
<UpdateBanner message="New version available!" buttonText="Reload" />
|
|
171
|
-
{/* rest of app */}
|
|
172
|
-
</>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
`UpdateBanner` resolves `api.hosting.getCurrentDeployment` by default. To re-export the query under
|
|
178
|
-
a different module, pass the reference explicitly:
|
|
179
|
-
|
|
180
|
-
```tsx
|
|
181
|
-
import { api } from "../convex/_generated/api";
|
|
182
|
-
<UpdateBanner getCurrentDeployment={api.myModule.getCurrentDeployment} />;
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
For custom UI, use the hook:
|
|
186
|
-
|
|
187
|
-
```tsx
|
|
188
|
-
import { useDeploymentUpdates } from "@samebase/convex-hosting/react";
|
|
189
|
-
|
|
190
|
-
const { updateAvailable, reload, dismiss } = useDeploymentUpdates();
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## Legacy CDN mode
|
|
194
|
-
|
|
195
|
-
Do not use `--cdn` for a new integration. It targets an older, unauthenticated `convex-fs` HTTP API.
|
|
196
|
-
Current ConvexFS releases require app-owned routes and upload authentication, which this CLI does
|
|
197
|
-
not yet provide.
|
|
198
|
-
|
|
199
|
-
Existing deployments that already expose the legacy routes can keep using the flag during migration,
|
|
200
|
-
but they must use app-owned root compatibility mode. `/fs/upload` and `/fs/blobs/*` are app routes,
|
|
201
|
-
so component-owned root mode would break both upload and serving. Everyone else should use the
|
|
202
|
-
default Convex storage mode. Supporting current ConvexFS properly needs a separate authenticated
|
|
203
|
-
upload and garbage-collection design, not a copy-paste configuration snippet.
|
|
204
|
-
|
|
205
|
-
The CLI uploads every file before atomically publishing the mixed storage/CDN manifest and
|
|
206
|
-
deployment settings while queuing exact old-file IDs for bounded follow-up cleanup. New HTML does
|
|
207
|
-
not point at asset records that are still missing, and a failed publish leaves the previous
|
|
208
|
-
deployment live. Failure cleanup removes new files only after it can prove publication did not win
|
|
209
|
-
the transaction race; otherwise later maintenance recovers them. Failed legacy CDN uploads can only
|
|
210
|
-
be cleaned automatically when `--cdn-delete-function` is configured. Old CDN IDs are kept in a
|
|
211
|
-
private cleanup queue until that function succeeds, so a lost publish response does not make them
|
|
212
|
-
unrecoverable.
|
|
213
|
-
|
|
214
|
-
## Non-Vite bundlers
|
|
215
|
-
|
|
216
|
-
The `deploy` build step and `upload --build` set `VITE_CONVEX_URL`. To forward it to another env var
|
|
217
|
-
(Expo, Next.js, etc.), wrap your build script:
|
|
218
|
-
|
|
219
|
-
```text
|
|
220
|
-
Expo build script:
|
|
221
|
-
EXPO_PUBLIC_CONVEX_URL=${VITE_CONVEX_URL:-$EXPO_PUBLIC_CONVEX_URL} npx expo export --platform web
|
|
222
|
-
|
|
223
|
-
Next.js build script:
|
|
224
|
-
NEXT_PUBLIC_CONVEX_URL=${VITE_CONVEX_URL:-$NEXT_PUBLIC_CONVEX_URL} next build
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
## Security
|
|
228
|
-
|
|
229
|
-
Upload functions are **internal** to the component. They can only be called via:
|
|
230
|
-
|
|
231
|
-
- `npx convex run` (requires Convex CLI authentication)
|
|
232
|
-
- Other Convex functions (server-side only)
|
|
233
|
-
|
|
234
|
-
This means unauthorized users cannot upload files, even if they know your Convex URL.
|
|
235
|
-
|
|
236
|
-
## CLI Reference
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
npx @samebase/convex-hosting deploy [options]
|
|
240
|
-
-d, --dist <path> Path to dist directory (default: ./dist)
|
|
241
|
-
-c, --component <name> Component instance name (default: hosting)
|
|
242
|
-
--skip-build Skip the build step
|
|
243
|
-
--skip-convex Skip Convex backend deployment
|
|
244
|
-
--build-command <cmd> Build command to run (default: 'npm run build')
|
|
245
|
-
--no-spa Disable SPA fallback (404 instead of /index.html)
|
|
246
|
-
--spa Enable SPA fallback (default)
|
|
247
|
-
--cdn Upload non-HTML assets to convex-fs CDN
|
|
248
|
-
--cdn-delete-function App function path that deletes CDN blobs
|
|
249
|
-
|
|
250
|
-
npx @samebase/convex-hosting upload [options]
|
|
251
|
-
-d, --dist <path> Path to dist directory (default: ./dist)
|
|
252
|
-
-c, --component <name> Component instance name (default: hosting)
|
|
253
|
-
--prod Deploy to production deployment
|
|
254
|
-
--preview-name <name> Upload to the named preview deployment
|
|
255
|
-
-b, --build Run 'npm run build' with VITE_CONVEX_URL set
|
|
256
|
-
--build-command <cmd> Override the build command; implies --build
|
|
257
|
-
--no-spa Disable SPA fallback (404 instead of /index.html)
|
|
258
|
-
--spa Enable SPA fallback (default)
|
|
259
|
-
--cdn Upload non-HTML assets to convex-fs CDN
|
|
260
|
-
--cdn-delete-function App function path that deletes CDN blobs
|
|
261
|
-
-j, --concurrency <n> Parallel upload workers (default: 5)
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
The complete manifest is staged in small, portable command-line chunks after all uploads finish. One
|
|
265
|
-
final mutation atomically publishes the manifest and deployment settings. Replaced files stay in
|
|
266
|
-
component storage for at least seven days. A request for a missing file with an extension, except
|
|
267
|
-
HTML, gets the newest replaced copy, so pages that are already open can still load their scripts.
|
|
268
|
-
Files remain available until a later upload removes expired files in bounded cleanup transactions.
|
|
269
|
-
Legacy CDN blobs are not retained. A failed attempt leaves the previous deployment live and removes
|
|
270
|
-
only new files that are not referenced by the live manifest. The supported maximum is 1,800 files
|
|
271
|
-
and 2 MiB of serialized manifest metadata, which keeps the atomic switch below Convex transaction
|
|
272
|
-
limits. Upload URLs are generated in bounded batches. Later uploads recover component files and
|
|
273
|
-
staging records left unreferenced for more than 24 hours after an interrupted CLI.
|
|
274
|
-
|
|
275
|
-
Convex HTTP routers currently expose GET but not HEAD routes. Uptime monitors must use a lightweight
|
|
276
|
-
GET request.
|
|
277
|
-
|
|
278
|
-
## Mounting under a sub-path
|
|
279
|
-
|
|
280
|
-
To mount under `/app/` (for example, if you have other HTTP routes at the root):
|
|
281
|
-
|
|
282
|
-
```typescript
|
|
283
|
-
app.use(hosting, { httpPrefix: "/app/" });
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
The bundler also needs to know the base path so the emitted HTML references the right URLs. The CLI
|
|
287
|
-
sets a `CONVEX_HOSTING_BASE_PATH` env var matching the component's mount when it runs your build, so
|
|
288
|
-
`vite.config.ts` can read it:
|
|
289
|
-
|
|
290
|
-
```typescript
|
|
291
|
-
import { defineConfig } from "vite";
|
|
292
|
-
|
|
293
|
-
export default defineConfig({
|
|
294
|
-
base: process.env.CONVEX_HOSTING_BASE_PATH ?? "/",
|
|
295
|
-
});
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
Root-mounted apps don't need this; the default is `/`. Webpack/Next.js equivalents: `publicPath` and
|
|
299
|
-
`assetPrefix`.
|
|
300
|
-
|
|
301
|
-
## SPA routing
|
|
302
|
-
|
|
303
|
-
Requests for an extension-less path that doesn't match an uploaded file fall back to `index.html`,
|
|
304
|
-
so client-side routes survive a reload. Paths with an extension (e.g. `/missing.js`) always 404 when
|
|
305
|
-
not found. To turn the fallback off for a multi-page app (unknown paths become real 404s), deploy
|
|
306
|
-
with `--no-spa`:
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
npx @samebase/convex-hosting deploy --no-spa
|
|
310
|
-
# or: npx @samebase/convex-hosting upload --no-spa
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
The flag is stored on the deployment record (the `deploymentInfo` table), so the serving behavior
|
|
314
|
-
travels with the code you ship rather than living in a separate env var. Re-deploy without
|
|
315
|
-
`--no-spa` or with `--spa` to turn it back on.
|
|
316
|
-
|
|
317
|
-
## Switching from @convex-dev/static-hosting
|
|
318
|
-
|
|
319
|
-
Follow
|
|
320
|
-
[Switching from @convex-dev/static-hosting](./README.md#switching-from-convex-devstatic-hosting) in
|
|
321
|
-
the README. Mount the component with `{ name: "staticHosting" }` to keep the uploaded files and
|
|
322
|
-
URLs. An app on 0.1.x first follows upstream's
|
|
323
|
-
[0.1.x to 0.2.x migration guide](https://github.com/get-convex/static-hosting/blob/main/MIGRATION.md).
|
|
324
|
-
|
|
325
|
-
## Troubleshooting
|
|
326
|
-
|
|
327
|
-
### 404s on every path
|
|
328
|
-
|
|
329
|
-
Run `npx convex dev` (or `npx convex deploy`) after adding the component. In component-owned mode,
|
|
330
|
-
verify its `httpPrefix`. In app-owned mode, verify that `registerStaticRoutes` is called from
|
|
331
|
-
`convex/http.ts` and the component itself has no `httpPrefix`.
|
|
332
|
-
|
|
333
|
-
### Wrong `VITE_CONVEX_URL` in the built bundle
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
# Right: CLI sets VITE_CONVEX_URL for the target deployment
|
|
337
|
-
npx @samebase/convex-hosting deploy
|
|
338
|
-
|
|
339
|
-
# Wrong: uses VITE_CONVEX_URL from .env.local
|
|
340
|
-
npm run build && npx @samebase/convex-hosting upload --prod
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
### "Cannot find module convex.config"
|
|
344
|
-
|
|
345
|
-
Make sure you've installed the package and it's listed in `package.json`:
|
|
346
|
-
|
|
347
|
-
```bash
|
|
348
|
-
npm install @samebase/convex-hosting
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
### Component name mismatch
|
|
352
|
-
|
|
353
|
-
If you've renamed the component instance with `app.use(hosting, { name: "custom" })`, pass it to the
|
|
354
|
-
CLI and replace every generated `components.hosting` reference with `components.custom`:
|
|
355
|
-
|
|
356
|
-
```bash
|
|
357
|
-
npx @samebase/convex-hosting upload --component custom
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
## API Reference
|
|
361
|
-
|
|
362
|
-
### `registerStaticRoutes(http, component, options?)`
|
|
363
|
-
|
|
364
|
-
Registers a static catch-all in the app's `convex/http.ts`. Use it when exact app routes must remain
|
|
365
|
-
at the same root. `pathPrefix`, `spaFallback`, and `cdnBaseUrl` are supported. The component must be
|
|
366
|
-
installed without an `httpPrefix` so only the app owns that URL space.
|
|
367
|
-
|
|
368
|
-
### `serveStaticAsset(ctx, component, request, options?)`
|
|
369
|
-
|
|
370
|
-
Serves an uploaded file from an app-owned HTTP action, or returns `null` when no file matches so the
|
|
371
|
-
action can continue with its own routing (server rendering, prerendered pages, redirects). Responses
|
|
372
|
-
match `registerStaticRoutes`. The lookup is exact: `/` is not mapped to `/index.html`, and
|
|
373
|
-
`spaFallback` defaults to `false`. `path` (the decoded file path, defaulting to the decoded request
|
|
374
|
-
path, starting with `/` and without your route's prefix), `spaFallback`, and `cdnBaseUrl` are
|
|
375
|
-
supported. A request path with malformed percent-encoding returns `null`. A found file whose storage
|
|
376
|
-
can't be read gets a 500 response. The component must be installed without an `httpPrefix`.
|
|
377
|
-
|
|
378
|
-
### `decodeRequestPath(pathname)`
|
|
379
|
-
|
|
380
|
-
Decodes a URL pathname the way the static handlers do. Returns `null` for malformed
|
|
381
|
-
percent-encoding.
|
|
382
|
-
|
|
383
|
-
### `exposeDeploymentQuery(component)`
|
|
384
|
-
|
|
385
|
-
Returns `{ getCurrentDeployment }`: a public query that wraps the component's deployment singleton.
|
|
386
|
-
Add this only if you use `<UpdateBanner />` or `useDeploymentUpdates`.
|
|
387
|
-
|
|
388
|
-
### `getConvexUrl()`
|
|
389
|
-
|
|
390
|
-
Browser-only. Returns `https://<deployment>.convex.cloud` when the page is served from
|
|
391
|
-
`<deployment>.convex.site`.
|
|
392
|
-
|
|
393
|
-
## Additional Resources
|
|
394
|
-
|
|
395
|
-
- [README](./README.md)
|
|
396
|
-
- [Upstream 0.1.x to 0.2.x migration guide](https://github.com/get-convex/static-hosting/blob/main/MIGRATION.md)
|
|
397
|
-
- [`examples/spa`](https://github.com/samebase/convex-hosting/tree/main/examples/spa): Working
|
|
398
|
-
example app
|
|
399
|
-
- [Component source](https://github.com/samebase/convex-hosting/tree/main/packages/convex-hosting/src/component)
|
package/dist/cli/args.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export interface UploadArgs {
|
|
2
|
-
dist: string;
|
|
3
|
-
component: string;
|
|
4
|
-
prod: boolean;
|
|
5
|
-
previewName: string | null;
|
|
6
|
-
build: boolean;
|
|
7
|
-
buildCommand: string;
|
|
8
|
-
cdn: boolean;
|
|
9
|
-
cdnDeleteFunction: string;
|
|
10
|
-
concurrency: number;
|
|
11
|
-
spaFallback: boolean;
|
|
12
|
-
help: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface DeployArgs {
|
|
15
|
-
dist: string;
|
|
16
|
-
component: string;
|
|
17
|
-
help: boolean;
|
|
18
|
-
skipBuild: boolean;
|
|
19
|
-
skipConvex: boolean;
|
|
20
|
-
cdn: boolean;
|
|
21
|
-
cdnDeleteFunction: string;
|
|
22
|
-
spaFallback: boolean;
|
|
23
|
-
buildCommand: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function parseUploadArgs(args: string[]): UploadArgs;
|
|
26
|
-
export declare function parseDeployArgs(args: string[]): DeployArgs;
|
|
27
|
-
export declare function buildDeployUploadArgs(args: DeployArgs): string[];
|
|
28
|
-
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAUD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA8D1D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA4C1D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CAQhE"}
|
package/dist/cli/args.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
function optionValue(args, index, option) {
|
|
2
|
-
const value = args[index + 1];
|
|
3
|
-
if (!value || value.startsWith("-")) {
|
|
4
|
-
throw new Error(`${option} requires a value`);
|
|
5
|
-
}
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
|
-
export function parseUploadArgs(args) {
|
|
9
|
-
const result = {
|
|
10
|
-
dist: "./dist",
|
|
11
|
-
component: "hosting",
|
|
12
|
-
prod: false,
|
|
13
|
-
previewName: null,
|
|
14
|
-
build: false,
|
|
15
|
-
buildCommand: "npm run build",
|
|
16
|
-
cdn: false,
|
|
17
|
-
cdnDeleteFunction: "",
|
|
18
|
-
concurrency: 5,
|
|
19
|
-
spaFallback: true,
|
|
20
|
-
help: false,
|
|
21
|
-
};
|
|
22
|
-
for (let i = 0; i < args.length; i++) {
|
|
23
|
-
const arg = args[i];
|
|
24
|
-
if (arg === "--help" || arg === "-h") {
|
|
25
|
-
result.help = true;
|
|
26
|
-
}
|
|
27
|
-
else if (arg === "--dist" || arg === "-d") {
|
|
28
|
-
result.dist = optionValue(args, i, arg);
|
|
29
|
-
i++;
|
|
30
|
-
}
|
|
31
|
-
else if (arg === "--component" || arg === "-c") {
|
|
32
|
-
result.component = optionValue(args, i, arg);
|
|
33
|
-
i++;
|
|
34
|
-
}
|
|
35
|
-
else if (arg === "--preview-name") {
|
|
36
|
-
result.previewName = optionValue(args, i, arg);
|
|
37
|
-
i++;
|
|
38
|
-
}
|
|
39
|
-
else if (arg === "--prod") {
|
|
40
|
-
result.prod = true;
|
|
41
|
-
}
|
|
42
|
-
else if (arg === "--no-prod" || arg === "--dev") {
|
|
43
|
-
result.prod = false;
|
|
44
|
-
}
|
|
45
|
-
else if (arg === "--build" || arg === "-b") {
|
|
46
|
-
result.build = true;
|
|
47
|
-
}
|
|
48
|
-
else if (arg === "--build-command") {
|
|
49
|
-
result.buildCommand = optionValue(args, i, arg);
|
|
50
|
-
result.build = true;
|
|
51
|
-
i++;
|
|
52
|
-
}
|
|
53
|
-
else if (arg === "--no-spa") {
|
|
54
|
-
result.spaFallback = false;
|
|
55
|
-
}
|
|
56
|
-
else if (arg === "--spa") {
|
|
57
|
-
result.spaFallback = true;
|
|
58
|
-
}
|
|
59
|
-
else if (arg === "--cdn") {
|
|
60
|
-
result.cdn = true;
|
|
61
|
-
}
|
|
62
|
-
else if (arg === "--cdn-delete-function") {
|
|
63
|
-
result.cdnDeleteFunction = optionValue(args, i, arg);
|
|
64
|
-
i++;
|
|
65
|
-
}
|
|
66
|
-
else if (arg === "--concurrency" || arg === "-j") {
|
|
67
|
-
const value = optionValue(args, i, arg);
|
|
68
|
-
const concurrency = Number(value);
|
|
69
|
-
if (!Number.isInteger(concurrency) || concurrency <= 0) {
|
|
70
|
-
throw new Error(`${arg} must be a positive integer`);
|
|
71
|
-
}
|
|
72
|
-
result.concurrency = concurrency;
|
|
73
|
-
i++;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
throw new Error(`Unknown upload option: ${arg}`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (result.prod && result.previewName !== null)
|
|
80
|
-
throw new Error("--prod and --preview-name cannot be combined");
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
export function parseDeployArgs(args) {
|
|
84
|
-
const result = {
|
|
85
|
-
dist: "./dist",
|
|
86
|
-
component: "hosting",
|
|
87
|
-
help: false,
|
|
88
|
-
skipBuild: false,
|
|
89
|
-
skipConvex: false,
|
|
90
|
-
cdn: false,
|
|
91
|
-
cdnDeleteFunction: "",
|
|
92
|
-
spaFallback: true,
|
|
93
|
-
buildCommand: "npm run build",
|
|
94
|
-
};
|
|
95
|
-
for (let i = 0; i < args.length; i++) {
|
|
96
|
-
const arg = args[i];
|
|
97
|
-
if (arg === "--help" || arg === "-h") {
|
|
98
|
-
result.help = true;
|
|
99
|
-
}
|
|
100
|
-
else if (arg === "--dist" || arg === "-d") {
|
|
101
|
-
result.dist = optionValue(args, i, arg);
|
|
102
|
-
i++;
|
|
103
|
-
}
|
|
104
|
-
else if (arg === "--component" || arg === "-c") {
|
|
105
|
-
result.component = optionValue(args, i, arg);
|
|
106
|
-
i++;
|
|
107
|
-
}
|
|
108
|
-
else if (arg === "--skip-build") {
|
|
109
|
-
result.skipBuild = true;
|
|
110
|
-
}
|
|
111
|
-
else if (arg === "--skip-convex") {
|
|
112
|
-
result.skipConvex = true;
|
|
113
|
-
}
|
|
114
|
-
else if (arg === "--cdn") {
|
|
115
|
-
result.cdn = true;
|
|
116
|
-
}
|
|
117
|
-
else if (arg === "--cdn-delete-function") {
|
|
118
|
-
result.cdnDeleteFunction = optionValue(args, i, arg);
|
|
119
|
-
i++;
|
|
120
|
-
}
|
|
121
|
-
else if (arg === "--no-spa") {
|
|
122
|
-
result.spaFallback = false;
|
|
123
|
-
}
|
|
124
|
-
else if (arg === "--spa") {
|
|
125
|
-
result.spaFallback = true;
|
|
126
|
-
}
|
|
127
|
-
else if (arg === "--build-command") {
|
|
128
|
-
result.buildCommand = optionValue(args, i, arg);
|
|
129
|
-
i++;
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
throw new Error(`Unknown deploy option: ${arg}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
export function buildDeployUploadArgs(args) {
|
|
138
|
-
const uploadArgs = ["upload", "--dist", args.dist, "--component", args.component, "--prod"];
|
|
139
|
-
if (args.cdn)
|
|
140
|
-
uploadArgs.push("--cdn");
|
|
141
|
-
if (args.cdnDeleteFunction) {
|
|
142
|
-
uploadArgs.push("--cdn-delete-function", args.cdnDeleteFunction);
|
|
143
|
-
}
|
|
144
|
-
if (!args.spaFallback)
|
|
145
|
-
uploadArgs.push("--no-spa");
|
|
146
|
-
return uploadArgs;
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=args.js.map
|
package/dist/cli/args.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AA0BA,SAAS,WAAW,CAAC,IAAc,EAAE,KAAa,EAAE,MAAc;IAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,mBAAmB,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAc;IAC5C,MAAM,MAAM,GAAe;QACzB,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,eAAe;QAC7B,GAAG,EAAE,KAAK;QACV,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,KAAK;KACZ,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EA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