Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

848 B
Raw Blame
import type { Command } from 'commander'
import { routesCommand } from '../backend.js'
import { detectProject } from '../context.js'
import { warnDeprecated } from '../deprecation.js'
import { dockerComposeExecOrRun } from '../docker.js'

export function registerRoutesCommand(program: Command): void {
  program
    .command('routes', { hidden: true })
    .description('Deprecated: use `spree api endpoints`')
    .argument('[args...]', 'arguments to pass to bin/rails routes')
    .allowUnknownOption(true)
    .passThroughOptions(true)
    .action(async (args: string[]) => {
      warnDeprecated(
        'spree routes',
        args.length > 0 ? `spree exec bin/rails routes ${args.join(' ')}` : 'spree api endpoints',
      )
      const ctx = detectProject()
      await dockerComposeExecOrRun(routesCommand(args), ctx.projectDir)
    })
}