chore(): start moving some packages to the core directory (#7215)

This commit is contained in:
Adrien de Peretti
2024-05-03 13:37:41 +02:00
committed by GitHub
parent fdee748eed
commit bbccd6481d
1436 changed files with 275 additions and 756 deletions
@@ -0,0 +1,46 @@
#! /usr/bin/env node
import { Command } from "commander"
import { getCommand as oasGetCommand } from "./command-oas"
import { getCommand as clientGetCommand } from "./command-client"
import { getCommand as docsGetCommand } from "./command-docs"
const run = async () => {
const program = getBaseCommand()
/**
* Alias to command-oas.ts
*/
program.addCommand(oasGetCommand())
/**
* Alias to command-client.ts
*/
program.addCommand(clientGetCommand())
/**
* Alias to command-docs.ts
*/
program.addCommand(docsGetCommand())
/**
* Run CLI
*/
await program.parseAsync()
}
export function getBaseCommand() {
const command = new Command()
command.name("medusa-oas")
command.action(async () => {
console.log("No command provided.")
command.outputHelp({ error: true })
})
command.showHelpAfterError(true)
command.helpOption(false)
return command
}
void (async () => {
await run()
})()