create-disposabl-app 1.3.3 → 1.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/index.mjs +3 -1
- package/package.json +1 -1
- package/setup.mjs +5 -5
- package/template.tar.gz +0 -0
package/index.mjs
CHANGED
|
@@ -128,7 +128,9 @@ async function main() {
|
|
|
128
128
|
readProjectConfig(config);
|
|
129
129
|
const { signal } = setupCancellation;
|
|
130
130
|
await terminal.install(directory, config, signal);
|
|
131
|
-
if (!values["skip-setup"])
|
|
131
|
+
if (!values["skip-setup"]) {
|
|
132
|
+
await setup(directory, { appSlug: config.appSlug ?? name, appName: app.name }, config, terminal, signal);
|
|
133
|
+
}
|
|
132
134
|
} catch (error) {
|
|
133
135
|
const reason = setupCancellation.signal.aborted ? "Setup paused." : error.message;
|
|
134
136
|
throw new Error(`${reason}\nProject files are in ${directory}.\nRun this command from ${dirname(directory)} to resume.\n bunx create-disposabl-app@latest ${name} --resume`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-disposabl-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Create a Disposabl app with Exact and Convex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/disposabl-dev/disposabl-exact/tree/main/packages/create-disposabl-app#readme",
|
package/setup.mjs
CHANGED
|
@@ -65,7 +65,7 @@ async function connect(client, terminal, signal, provider, label, providerLink,
|
|
|
65
65
|
throw new Error(label + " connection timed out. Resume to check again.");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export async function setup(directory,
|
|
68
|
+
export async function setup(directory, { appSlug, appName }, config, terminal, signal) {
|
|
69
69
|
const require = createRequire(join(directory, "package.json"));
|
|
70
70
|
const cli = dirname(require.resolve("@disposabl/cli/package.json"));
|
|
71
71
|
const { createClient, providerLink } = await import(join(cli, "client.mjs"));
|
|
@@ -93,9 +93,9 @@ export async function setup(directory, name, config, terminal, signal) {
|
|
|
93
93
|
const app = await client.request("/api/apps/create", {
|
|
94
94
|
method: "POST", signal, timeout: 120_000,
|
|
95
95
|
headers: { "Content-Type": "application/json" },
|
|
96
|
-
body: JSON.stringify({ appSlug
|
|
96
|
+
body: JSON.stringify({ appSlug, appName }),
|
|
97
97
|
}, true);
|
|
98
|
-
if (app.appSlug !==
|
|
98
|
+
if (app.appSlug !== appSlug) {
|
|
99
99
|
throw new Error("Disposabl did not return the expected app slug.");
|
|
100
100
|
}
|
|
101
101
|
if ((config.appSlug && config.appSlug !== app.appSlug) || (config.appId && config.appId !== app.appId)) {
|
|
@@ -106,8 +106,8 @@ export async function setup(directory, name, config, terminal, signal) {
|
|
|
106
106
|
delete config.appId;
|
|
107
107
|
config.appSlug = app.appSlug;
|
|
108
108
|
config.serviceOrigin = client.origin;
|
|
109
|
-
if (typeof app.
|
|
110
|
-
config.apiOrigin = app.
|
|
109
|
+
if (typeof app.url === "string" && /^https:\/\/[a-z0-9-]+\.disposabl\.xyz$/.test(app.url)) {
|
|
110
|
+
config.apiOrigin = app.url;
|
|
111
111
|
}
|
|
112
112
|
await writeJson(join(directory, "disposabl.json"), config);
|
|
113
113
|
terminal.progress("App linked to " + repository + ". App slug saved in disposabl.json.");
|
package/template.tar.gz
CHANGED
|
Binary file
|