@base44-preview/cli 0.0.19-pr.122.1890cd4 → 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 +17 -13
- 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({
|
|
@@ -38201,8 +38202,11 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38201
38202
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38202
38203
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
38203
38204
|
}
|
|
38204
|
-
const createCommand = new Command("create").description("Create a new Base44 project").
|
|
38205
|
-
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
|
+
});
|
|
38206
38210
|
});
|
|
38207
38211
|
|
|
38208
38212
|
//#endregion
|