CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-medusajs--admin

Admin dashboard plugin for Medusa e-commerce platform providing web interface for managing products, orders, customers, and store configuration.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

cli-commands.mddocs/

CLI Commands

Command-line interface for building, developing, and bundling the admin dashboard and extensions. Provides tools for both development and production workflows.

Capabilities

Build Command

Builds the admin dashboard for production deployment with optimization and asset compilation.

/**
 * Build the admin dashboard for production
 * @param options - Build configuration options
 */
function build(options: BuildOptions): Promise<void>;

interface BuildOptions extends AdminOptions {
  /** Build for deployment to external host */
  deployment?: boolean;
}

Usage:

# Basic build
medusa-admin build

# Build with custom path
medusa-admin build --path /admin

# Build with custom backend URL
medusa-admin build --backend http://localhost:9000

# Build for external deployment
medusa-admin build --deployment --backend https://api.mystore.com

Develop Command

Starts the admin dashboard in development mode with hot-reload and webpack dev server integration.

/**
 * Start admin dashboard in development mode
 * @param options - Development server options
 */
function develop(options: DevelopArgs): Promise<void>;

interface DevelopArgs extends AdminOptions {
  /** Port for development server */
  port: number;
}

Usage:

# Start development server
medusa-admin develop

# Start with custom port
medusa-admin develop --port 3000

# Start with custom backend and path
medusa-admin develop --port 3000 --backend http://localhost:9000 --path /admin

Bundle Command

Bundles admin extensions (routes, widgets, settings) for plugins using Rollup with TypeScript compilation.

/**
 * Bundle extensions to the admin dashboard
 */
function bundle(): Promise<void>;

Usage:

# Bundle admin extensions
medusa-admin bundle

Requirements for bundling:

  • src/admin directory with extensions
  • package.json with valid package name
  • Extension files following Medusa admin conventions

CLI Creation

Creates the main CLI program with all available commands.

/**
 * Creates the main CLI program with all available commands
 * @returns Commander.js program instance
 */
function createCli(): Promise<Command>;

Build Process

The build process involves several steps:

  1. Configuration Loading: Loads Medusa config and plugin options
  2. Plugin Discovery: Finds enabled admin UI plugins
  3. Asset Compilation: Compiles TypeScript and processes assets
  4. Bundle Generation: Creates optimized production bundles
  5. Manifest Creation: Generates build manifest for change detection

Development Workflow

Development mode provides:

  • Hot Reload: Automatic recompilation on file changes
  • Source Maps: Enhanced debugging experience
  • Proxy Integration: Seamless backend API integration
  • Extension Loading: Dynamic loading of custom extensions

Extension Bundling

The bundle command processes admin extensions:

  1. Discovery: Scans src/admin for routes, widgets, and settings
  2. Virtual Entry: Creates virtual entry point for Rollup
  3. Compilation: Transpiles TypeScript with ESBuild
  4. Output: Generates ESM bundles in dist/admin

Supported Extension Types:

  • Routes: Custom admin pages at specific paths
  • Widgets: Components embedded in existing admin pages
  • Settings: Configuration pages in admin settings section

Error Handling

CLI commands provide detailed error reporting:

  • Configuration Errors: Invalid plugin configurations
  • Build Failures: TypeScript compilation or bundling errors
  • Missing Dependencies: Required packages not installed
  • File System Errors: Permission or disk space issues

docs

cli-commands.md

index.md

plugin-integration.md

types.md

tile.json