Skip to content

Commit

Permalink
feat: add all option to create-project
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Palombi <[email protected]>
  • Loading branch information
breakerbar committed Oct 20, 2022
1 parent 69236fa commit f673a85
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion commands/create-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<type>", "which project type to create").choices(["api", "storefront", "admin", "demo"]))
.addArgument(new commander.Argument("<type>", "which project type to create").choices(["api", "storefront", "admin", "all", "demo"]))
.argument("<name>", "what to name the project")
// .option("--populate")
.option("--skip-meteor-install", "Skip Meteor install when creating admin project")
Expand Down

0 comments on commit f673a85

Please sign in to comment.