@sourceacademy/common-module-loader
v0.0.1
Published
The common types for loading modules in Source Academy
Downloads
15
Readme
Features
- Protocol for loading Source Academy modules on the runner side, from a changeable module directory on the host side
Installation
yarn add @sourceacademy/common-module-loader
# OR
npm i @sourceacademy/common-module-loader
# OR
pnpm add @sourceacademy/common-module-loaderStructure
This package (@sourceacademy/common-module-loader) contains the shared constants and types required by both the runner-side and web-side plugin implementations.
These include:
- The IDs and channel name the two plugins use to find each other (
RUNNER_ID,WEB_ID,CHANNEL_ID) - The message type (
ModuleLoaderMessage) sent between the two plugins
Usage
Ideally, you should not need to use this package directly. Instead, use the runner-side plugin (@sourceacademy/runner-module-loader) or the web-side plugin (@sourceacademy/web-module-loader).
However, if you do need to use this package directly, you can import the constants and types as follows:
import type { ModuleLoaderMessage } from '@sourceacademy/common-module-loader';
...Further reading
- To load a module, use
@sourceacademy/runner-module-loader - To provide the module directory URL, use
@sourceacademy/web-module-loader - The plugins wiki covers how Conductor plugins communicate
