const { templateFromJsxCommand } = require('./template-from-jsx-shared')

/**
 * Rewrite JSX/TSX into a v2 template: // @template v2, per-const JSDoc (@group, @type), plain literal initializers.
 * For legacy $() syntax and // group / // endgroup use `bild template legacy from-jsx`.
 */
async function templateV2FromJsxCommand(file, opts = {}) {
  return templateFromJsxCommand(file, {
    ...opts,
    groupingStyle: 'jsdoc',
    cliName: opts.cliName || 'from-jsx',
    logLabel: opts.cliName || 'from-jsx',
  })
}

module.exports = templateV2FromJsxCommand
