Skip to content

Latest commit

Β 

History

History
46 lines (34 loc) Β· 1.29 KB

File metadata and controls

46 lines (34 loc) Β· 1.29 KB

digital.auto Plugin Demo

Overview

A template project for building digital.auto plugins. See README.md for full documentation.

Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ plugin/              # Plugin code (gets bundled to dist/)
β”‚   β”‚   β”œβ”€β”€ index.ts         # Entry point with mount/unmount
β”‚   β”‚   └── Page.tsx         # Main React component
β”‚   β”‚
β”‚   └── demo/                # Local test harness
β”‚       β”œβ”€β”€ pages/home.tsx   # Loads and mounts the plugin
β”‚       └── index.css        # CSS variables (fallbacks)
β”‚
β”œβ”€β”€ dist/
β”‚   └── index.js             # Built plugin (deploy this)
β”‚
β”œβ”€β”€ README.md                # Full documentation
└── package.json

Quick Commands

  • npm run dev - Start dev server with auto-rebuild
  • npm run build:plugin - Build plugin manually

Plugin Output

Built to dist/index.js, accessible at /index.js

Key Points

  1. Plugin uses globalThis.React (host provides React)
  2. Uses CSS variables with fallbacks for theming
  3. Inline styles for portability (no Tailwind)
  4. CORS enabled for cross-origin loading

User Preferences

  • No Tailwind CSS - use inline styles
  • Clean, minimal project structure
  • CSS variables from mother page with fallbacks