#!/usr/bin/env node

import { dirname } from 'path'
import { fileURLToPath } from 'url'

const __dirname = dirname(fileURLToPath(import.meta.url))
const command = process.argv[2]

async function runCommand(command) {
  switch (command) {
    case 'init':
      await import('./init.js')
      break
    case 'dev':
      await import('./dev.js')
      break
    case 'build':
      await import('./build.js')
      break
    default:
      console.log(`
Usage:
  bmdl-sdk init     - Initialize new component project
  bmdl-sdk dev      - Start development server
  bmdl-sdk build    - Build component for production

Example:
  mkdir my-component
  cd my-component
  npm init -y
  npx bmdl-sdk init
  yarn install
  yarn run dev
      `)
  }
}

runCommand(command)
