From f673a8503e74f12dc20327070308e6b5345abb25 Mon Sep 17 00:00:00 2001 From: Matthew Palombi Date: Tue, 18 Oct 2022 10:37:34 -0400 Subject: [PATCH] feat: add all option to create-project Signed-off-by: Matthew Palombi --- commands/create-project.js | 15 ++++++++++++++- index.js | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/commands/create-project.js b/commands/create-project.js index 8c5ceb0..25bb9ef 100644 --- a/commands/create-project.js +++ b/commands/create-project.js @@ -9,13 +9,26 @@ const methodMap = { api: createProjectApi, admin: createProjectAdmin, storefront: createProjectStorefront, - demo: createProjectDemo + demo: createProjectDemo, + all: createProjectAll }; const extraDependencyMap = { storefront: ["yarn"] }; +/** + * @summary creates api, admin, and storefront projects at same time in separate directories. + * @param {String} projectName - The name of the project to create + * @param {Object} options - Project options + */ +export async function createProjectAll(projectName, options) { + createProjectApi(projectName + "Api", options); + createProjectAdmin(projectName + "Admin", options); + createProjectStorefront(projectName + "Storefront", options); + return true; +} + /** * @summary create one of the project types * @param {String} projectType - One of the project types diff --git a/index.js b/index.js index f55fbd1..a75ec21 100755 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ program program .command("create-project") .description("Create a new Open Commerce project of one of several types") - .addArgument(new commander.Argument("", "which project type to create").choices(["api", "storefront", "admin", "demo"])) + .addArgument(new commander.Argument("", "which project type to create").choices(["api", "storefront", "admin", "all", "demo"])) .argument("", "what to name the project") // .option("--populate") .option("--skip-meteor-install", "Skip Meteor install when creating admin project")