RESOLVES FRMW-2862 **What** This PR enable the `create-medusa-app` CLI to accept a new `--plugin` option to scaffold a plugin. This is complementary to all the plugin commands being created/adjusted separately to that pr. Also, this pr brings a little refactoring around resource scaffolding, the idea was to contain the refactoring to a little area and not expend it to the entire create-medusa-app package to not disrupt and expand the scope for which the purpose was to introduce the plugin scaffolding capabilities **Addition** - medusa project will get their package.json name changed to the project name - Remove build step from medusa project creation **Plugin flow** - in the plugin - `npx create-medsa-app --plugin` - `yarn dev` - in the project - `yalc add plugin-name` - `yarn dev` Any changes on the plugin will publish, push in the local registry which will fire the hot reload of the app and include the new changes from the plugin
13 lines
337 B
TypeScript
13 lines
337 B
TypeScript
import {
|
|
ProjectCreatorFactory,
|
|
ProjectOptions,
|
|
} from "../utils/project-creator/index.js"
|
|
|
|
/**
|
|
* Command handler to create a Medusa project or plugin
|
|
*/
|
|
export default async (args: string[], options: ProjectOptions) => {
|
|
const projectCreator = await ProjectCreatorFactory.create(args, options)
|
|
await projectCreator.create()
|
|
}
|