Development Shell

The shell command starts a development shell server that simulates the production shell environment.

This allows you to test your micro-frontend applications in a realistic setting with navigation, theming, and communication features.

Usage

# Basic usage
pnpm shell

# With options
pnpm shell --config shell.config.js --port 4000

Options

Option
Alias
Description
Default

--config <path>

-c

Shell config file path

shell.config.js

--port <port>

-p

Shell server port

4000

--debug

-d

Output extra debugging info

false

Configuration

Create a shell.config.js file in your project root:

export default {
  apps: [
    {
      url: 'http://localhost:5173',
      path: '/orders',
      name: 'Order Management',
      type: 'full_page',
      navTitle: 'Orders'
    },
    {
      url: 'http://localhost:5174',
      path: '/products',
      name: 'Product Catalog',
      type: 'full_page',
      navTitle: 'Products'
    },
    {
      url: 'http://localhost:5175',
      path: '/widgets/stats',
      name: 'Stats Widget',
      type: 'plugin'
    }
  ],
  shell: {
    port: 4000,
    theme: 'omnitron',
    title: 'My Development Shell'
  },
  sidebar: {
    items: [
      { key: 'orders', label: 'Orders', icon: 'shopping-cart' },
      { key: 'products', label: 'Products', icon: 'box' },
      {
        key: 'settings',
        label: 'Settings',
        icon: 'settings',
        children: [
          { key: 'general', label: 'General' },
          { key: 'users', label: 'Users' }
        ]
      }
    ]
  },
  data: {
    user: {
      id: 1,
      name: 'Dev User',
      email: '[email protected]',
      role: 'admin'
    },
    tenant: {
      id: 'demo-tenant',
      name: 'Demo Tenant'
    }
  }
};

Configuration Reference

ShellConfig

AppConfig

SidebarItem

Themes

The development shell supports three themes:

omnitron

The default Akinon Omnitron theme with a dark sidebar and professional look.

seller-center

A lighter theme designed for seller-facing applications.

minimal

A minimal theme for testing without visual distractions.

Shared Data

Pass data to your applications via the data property:

Access this data in your client application:

Development Workflow

Running Multiple Applications

Terminal 1 - Start your application:

Terminal 2 - Start the shell:

Open http://localhost:4000 in your browser to see your application running inside the shell.

Testing Plugin Applications

Configure a plugin in your shell config:

The shell provides a plugin testing area where you can:

  • View the plugin in isolation

  • Test with different parameters

  • Switch locales

  • Inspect communication events

Hot Module Replacement

Both the shell and your application support HMR. Changes to your code will be reflected immediately without losing application state.

Common Issues

Port Already in Use

Solution: Use a different port or kill the process using the current port.

Configuration Not Found

Solution: Create a shell.config.js file or specify the correct path:

CORS Issues

If you encounter CORS errors, ensure your application's Vite config allows the shell origin:

Example Configuration

Fullpage Application

Multiple Applications

Next Steps

  • Create Application - Create a new project

  • Examples - See complete examples

Last updated

Was this helpful?