Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@edclub/vite-plugins

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edclub/vite-plugins

Vite plugins for edclub-expriences

latest
npmnpm
Version
0.0.9
Version published
Weekly downloads
89
-27.64%
Maintainers
5
Weekly downloads
 
Created
Source

@edclub/vite-plugins

Vite plugins for EDClub experiences that handle manifest processing and app configuration.

Overview

This package provides three plugins that transform manifest.json files into app-specific configurations served as app-manifest.json:

  • PlayerPlugin: For player apps (generates sampleLessons)
  • EditorPlugin: For editor apps (generates lessonTypes)
  • ReplayPlugin: For replay apps (generates sampleAttempts)

Features

The plugins now support automatic discovery of configuration files from subdirectories:

configs/
├── sample-lessons/   # For PlayerPlugin (sampleLessons)
├── template-lessons/ # For EditorPlugin (lessonTypes)
└── sample-attempts/  # For ReplayPlugin (sampleAttempts)

Each JSON file in these directories should contain complete metadata:

Example lesson file (configs/sample-lessons/green-version.json):

{
  "name": "Green Version",
  "activity": {
    "text": "green mode",
    "rgb": [50, 150, 50]
  }
}

Example lesson type file (configs/template-lessons/spelling.json):

{
  "name": "Spelling Definitions",
  "description": "Learn new words with audio",
  "image": "/lesson-type-imgs/spelling_cards.png",
  "template": {
    "type": "spelling",
    "settings": {}
  }
}

Example attempt file (configs/sample-attempts/attempt-1.json):

{
  "name": "Attempt 1",
  "attempt": {
    "progress": 100,
    "value": "done"
  },
  "lesson": {
    "name": "Green Version",
    "activity": {
      "text": "green mode",
      "rgb": [50, 150, 50]
    }
  }
}

Example attempt with lesson reference (configs/sample-attempts/attempt-2.json):

{
  "name": "Attempt 2",
  "attempt": {
    "progress": 30,
    "value": "done - attempt 2"
  },
  "lesson": "green-version.json"
}

When using lesson references, the plugin will automatically resolve the file from the configs/sample-lessons/ directory.

Legacy Mode (Backward Compatible)

If the auto-discovery directories don't exist, the plugins fall back to reading from manifest.json:

{
  "app": "edclub.testapp",
  "name": "Test App",
  "version": "1",
  "sampleLessons": [
    {
      "name": "Lesson 1",
      "src": "configs/lesson1.json"
    }
  ]
}

Usage

In your Vite config:

import { PlayerPlugin } from "@edclub/vite-plugins";

export default defineConfig({
  plugins: [
    react(),
    PlayerPlugin(), // Uses manifest.json from parent directory
  ],
});

The plugin will:

  • Generate an app-manifest.json file in the build output
  • Serve the manifest at /app-manifest.json during development

Development

# Build the plugin
pnpm build

# Run tests
pnpm test

# Watch mode
pnpm dev

Testing

The package includes comprehensive tests for all plugins:

# Run tests once
pnpm test:once

# Run tests in watch mode
pnpm test

FAQs

Package last updated on 14 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts