@base44-preview/cli 0.0.19-pr.121.59dce66 → 0.0.19-pr.122.292d0c9
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 +20 -29
- package/dist/templates/templates.json +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import O from "node:readline";
|
|
|
10
10
|
import Stream, { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
|
|
11
11
|
import os, { constants, homedir, tmpdir } from "node:os";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
|
-
import fs$1, { access, constants as constants$1, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
13
|
+
import fs$1, { access, constants as constants$1, copyFile, mkdir, readFile, readdir, unlink, writeFile } from "node:fs/promises";
|
|
14
14
|
import { finished } from "node:stream/promises";
|
|
15
15
|
import path$1, { dirname as dirname$1, parse } from "path";
|
|
16
16
|
import EE, { EventEmitter as EventEmitter$1 } from "events";
|
|
@@ -9781,6 +9781,9 @@ async function deleteFile(filePath) {
|
|
|
9781
9781
|
if (!await pathExists(filePath)) return;
|
|
9782
9782
|
await unlink(filePath);
|
|
9783
9783
|
}
|
|
9784
|
+
async function isDirEmpty(dir = process.cwd()) {
|
|
9785
|
+
return (await readdir(dir)).length === 0;
|
|
9786
|
+
}
|
|
9784
9787
|
|
|
9785
9788
|
//#endregion
|
|
9786
9789
|
//#region src/core/auth/config.ts
|
|
@@ -38083,17 +38086,14 @@ async function createInteractive(options) {
|
|
|
38083
38086
|
}),
|
|
38084
38087
|
name: () => he({
|
|
38085
38088
|
message: "What is the name of your project?",
|
|
38086
|
-
placeholder:
|
|
38089
|
+
placeholder: basename(process.cwd()),
|
|
38090
|
+
initialValue: basename(process.cwd()),
|
|
38087
38091
|
validate: (value) => {
|
|
38088
38092
|
if (!value || value.trim().length === 0) return "Every project deserves a name";
|
|
38089
38093
|
}
|
|
38090
38094
|
}),
|
|
38091
|
-
description: () => he({
|
|
38092
|
-
message: "Description (optional)",
|
|
38093
|
-
placeholder: "A brief description of your project"
|
|
38094
|
-
}),
|
|
38095
38095
|
projectPath: async ({ results }) => {
|
|
38096
|
-
const suggestedPath = `./${(0, import_lodash.default)(results.name)}`;
|
|
38096
|
+
const suggestedPath = await isDirEmpty() ? `./` : `./${(0, import_lodash.default)(results.name)}`;
|
|
38097
38097
|
return he({
|
|
38098
38098
|
message: "Where should we create your project?",
|
|
38099
38099
|
placeholder: suggestedPath,
|
|
@@ -38104,7 +38104,6 @@ async function createInteractive(options) {
|
|
|
38104
38104
|
return await executeCreate({
|
|
38105
38105
|
template: result.template,
|
|
38106
38106
|
name: result.name,
|
|
38107
|
-
description: result.description || void 0,
|
|
38108
38107
|
projectPath: result.projectPath,
|
|
38109
38108
|
deploy: options.deploy,
|
|
38110
38109
|
skills: options.skills,
|
|
@@ -38115,7 +38114,6 @@ async function createNonInteractive(options) {
|
|
|
38115
38114
|
return await executeCreate({
|
|
38116
38115
|
template: await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID),
|
|
38117
38116
|
name: options.name,
|
|
38118
|
-
description: options.description,
|
|
38119
38117
|
projectPath: options.path,
|
|
38120
38118
|
deploy: options.deploy,
|
|
38121
38119
|
skills: options.skills,
|
|
@@ -38182,27 +38180,20 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38182
38180
|
finalAppUrl = appUrl;
|
|
38183
38181
|
}
|
|
38184
38182
|
}
|
|
38185
|
-
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
38189
|
-
|
|
38190
|
-
|
|
38191
|
-
|
|
38192
|
-
|
|
38193
|
-
|
|
38194
|
-
"add-skill",
|
|
38195
|
-
"base44/skills",
|
|
38196
|
-
"-y"
|
|
38197
|
-
], {
|
|
38198
|
-
cwd: resolvedPath,
|
|
38199
|
-
shell: true
|
|
38200
|
-
});
|
|
38201
|
-
}, {
|
|
38202
|
-
successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
|
|
38203
|
-
errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
|
|
38183
|
+
if (skills ?? true) await runTask("Installing AI agent skills...", async () => {
|
|
38184
|
+
await execa("npx", [
|
|
38185
|
+
"-y",
|
|
38186
|
+
"add-skill",
|
|
38187
|
+
"base44/skills",
|
|
38188
|
+
"-y"
|
|
38189
|
+
], {
|
|
38190
|
+
cwd: resolvedPath,
|
|
38191
|
+
shell: true
|
|
38204
38192
|
});
|
|
38205
|
-
}
|
|
38193
|
+
}, {
|
|
38194
|
+
successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
|
|
38195
|
+
errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
|
|
38196
|
+
});
|
|
38206
38197
|
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38207
38198
|
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
|
|
38208
38199
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"templates": [
|
|
3
|
-
{
|
|
4
|
-
"id": "backend-only",
|
|
5
|
-
"name": "Create a basic project",
|
|
6
|
-
"description": "Minimal Base44 backend for defining your data models and logic",
|
|
7
|
-
"path": "backend-only"
|
|
8
|
-
},
|
|
9
3
|
{
|
|
10
4
|
"id": "backend-and-client",
|
|
11
5
|
"name": "Start from a template",
|
|
12
6
|
"description": "Full-stack example with a Base44 backend and a Vite + React client application",
|
|
13
7
|
"path": "backend-and-client"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "backend-only",
|
|
11
|
+
"name": "Create a basic project",
|
|
12
|
+
"description": "Minimal Base44 backend for defining your data models and logic",
|
|
13
|
+
"path": "backend-only"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|