@base44-preview/cli 0.0.4-pr.48.1f33fcd → 0.0.4-pr.49.389b368
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/cli/index.js
CHANGED
|
@@ -18427,6 +18427,18 @@ async function isLoggedIn() {
|
|
|
18427
18427
|
return false;
|
|
18428
18428
|
}
|
|
18429
18429
|
}
|
|
18430
|
+
/**
|
|
18431
|
+
* Ensures the user is logged in before proceeding.
|
|
18432
|
+
*
|
|
18433
|
+
* @throws {Error} If the user is not logged in.
|
|
18434
|
+
*
|
|
18435
|
+
* @example
|
|
18436
|
+
* await requireAuth();
|
|
18437
|
+
* // Code here will only run if user is authenticated
|
|
18438
|
+
*/
|
|
18439
|
+
async function requireAuth() {
|
|
18440
|
+
if (!await isLoggedIn()) throw new Error("Not logged in. Please run 'base44 login' first.");
|
|
18441
|
+
}
|
|
18430
18442
|
|
|
18431
18443
|
//#endregion
|
|
18432
18444
|
//#region src/core/clients/base44-client.ts
|
|
@@ -18598,12 +18610,7 @@ async function runCommand(commandFn, options) {
|
|
|
18598
18610
|
else Ie(base44Color(" Base 44 "));
|
|
18599
18611
|
await loadProjectEnv();
|
|
18600
18612
|
try {
|
|
18601
|
-
if (options?.requireAuth)
|
|
18602
|
-
if (!await isLoggedIn()) {
|
|
18603
|
-
M.info("You need to login first to continue.");
|
|
18604
|
-
await login();
|
|
18605
|
-
}
|
|
18606
|
-
}
|
|
18613
|
+
if (options?.requireAuth) await requireAuth();
|
|
18607
18614
|
await commandFn();
|
|
18608
18615
|
} catch (e$1) {
|
|
18609
18616
|
if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"templates": [
|
|
3
3
|
{
|
|
4
4
|
"id": "backend-only",
|
|
5
|
-
"name": "
|
|
6
|
-
"description": "
|
|
5
|
+
"name": "Init a basic project",
|
|
6
|
+
"description": "Minimal Base44 backend setup for creating entities",
|
|
7
7
|
"path": "backend-only"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "backend-and-client",
|
|
11
|
-
"name": "
|
|
12
|
-
"description": "Full-stack
|
|
11
|
+
"name": "Bootstrap from an example",
|
|
12
|
+
"description": "Full-stack example with Base44 backend and a Vite + React client application",
|
|
13
13
|
"path": "backend-and-client"
|
|
14
14
|
}
|
|
15
15
|
]
|
package/package.json
CHANGED