@base44-preview/cli 0.0.19-pr.122.292d0c9 → 0.0.19-pr.122.3a5a833
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 +32 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38058,9 +38058,8 @@ async function getTemplateById(templateId) {
|
|
|
38058
38058
|
return template;
|
|
38059
38059
|
}
|
|
38060
38060
|
function validateNonInteractiveFlags$1(command) {
|
|
38061
|
-
const {
|
|
38062
|
-
|
|
38063
|
-
if (providedCount > 0 && providedCount < 2) command.error("Non-interactive mode requires all flags: --name, --path");
|
|
38061
|
+
const { path: path$16 } = command.opts();
|
|
38062
|
+
if (path$16 && !command.args.length) command.error("Non-interactive mode requires all flags: --name, --path");
|
|
38064
38063
|
}
|
|
38065
38064
|
async function chooseCreate(options) {
|
|
38066
38065
|
if (!!(options.name && options.path)) await runCommand(() => createNonInteractive(options), {
|
|
@@ -38084,14 +38083,16 @@ async function createInteractive(options) {
|
|
|
38084
38083
|
message: "Pick a template",
|
|
38085
38084
|
options: templateOptions
|
|
38086
38085
|
}),
|
|
38087
|
-
name: () =>
|
|
38088
|
-
|
|
38089
|
-
|
|
38090
|
-
|
|
38091
|
-
|
|
38092
|
-
|
|
38093
|
-
|
|
38094
|
-
|
|
38086
|
+
name: () => {
|
|
38087
|
+
return options.name ? Promise.resolve(options.name) : he({
|
|
38088
|
+
message: "What is the name of your project?",
|
|
38089
|
+
placeholder: basename(process.cwd()),
|
|
38090
|
+
initialValue: basename(process.cwd()),
|
|
38091
|
+
validate: (value) => {
|
|
38092
|
+
if (!value || value.trim().length === 0) return "Every project deserves a name";
|
|
38093
|
+
}
|
|
38094
|
+
});
|
|
38095
|
+
},
|
|
38095
38096
|
projectPath: async ({ results }) => {
|
|
38096
38097
|
const suggestedPath = await isDirEmpty() ? `./` : `./${(0, import_lodash.default)(results.name)}`;
|
|
38097
38098
|
return he({
|
|
@@ -38180,27 +38181,32 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38180
38181
|
finalAppUrl = appUrl;
|
|
38181
38182
|
}
|
|
38182
38183
|
}
|
|
38183
|
-
if (skills ?? true)
|
|
38184
|
-
await
|
|
38185
|
-
"
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
38189
|
-
|
|
38190
|
-
|
|
38191
|
-
|
|
38184
|
+
if (skills ?? true) try {
|
|
38185
|
+
await runTask("Installing AI agent skills...", async () => {
|
|
38186
|
+
await execa("npx", [
|
|
38187
|
+
"-y",
|
|
38188
|
+
"add-skill",
|
|
38189
|
+
"base44/skills",
|
|
38190
|
+
"-y"
|
|
38191
|
+
], {
|
|
38192
|
+
cwd: resolvedPath,
|
|
38193
|
+
shell: true
|
|
38194
|
+
});
|
|
38195
|
+
}, {
|
|
38196
|
+
successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
|
|
38197
|
+
errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
|
|
38192
38198
|
});
|
|
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
|
-
});
|
|
38199
|
+
} catch {}
|
|
38197
38200
|
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38198
38201
|
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
|
|
38199
38202
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38200
38203
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
38201
38204
|
}
|
|
38202
|
-
const createCommand = new Command("create").description("Create a new Base44 project").
|
|
38203
|
-
await chooseCreate(
|
|
38205
|
+
const createCommand = new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--skills", "Add AI agent skills").hook("preAction", validateNonInteractiveFlags$1).action(async (name$1, options) => {
|
|
38206
|
+
await chooseCreate({
|
|
38207
|
+
name: name$1,
|
|
38208
|
+
...options
|
|
38209
|
+
});
|
|
38204
38210
|
});
|
|
38205
38211
|
|
|
38206
38212
|
//#endregion
|