Skip to content

Commit

Permalink
Merge pull request #149 from breakerbar/issue70-add-all-option
Browse files Browse the repository at this point in the history
Issue70 add all option to create-project
  • Loading branch information
delagroove authored Oct 24, 2022
2 parents 7ab5268 + f673a85 commit 5573370
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 5573370

Please sign in to comment.