Edit

Adding a New Plugin

  1. Create the plugin directory:

    mkdir -p plugins/my-new-plugin
    cd plugins/my-new-plugin
  2. Initialize package.json:

    {
      "name": "@opencenter/headlamp-plugin-my-new-plugin",
      "version": "1.0.0",
      "main": "dist/main.js",
      "scripts": {
        "dev": "webpack --mode development --watch",
        "build": "webpack --mode production",
        "test": "jest",
        "lint": "eslint src --ext .ts,.tsx"
      },
      "peerDependencies": {
        "@kinvolk/headlamp-plugin": "^0.13.0",
        "react": "^18.0.0",
        "react-dom": "^18.0.0"
      }
    }
  3. Create the source structure:

    mkdir -p src __tests__ assets
    touch src/index.tsx
  4. The plugin is automatically included in workspace commands.

CI/CD

On every pull request, the CI pipeline runs:

  • Dependency installation (bun install)

  • Linting (ESLint)

  • Format checking (Prettier)

  • Tests (Jest)

  • Build (Webpack)

Workspace Commands

# Build a specific plugin
bun run --filter @opencenter/headlamp-plugin-branding build

# Run all tests
bun run test

# Lint all plugins
bun run lint