@disposabl/cli 2.1.2 → 3.0.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/dist/index.js +19 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// auth.ts
|
|
4
4
|
import { lock } from "proper-lockfile";
|
|
5
5
|
// package.json
|
|
6
|
-
var version = "
|
|
6
|
+
var version = "3.0.0";
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@disposabl/cli",
|
|
9
9
|
version,
|
|
@@ -829,6 +829,10 @@ async function configureDevelopment(directory, value) {
|
|
|
829
829
|
throw new Error("Development URLs do not match the deployment.");
|
|
830
830
|
if (value.productionConvexSiteUrl && !/^https:\/\/[a-z0-9-]+\.convex\.site$/.test(value.productionConvexSiteUrl))
|
|
831
831
|
throw new Error("Unexpected production Convex site URL.");
|
|
832
|
+
for (const url of [value.publicSiteUrl, value.productionSiteUrl]) {
|
|
833
|
+
if (url !== undefined && !/^https:\/\/[a-z0-9]+(?:[a-z0-9-]*[a-z0-9])?\.disposabl\.xyz$/.test(url))
|
|
834
|
+
throw new Error("Unexpected public site URL.");
|
|
835
|
+
}
|
|
832
836
|
if (config.features?.includes("analytics") && !value.analytics)
|
|
833
837
|
throw new Error("Analytics setup is incomplete. Connect PostHog and retry app setup.");
|
|
834
838
|
if (value.analytics && (!Number.isSafeInteger(value.analytics.projectId) || !value.analytics.projectToken.startsWith("phc_") || !["https://us.i.posthog.com", "https://eu.i.posthog.com"].includes(value.analytics.host)))
|
|
@@ -867,7 +871,9 @@ async function configureDevelopment(directory, value) {
|
|
|
867
871
|
if (ignored.status !== 0 || tracked.status !== 1)
|
|
868
872
|
throw new Error(`${file} must be untracked and ignored by Git.`);
|
|
869
873
|
}
|
|
870
|
-
if (value.productionConvexSiteUrl || value.analytics || config.analytics) {
|
|
874
|
+
if (value.productionConvexSiteUrl || value.productionSiteUrl || value.analytics || config.analytics) {
|
|
875
|
+
if (value.productionSiteUrl)
|
|
876
|
+
config.productionSiteUrl = value.productionSiteUrl;
|
|
871
877
|
if (value.productionConvexSiteUrl)
|
|
872
878
|
config.productionConvexSiteUrl = value.productionConvexSiteUrl;
|
|
873
879
|
if (config.features?.includes("analytics"))
|
|
@@ -886,16 +892,17 @@ async function configureDevelopment(directory, value) {
|
|
|
886
892
|
await updateEnv(join4(root, files[0]), {
|
|
887
893
|
CONVEX_DEPLOY_KEY: value.deployKey,
|
|
888
894
|
CONVEX_URL: value.convexUrl,
|
|
889
|
-
CONVEX_SITE_URL: value.convexSiteUrl
|
|
890
|
-
|
|
895
|
+
CONVEX_SITE_URL: value.convexSiteUrl,
|
|
896
|
+
...value.publicSiteUrl ? { PUBLIC_SITE_URL: value.publicSiteUrl } : {}
|
|
897
|
+
}, ["CONVEX_DEPLOYMENT", "PUBLIC_SITE_URL"]);
|
|
891
898
|
await updateEnv(join4(root, files[1]), {
|
|
892
899
|
VITE_CONVEX_URL: value.convexUrl,
|
|
893
|
-
VITE_CONVEX_SITE_URL: value.convexSiteUrl
|
|
900
|
+
VITE_CONVEX_SITE_URL: value.publicSiteUrl ?? value.convexSiteUrl
|
|
894
901
|
});
|
|
895
902
|
if (files[2])
|
|
896
903
|
await updateEnv(join4(root, files[2]), {
|
|
897
904
|
EXPO_PUBLIC_CONVEX_URL: value.convexUrl,
|
|
898
|
-
EXPO_PUBLIC_CONVEX_SITE_URL: value.convexSiteUrl
|
|
905
|
+
EXPO_PUBLIC_CONVEX_SITE_URL: value.publicSiteUrl ?? value.convexSiteUrl
|
|
899
906
|
});
|
|
900
907
|
}
|
|
901
908
|
function formatPreview(preview) {
|
|
@@ -1035,7 +1042,12 @@ Waiting for connections. Press Ctrl+C to keep your files and finish later.`);
|
|
|
1035
1042
|
console.log(JSON.stringify(await configureRepository(base, options.appId, value), null, 2));
|
|
1036
1043
|
} else if (tokenCreate && options.configure) {
|
|
1037
1044
|
await configureDevelopment(options.configure, value);
|
|
1038
|
-
const {
|
|
1045
|
+
const {
|
|
1046
|
+
deployKey: _secret,
|
|
1047
|
+
convexSiteUrl: _provider,
|
|
1048
|
+
productionConvexSiteUrl: _productionProvider,
|
|
1049
|
+
...details
|
|
1050
|
+
} = value;
|
|
1039
1051
|
console.log(JSON.stringify({ ...details, configured: true }, null, 2));
|
|
1040
1052
|
} else if (previewGet && !options.json)
|
|
1041
1053
|
console.log(formatPreview(value));
|