@disposabl/cli 2.1.1 → 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/LICENSE +21 -0
- package/dist/index.js +19 -7
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Disposabl
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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));
|