@samebase/convex-hosting 0.3.2 → 0.4.1
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 +17 -132
- package/README.md +188 -406
- 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 +377 -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 +21 -37
- 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
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Windows limits the complete command line to roughly 32 KiB. Keep each JSON
|
|
2
|
-
// argument below 20 KiB so the Node executable, Convex flags, and paths still
|
|
3
|
-
// have comfortable headroom on every supported platform.
|
|
4
|
-
export const MAX_CONVEX_ARGUMENT_BYTES = 20 * 1024;
|
|
5
|
-
export function chunkBySerializedArgument(items, makeArgs, maxBytes = MAX_CONVEX_ARGUMENT_BYTES) {
|
|
6
|
-
const chunks = [];
|
|
7
|
-
let current = [];
|
|
8
|
-
for (const item of items) {
|
|
9
|
-
const candidate = [...current, item];
|
|
10
|
-
const candidateBytes = Buffer.byteLength(JSON.stringify(makeArgs(candidate)));
|
|
11
|
-
if (candidateBytes <= maxBytes) {
|
|
12
|
-
current = candidate;
|
|
13
|
-
continue;
|
|
14
|
-
}
|
|
15
|
-
if (current.length === 0) {
|
|
16
|
-
throw new Error(`One upload record needs ${candidateBytes} bytes, which exceeds the safe Convex CLI argument limit of ${maxBytes} bytes. Shorten the asset path.`);
|
|
17
|
-
}
|
|
18
|
-
chunks.push(current);
|
|
19
|
-
current = [item];
|
|
20
|
-
const singleBytes = Buffer.byteLength(JSON.stringify(makeArgs(current)));
|
|
21
|
-
if (singleBytes > maxBytes) {
|
|
22
|
-
throw new Error(`One upload record needs ${singleBytes} bytes, which exceeds the safe Convex CLI argument limit of ${maxBytes} bytes. Shorten the asset path.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (current.length > 0)
|
|
26
|
-
chunks.push(current);
|
|
27
|
-
return chunks;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=argumentChunks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"argumentChunks.js","sourceRoot":"","sources":["../../src/cli/argumentChunks.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,yDAAyD;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnD,MAAM,UAAU,yBAAyB,CACvC,KAAU,EACV,QAAiD,EACjD,QAAQ,GAAG,yBAAyB;IAEpC,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,IAAI,OAAO,GAAQ,EAAE,CAAC;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,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,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAwBA"}
|
package/dist/cli/collectFiles.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { readdirSync } from "fs";
|
|
2
|
-
import { extname, join, relative } from "path";
|
|
3
|
-
const MIME_TYPES = {
|
|
4
|
-
".html": "text/html; charset=utf-8",
|
|
5
|
-
".js": "application/javascript; charset=utf-8",
|
|
6
|
-
".mjs": "application/javascript; charset=utf-8",
|
|
7
|
-
".css": "text/css; charset=utf-8",
|
|
8
|
-
".json": "application/json; charset=utf-8",
|
|
9
|
-
".png": "image/png",
|
|
10
|
-
".jpg": "image/jpeg",
|
|
11
|
-
".jpeg": "image/jpeg",
|
|
12
|
-
".gif": "image/gif",
|
|
13
|
-
".svg": "image/svg+xml",
|
|
14
|
-
".ico": "image/x-icon",
|
|
15
|
-
".webp": "image/webp",
|
|
16
|
-
".woff": "font/woff",
|
|
17
|
-
".woff2": "font/woff2",
|
|
18
|
-
".ttf": "font/ttf",
|
|
19
|
-
".txt": "text/plain; charset=utf-8",
|
|
20
|
-
".map": "application/json",
|
|
21
|
-
".webmanifest": "application/manifest+json",
|
|
22
|
-
".xml": "application/xml",
|
|
23
|
-
};
|
|
24
|
-
// Cloudflare and Netlify read these files at the root of the build output as hosting rules and
|
|
25
|
-
// never serve them. This package does not apply them, so it does not upload them either.
|
|
26
|
-
const HOSTING_RULE_FILES = new Set(["/_headers", "/_redirects"]);
|
|
27
|
-
export function collectFiles(distDir) {
|
|
28
|
-
const files = [];
|
|
29
|
-
const skipped = [];
|
|
30
|
-
const visit = (dir) => {
|
|
31
|
-
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
32
|
-
const localPath = join(dir, entry.name);
|
|
33
|
-
if (entry.isDirectory()) {
|
|
34
|
-
visit(localPath);
|
|
35
|
-
}
|
|
36
|
-
else if (entry.isFile()) {
|
|
37
|
-
const path = "/" + relative(distDir, localPath).replace(/\\/g, "/");
|
|
38
|
-
if (HOSTING_RULE_FILES.has(path)) {
|
|
39
|
-
skipped.push(path);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
files.push({
|
|
43
|
-
path,
|
|
44
|
-
localPath,
|
|
45
|
-
contentType: MIME_TYPES[extname(localPath).toLowerCase()] || "application/octet-stream",
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
visit(distDir);
|
|
51
|
-
return { files, skipped };
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=collectFiles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collectFiles.js","sourceRoot":"","sources":["../../src/cli/collectFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE/C,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,uCAAuC;IAC/C,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,2BAA2B;IACnC,MAAM,EAAE,kBAAkB;IAC1B,cAAc,EAAE,2BAA2B;IAC3C,MAAM,EAAE,iBAAiB;CAC1B,CAAC;AAEF,+FAA+F;AAC/F,yFAAyF;AACzF,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAIjE,MAAM,UAAU,YAAY,CAAC,OAAe;IAI1C,MAAM,KAAK,GAAoB,EAAE,CAAC;IAClC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAE;QAC5B,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,KAAK,CAAC,SAAS,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBACpE,IAAI,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACnB,SAAS;gBACX,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI;oBACJ,SAAS;oBACT,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,0BAA0B;iBACxF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,CAAC;IACf,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/cli/commands.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function runConvex(args: string[]): string;
|
|
2
|
-
export declare function runConvexAsync(args: string[], options?: {
|
|
3
|
-
quiet?: boolean;
|
|
4
|
-
}): Promise<string>;
|
|
5
|
-
export declare function spawnConvex(args: string[]): number | null;
|
|
6
|
-
export declare function spawnShell(command: string, env?: NodeJS.ProcessEnv): number | null;
|
|
7
|
-
export declare function spawnStaticHostingCli(args: string[]): number | null;
|
|
8
|
-
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAkBA,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAKhD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBjG;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAIzD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAM/F;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAKnE"}
|
package/dist/cli/commands.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { execFile, execFileSync, spawnSync } from "child_process";
|
|
2
|
-
import { createRequire } from "module";
|
|
3
|
-
import { dirname, join, resolve } from "path";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
const requireFromCwd = createRequire(join(process.cwd(), "package.json"));
|
|
6
|
-
function convexBinPath() {
|
|
7
|
-
const packageJsonPath = requireFromCwd.resolve("convex/package.json");
|
|
8
|
-
return join(dirname(packageJsonPath), "bin", "main.js");
|
|
9
|
-
}
|
|
10
|
-
function shellCommand(command) {
|
|
11
|
-
return process.platform === "win32"
|
|
12
|
-
? { command: "cmd.exe", args: ["/d", "/s", "/c", command] }
|
|
13
|
-
: { command: "sh", args: ["-c", command] };
|
|
14
|
-
}
|
|
15
|
-
export function runConvex(args) {
|
|
16
|
-
return execFileSync(process.execPath, [convexBinPath(), ...args], {
|
|
17
|
-
encoding: "utf-8",
|
|
18
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
19
|
-
}).trim();
|
|
20
|
-
}
|
|
21
|
-
export function runConvexAsync(args, options = {}) {
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
execFile(process.execPath, [convexBinPath(), ...args], { encoding: "utf-8" }, (error, stdout, stderr) => {
|
|
24
|
-
if (error) {
|
|
25
|
-
// Callers that probe optional components (e.g. resolving a legacy
|
|
26
|
-
// instance name) pass quiet so an expected miss isn't logged as a
|
|
27
|
-
// failure.
|
|
28
|
-
if (!options.quiet) {
|
|
29
|
-
console.error("Convex run failed:", stderr || stdout);
|
|
30
|
-
}
|
|
31
|
-
reject(error);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
resolve(stdout.trim());
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
export function spawnConvex(args) {
|
|
39
|
-
return spawnSync(process.execPath, [convexBinPath(), ...args], {
|
|
40
|
-
stdio: "inherit",
|
|
41
|
-
}).status;
|
|
42
|
-
}
|
|
43
|
-
export function spawnShell(command, env = process.env) {
|
|
44
|
-
const cmd = shellCommand(command);
|
|
45
|
-
return spawnSync(cmd.command, cmd.args, {
|
|
46
|
-
env,
|
|
47
|
-
stdio: "inherit",
|
|
48
|
-
}).status;
|
|
49
|
-
}
|
|
50
|
-
export function spawnStaticHostingCli(args) {
|
|
51
|
-
const cliPath = resolve(dirname(fileURLToPath(import.meta.url)), "index.js");
|
|
52
|
-
return spawnSync(process.execPath, [cliPath, ...args], {
|
|
53
|
-
stdio: "inherit",
|
|
54
|
-
}).status;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=commands.js.map
|
package/dist/cli/commands.js.map
DELETED
|
@@ -1 +0,0 @@
|
|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C,CAAC,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE;QACrD,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC,MAAM,CAAC;AACZ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component instance name resolution shared by the deploy and upload commands.
|
|
3
|
-
*
|
|
4
|
-
* `@convex-dev/static-hosting` mounted the component as `staticHosting`; this
|
|
5
|
-
* package defaults to `hosting`. An app that switches packages but keeps
|
|
6
|
-
* its existing instance (`app.use(hosting, { name: "staticHosting" })`)
|
|
7
|
-
* keeps its uploaded files and URLs. Without the probe it would have to pass
|
|
8
|
-
* `--component staticHosting` on every command. Instead the CLI probes both
|
|
9
|
-
* names when the caller relied on the default, and warns when it lands on the
|
|
10
|
-
* legacy one.
|
|
11
|
-
*/
|
|
12
|
-
export declare const DEFAULT_COMPONENT_NAME = "hosting";
|
|
13
|
-
export declare const LEGACY_COMPONENT_NAME = "staticHosting";
|
|
14
|
-
/**
|
|
15
|
-
* Instance names to probe, in order, for a requested name.
|
|
16
|
-
*
|
|
17
|
-
* Only the default request expands to include the legacy name. Any other
|
|
18
|
-
* requested name is used verbatim: an explicit custom name must never be
|
|
19
|
-
* silently redirected to a different instance.
|
|
20
|
-
*/
|
|
21
|
-
export declare function componentNameCandidates(requested: string): string[];
|
|
22
|
-
/**
|
|
23
|
-
* Whether resolving `requested` to `resolved` was a legacy-name auto-detection
|
|
24
|
-
* worth warning about. Only true when the caller relied on the default and we
|
|
25
|
-
* fell back to the legacy name — an explicitly requested name (including a
|
|
26
|
-
* command forwarding the resolved name to a subprocess) is left silent so a
|
|
27
|
-
* single `deploy` warns at most once.
|
|
28
|
-
*/
|
|
29
|
-
export declare function isLegacyAutoDetected(requested: string, resolved: string): boolean;
|
|
30
|
-
/** Warning shown once when a command resolves to the legacy instance name. */
|
|
31
|
-
export declare function legacyComponentNameWarning(name: string): string;
|
|
32
|
-
//# sourceMappingURL=componentName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentName.d.ts","sourceRoot":"","sources":["../../src/cli/componentName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEjF;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/D"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component instance name resolution shared by the deploy and upload commands.
|
|
3
|
-
*
|
|
4
|
-
* `@convex-dev/static-hosting` mounted the component as `staticHosting`; this
|
|
5
|
-
* package defaults to `hosting`. An app that switches packages but keeps
|
|
6
|
-
* its existing instance (`app.use(hosting, { name: "staticHosting" })`)
|
|
7
|
-
* keeps its uploaded files and URLs. Without the probe it would have to pass
|
|
8
|
-
* `--component staticHosting` on every command. Instead the CLI probes both
|
|
9
|
-
* names when the caller relied on the default, and warns when it lands on the
|
|
10
|
-
* legacy one.
|
|
11
|
-
*/
|
|
12
|
-
export const DEFAULT_COMPONENT_NAME = "hosting";
|
|
13
|
-
export const LEGACY_COMPONENT_NAME = "staticHosting";
|
|
14
|
-
/**
|
|
15
|
-
* Instance names to probe, in order, for a requested name.
|
|
16
|
-
*
|
|
17
|
-
* Only the default request expands to include the legacy name. Any other
|
|
18
|
-
* requested name is used verbatim: an explicit custom name must never be
|
|
19
|
-
* silently redirected to a different instance.
|
|
20
|
-
*/
|
|
21
|
-
export function componentNameCandidates(requested) {
|
|
22
|
-
if (requested !== DEFAULT_COMPONENT_NAME)
|
|
23
|
-
return [requested];
|
|
24
|
-
return [DEFAULT_COMPONENT_NAME, LEGACY_COMPONENT_NAME];
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Whether resolving `requested` to `resolved` was a legacy-name auto-detection
|
|
28
|
-
* worth warning about. Only true when the caller relied on the default and we
|
|
29
|
-
* fell back to the legacy name — an explicitly requested name (including a
|
|
30
|
-
* command forwarding the resolved name to a subprocess) is left silent so a
|
|
31
|
-
* single `deploy` warns at most once.
|
|
32
|
-
*/
|
|
33
|
-
export function isLegacyAutoDetected(requested, resolved) {
|
|
34
|
-
return requested === DEFAULT_COMPONENT_NAME && resolved === LEGACY_COMPONENT_NAME;
|
|
35
|
-
}
|
|
36
|
-
/** Warning shown once when a command resolves to the legacy instance name. */
|
|
37
|
-
export function legacyComponentNameWarning(name) {
|
|
38
|
-
return (`⚠️ Using the component instance "${name}" (the @convex-dev/static-hosting ` +
|
|
39
|
-
`default; this package's default is "${DEFAULT_COMPONENT_NAME}").\n` +
|
|
40
|
-
` It keeps working without flags. To use the default, rename the instance ` +
|
|
41
|
-
`to "${DEFAULT_COMPONENT_NAME}" and upload your files again.`);
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=componentName.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"componentName.js","sourceRoot":"","sources":["../../src/cli/componentName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,IAAI,SAAS,KAAK,sBAAsB;QAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7D,OAAO,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB,EAAE,QAAgB;IACtE,OAAO,SAAS,KAAK,sBAAsB,IAAI,QAAQ,KAAK,qBAAqB,CAAC;AACpF,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,OAAO,CACL,qCAAqC,IAAI,oCAAoC;QAC7E,uCAAuC,sBAAsB,OAAO;QACpE,6EAA6E;QAC7E,OAAO,sBAAsB,gCAAgC,CAC9D,CAAC;AACJ,CAAC"}
|
package/dist/cli/deploy.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* One-shot deployment command that deploys both Convex backend and static files.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* npx @samebase/convex-hosting deploy [options]
|
|
7
|
-
*
|
|
8
|
-
* This command:
|
|
9
|
-
* 1. Builds the frontend with the correct VITE_CONVEX_URL
|
|
10
|
-
* 2. Deploys the Convex backend (npx convex deploy)
|
|
11
|
-
* 3. Deploys static files to Convex storage
|
|
12
|
-
*
|
|
13
|
-
* The goal is to minimize the inconsistency window between backend and frontend.
|
|
14
|
-
*/
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/cli/deploy.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG"}
|
package/dist/cli/deploy.js
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* One-shot deployment command that deploys both Convex backend and static files.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* npx @samebase/convex-hosting deploy [options]
|
|
7
|
-
*
|
|
8
|
-
* This command:
|
|
9
|
-
* 1. Builds the frontend with the correct VITE_CONVEX_URL
|
|
10
|
-
* 2. Deploys the Convex backend (npx convex deploy)
|
|
11
|
-
* 3. Deploys static files to Convex storage
|
|
12
|
-
*
|
|
13
|
-
* The goal is to minimize the inconsistency window between backend and frontend.
|
|
14
|
-
*/
|
|
15
|
-
import { existsSync } from "fs";
|
|
16
|
-
import { resolve } from "path";
|
|
17
|
-
import { runConvex, spawnConvex, spawnShell, spawnStaticHostingCli } from "./commands.js";
|
|
18
|
-
import { buildDeployUploadArgs, parseDeployArgs } from "./args.js";
|
|
19
|
-
import { buildEnvironment, buildEnvironmentChanged, } from "./deployEnvironment.js";
|
|
20
|
-
import { componentNameCandidates, isLegacyAutoDetected, legacyComponentNameWarning, } from "./componentName.js";
|
|
21
|
-
function showHelp() {
|
|
22
|
-
console.log(`
|
|
23
|
-
Usage: npx @samebase/convex-hosting deploy [options]
|
|
24
|
-
|
|
25
|
-
One-shot deployment: builds frontend, deploys Convex backend, then deploys static files.
|
|
26
|
-
Minimizes the inconsistency window between backend and frontend updates.
|
|
27
|
-
|
|
28
|
-
Options:
|
|
29
|
-
-d, --dist <path> Path to dist directory (default: ./dist)
|
|
30
|
-
-c, --component <name> Convex component name (default: hosting)
|
|
31
|
-
--skip-build Skip the build step (use existing dist)
|
|
32
|
-
--skip-convex Skip Convex backend deployment
|
|
33
|
-
--build-command <cmd> Build command to run (default: 'npm run build')
|
|
34
|
-
--no-spa Disable SPA fallback (404 instead of /index.html)
|
|
35
|
-
--spa Enable SPA fallback (default)
|
|
36
|
-
--cdn Use the legacy convex-fs integration
|
|
37
|
-
--cdn-delete-function <name> Legacy app function that deletes CDN blobs
|
|
38
|
-
-h, --help Show this help message
|
|
39
|
-
|
|
40
|
-
Deployment Flow:
|
|
41
|
-
1. Build frontend with production VITE_CONVEX_URL
|
|
42
|
-
2. Deploy Convex backend (npx convex deploy)
|
|
43
|
-
3. Rebuild if the backend changed the static mount path
|
|
44
|
-
4. Deploy static files to Convex storage
|
|
45
|
-
|
|
46
|
-
Examples:
|
|
47
|
-
# Full deployment
|
|
48
|
-
npx @samebase/convex-hosting deploy
|
|
49
|
-
|
|
50
|
-
# Skip build (if already built)
|
|
51
|
-
npx @samebase/convex-hosting deploy --skip-build
|
|
52
|
-
|
|
53
|
-
# Only deploy static files (skip Convex backend)
|
|
54
|
-
npx @samebase/convex-hosting deploy --skip-convex
|
|
55
|
-
`);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Resolve the component's deployment URLs (siteUrl + cloudUrl). Returns null
|
|
59
|
-
* if the component isn't reachable yet; on first deploy the backend may not
|
|
60
|
-
* exist, in which case the caller should deploy it first and retry.
|
|
61
|
-
*/
|
|
62
|
-
function tryFetchUrls(componentName) {
|
|
63
|
-
try {
|
|
64
|
-
const out = runConvex([
|
|
65
|
-
"run",
|
|
66
|
-
"--component",
|
|
67
|
-
componentName,
|
|
68
|
-
"lib:getUrls",
|
|
69
|
-
"{}",
|
|
70
|
-
"--prod",
|
|
71
|
-
"--typecheck=disable",
|
|
72
|
-
"--codegen=disable",
|
|
73
|
-
]);
|
|
74
|
-
return JSON.parse(out);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// The legacy-name warning is printed at most once per invocation.
|
|
81
|
-
let warnedLegacyName = false;
|
|
82
|
-
/**
|
|
83
|
-
* Resolve the deployment URLs and the instance name that answered. When the
|
|
84
|
-
* caller relied on the default name we also probe the @convex-dev/static-hosting
|
|
85
|
-
* name, so an app that kept that instance works without `--component staticHosting`. Returns
|
|
86
|
-
* null if no candidate is deployed yet (the caller may deploy the backend and
|
|
87
|
-
* retry).
|
|
88
|
-
*/
|
|
89
|
-
function tryResolveComponent(requested) {
|
|
90
|
-
for (const componentName of componentNameCandidates(requested)) {
|
|
91
|
-
const urls = tryFetchUrls(componentName);
|
|
92
|
-
if (urls) {
|
|
93
|
-
if (isLegacyAutoDetected(requested, componentName) && !warnedLegacyName) {
|
|
94
|
-
console.warn(legacyComponentNameWarning(componentName));
|
|
95
|
-
warnedLegacyName = true;
|
|
96
|
-
}
|
|
97
|
-
return { urls, componentName };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
function resolveComponentOrExit(requested) {
|
|
103
|
-
const resolved = tryResolveComponent(requested);
|
|
104
|
-
if (!resolved) {
|
|
105
|
-
const names = componentNameCandidates(requested)
|
|
106
|
-
.map((name) => `"${name}"`)
|
|
107
|
-
.join(" or ");
|
|
108
|
-
console.error(`Could not reach component ${names}. Deploy the Convex backend first (npx convex deploy) and ensure --component matches the name in convex.config.ts.`);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
return resolved;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Run the Convex storage upload flow
|
|
115
|
-
*/
|
|
116
|
-
async function uploadToConvexStorage(args) {
|
|
117
|
-
console.log("");
|
|
118
|
-
console.log(args.cdn
|
|
119
|
-
? "📦 Uploading static files (HTML to Convex, assets to CDN)..."
|
|
120
|
-
: "📦 Uploading static files to Convex storage...");
|
|
121
|
-
console.log("");
|
|
122
|
-
const result = spawnStaticHostingCli(buildDeployUploadArgs(args));
|
|
123
|
-
return result === 0;
|
|
124
|
-
}
|
|
125
|
-
function runFrontendBuild(args, urls) {
|
|
126
|
-
const environment = buildEnvironment(urls);
|
|
127
|
-
console.log(` Build command: ${args.buildCommand}`);
|
|
128
|
-
console.log(` VITE_CONVEX_URL=${environment.cloudUrl}`);
|
|
129
|
-
console.log(` CONVEX_HOSTING_BASE_PATH=${environment.basePath}`);
|
|
130
|
-
console.log("");
|
|
131
|
-
const buildResult = spawnShell(args.buildCommand, {
|
|
132
|
-
...process.env,
|
|
133
|
-
VITE_CONVEX_URL: environment.cloudUrl,
|
|
134
|
-
CONVEX_HOSTING_BASE_PATH: environment.basePath,
|
|
135
|
-
});
|
|
136
|
-
if (buildResult !== 0) {
|
|
137
|
-
throw new Error("Frontend build failed");
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
async function main() {
|
|
141
|
-
const args = parseDeployArgs(process.argv.slice(2));
|
|
142
|
-
if (args.help) {
|
|
143
|
-
showHelp();
|
|
144
|
-
process.exit(0);
|
|
145
|
-
}
|
|
146
|
-
console.log("");
|
|
147
|
-
console.log("🚀 Convex + Static Files Deployment");
|
|
148
|
-
console.log("═══════════════════════════════════════════════════════════");
|
|
149
|
-
const startTime = Date.now();
|
|
150
|
-
// Step 1: Get deployment URLs (needed for build)
|
|
151
|
-
console.log("");
|
|
152
|
-
console.log("Step 1: Getting deployment URLs...");
|
|
153
|
-
let resolved = tryResolveComponent(args.component);
|
|
154
|
-
let urls = resolved?.urls ?? null;
|
|
155
|
-
// Falls back to the requested name until the backend is deployed and a real
|
|
156
|
-
// instance answers; re-resolved after each deploy below.
|
|
157
|
-
let componentName = resolved?.componentName ?? args.component;
|
|
158
|
-
const shouldDeployBackend = !args.skipConvex;
|
|
159
|
-
let backendAlreadyDeployed = false;
|
|
160
|
-
if (!urls && !args.skipConvex) {
|
|
161
|
-
console.log(" Component not yet deployed. Will fetch URLs after deploying backend.");
|
|
162
|
-
}
|
|
163
|
-
else if (urls) {
|
|
164
|
-
console.log(` ✓ ${urls.siteUrl}`);
|
|
165
|
-
}
|
|
166
|
-
// Step 2: Build frontend
|
|
167
|
-
if (!args.skipBuild) {
|
|
168
|
-
console.log("");
|
|
169
|
-
console.log("Step 2: Building frontend...");
|
|
170
|
-
// If the component isn't deployed yet, deploy the backend first so we
|
|
171
|
-
// can ask it for the URLs.
|
|
172
|
-
if (!urls && shouldDeployBackend) {
|
|
173
|
-
console.log(" Deploying Convex backend first to get URLs...");
|
|
174
|
-
console.log("");
|
|
175
|
-
const convexResult = spawnConvex(["deploy"]);
|
|
176
|
-
if (convexResult !== 0) {
|
|
177
|
-
console.error("");
|
|
178
|
-
console.error("❌ Convex deployment failed");
|
|
179
|
-
process.exit(1);
|
|
180
|
-
}
|
|
181
|
-
resolved = resolveComponentOrExit(args.component);
|
|
182
|
-
urls = resolved.urls;
|
|
183
|
-
componentName = resolved.componentName;
|
|
184
|
-
console.log("");
|
|
185
|
-
console.log(` ✓ Site URL: ${urls.siteUrl}`);
|
|
186
|
-
backendAlreadyDeployed = true;
|
|
187
|
-
}
|
|
188
|
-
if (!urls) {
|
|
189
|
-
console.error("");
|
|
190
|
-
console.error("❌ Could not determine deployment URLs for build");
|
|
191
|
-
console.error(" Run 'npx convex deploy' first or remove --skip-convex");
|
|
192
|
-
process.exit(1);
|
|
193
|
-
}
|
|
194
|
-
try {
|
|
195
|
-
runFrontendBuild(args, urls);
|
|
196
|
-
}
|
|
197
|
-
catch {
|
|
198
|
-
console.error("");
|
|
199
|
-
console.error("❌ Build failed");
|
|
200
|
-
process.exit(1);
|
|
201
|
-
}
|
|
202
|
-
console.log("");
|
|
203
|
-
console.log(" ✓ Build complete");
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
console.log("");
|
|
207
|
-
console.log("Step 2: Skipping build (--skip-build)");
|
|
208
|
-
}
|
|
209
|
-
// Step 3: Deploy Convex backend
|
|
210
|
-
if (shouldDeployBackend && !backendAlreadyDeployed) {
|
|
211
|
-
console.log("");
|
|
212
|
-
console.log("Step 3: Deploying Convex backend...");
|
|
213
|
-
console.log("");
|
|
214
|
-
const convexResult = spawnConvex(["deploy"]);
|
|
215
|
-
if (convexResult !== 0) {
|
|
216
|
-
console.error("");
|
|
217
|
-
console.error("❌ Convex deployment failed");
|
|
218
|
-
process.exit(1);
|
|
219
|
-
}
|
|
220
|
-
console.log("");
|
|
221
|
-
console.log(" ✓ Convex backend deployed");
|
|
222
|
-
const deployedComponent = resolveComponentOrExit(args.component);
|
|
223
|
-
const deployedUrls = deployedComponent.urls;
|
|
224
|
-
componentName = deployedComponent.componentName;
|
|
225
|
-
if (!args.skipBuild) {
|
|
226
|
-
if (!urls || buildEnvironmentChanged(urls, deployedUrls)) {
|
|
227
|
-
console.log("");
|
|
228
|
-
console.log(" Site URL changed after backend deployment. Rebuilding with the new environment...");
|
|
229
|
-
try {
|
|
230
|
-
runFrontendBuild(args, deployedUrls);
|
|
231
|
-
}
|
|
232
|
-
catch {
|
|
233
|
-
console.error("");
|
|
234
|
-
console.error("❌ Rebuild failed after backend URL change");
|
|
235
|
-
process.exit(1);
|
|
236
|
-
}
|
|
237
|
-
console.log("");
|
|
238
|
-
console.log(" ✓ Rebuild complete");
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
urls = deployedUrls;
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
console.log("");
|
|
245
|
-
console.log("Step 3: Skipping Convex deployment (--skip-convex or already deployed)");
|
|
246
|
-
}
|
|
247
|
-
// Step 4: Deploy static files
|
|
248
|
-
console.log("");
|
|
249
|
-
console.log("Step 4: Deploying static files to Convex storage...");
|
|
250
|
-
const distDir = resolve(args.dist);
|
|
251
|
-
if (!existsSync(distDir)) {
|
|
252
|
-
console.error("");
|
|
253
|
-
console.error(`❌ Dist directory not found: ${distDir}`);
|
|
254
|
-
console.error(" Run build first or check --dist path");
|
|
255
|
-
process.exit(1);
|
|
256
|
-
}
|
|
257
|
-
// Pass the resolved instance name to the upload subprocess so it targets the
|
|
258
|
-
// same component (and doesn't re-probe or re-warn).
|
|
259
|
-
const staticDeploySuccess = await uploadToConvexStorage({
|
|
260
|
-
...args,
|
|
261
|
-
dist: distDir,
|
|
262
|
-
component: componentName,
|
|
263
|
-
});
|
|
264
|
-
if (!staticDeploySuccess) {
|
|
265
|
-
console.error("");
|
|
266
|
-
console.error("❌ Static file upload failed");
|
|
267
|
-
process.exit(1);
|
|
268
|
-
}
|
|
269
|
-
// Done!
|
|
270
|
-
const duration = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
271
|
-
console.log("");
|
|
272
|
-
console.log("═══════════════════════════════════════════════════════════");
|
|
273
|
-
console.log(`✨ Deployment complete! (${duration}s)`);
|
|
274
|
-
console.log("");
|
|
275
|
-
const finalUrls = urls ?? resolveComponentOrExit(args.component).urls;
|
|
276
|
-
console.log(`Frontend: ${finalUrls.siteUrl}`);
|
|
277
|
-
console.log("");
|
|
278
|
-
}
|
|
279
|
-
main().catch((error) => {
|
|
280
|
-
console.error("Deployment failed:", error);
|
|
281
|
-
process.exit(1);
|
|
282
|
-
});
|
|
283
|
-
//# sourceMappingURL=deploy.js.map
|
package/dist/cli/deploy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAmB,MAAM,WAAW,CAAC;AACpF,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GAExB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,SAAS,QAAQ;IACf,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCb,CAAC,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,aAAqB;IACzC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,SAAS,CAAC;YACpB,KAAK;YACL,aAAa;YACb,aAAa;YACb,aAAa;YACb,IAAI;YACJ,QAAQ;YACR,qBAAqB;YACrB,mBAAmB;SACpB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC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AC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE9D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,2BAA2B,QAAQ,IAAI,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,SAAS,GAAG,IAAI,IAAI,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,aAAa,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAE9C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface DeploymentUrls {
|
|
2
|
-
siteUrl: string;
|
|
3
|
-
cloudUrl: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function buildEnvironment(urls: DeploymentUrls): {
|
|
6
|
-
cloudUrl: string;
|
|
7
|
-
basePath: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function buildEnvironmentChanged(before: DeploymentUrls, after: DeploymentUrls): boolean;
|
|
10
|
-
//# sourceMappingURL=deployEnvironment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployEnvironment.d.ts","sourceRoot":"","sources":["../../src/cli/deployEnvironment.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc;;;EAKpD;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAI9F"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function buildEnvironment(urls) {
|
|
2
|
-
return {
|
|
3
|
-
cloudUrl: urls.cloudUrl,
|
|
4
|
-
basePath: new URL(urls.siteUrl).pathname || "/",
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
export function buildEnvironmentChanged(before, after) {
|
|
8
|
-
const previous = buildEnvironment(before);
|
|
9
|
-
const next = buildEnvironment(after);
|
|
10
|
-
return previous.cloudUrl !== next.cloudUrl || previous.basePath !== next.basePath;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=deployEnvironment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployEnvironment.js","sourceRoot":"","sources":["../../src/cli/deployEnvironment.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACnD,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,IAAI,GAAG;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,MAAsB,EAAE,KAAqB;IACnF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC;AACpF,CAAC"}
|
package/dist/cli/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,QAAA,MAAM,OAAO,QAAkB,CAAC;AAEhC,iBAAe,IAAI,kBA0BlB;AAED,iBAAS,SAAS,SAoBjB"}
|
package/dist/cli/upload.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CLI tool to upload static files to a Convex convex-hosting component.
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* npx @samebase/convex-hosting upload [options]
|
|
7
|
-
*
|
|
8
|
-
* Options:
|
|
9
|
-
* --dist <path> Path to dist directory (default: ./dist)
|
|
10
|
-
* --component <name> Component instance name (default: hosting)
|
|
11
|
-
* --prod Deploy to production deployment
|
|
12
|
-
* --preview-name <name> Upload to the named preview deployment
|
|
13
|
-
* --build Run the frontend build before uploading
|
|
14
|
-
* --build-command <cmd> Override the frontend build command
|
|
15
|
-
* --spa / --no-spa Enable or disable SPA fallback
|
|
16
|
-
* --cdn Use the legacy convex-fs integration
|
|
17
|
-
* --cdn-delete-function App function that deletes old CDN blobs
|
|
18
|
-
* --concurrency <n> Parallel upload workers (default: 5)
|
|
19
|
-
* --help Show help
|
|
20
|
-
*/
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=upload.d.ts.map
|