Skip to content

Building & Testing

Aarav Malani edited this page Jun 6, 2026 · 2 revisions

This repository has been tested on Node.js v22+ and Yarn v4.12.0.

To build and test the plugins, run the following commands in the root directory of the repository

# Install dependencies
yarn

# Build the plugins
yarn build

# Run tests
yarn test

To build a single installable plugin, navigate to the directory (src/pluginType/pluginName) and run the build there

# Change directory
cd path/to/plugin

# Build the plugin
yarn build 
# OR yarn build --watch to put it into build mode

Note: this will not update the dist/ directory for external plugins, though the artifacts can be copied manually

Local Deployment

The local deployment of plugins depend on whether the plugin is external or installable

External

The general way to host a built external plugin is to set up an HTTP server which hosts the dist/ folder.

# Serves the `dist/` folder to port 3000
yarn dlx serve dist/ --cors

Installable

This section assumes you have a consumer of the installable plugin's package (aka, the @sourceacademy/type-name is part of the dependencies of the project).

# Navigate to the project
cd path/to/consumer

# Link the project to the repository's copy
yarn link path/to/plugins/src/type/name

Clone this wiki locally