scmJS docs

Using plugins

This part is for map makers: how to install and update plugins, and what you are trusting when you do.

What is available#

These plugins come with the editor and start on: Walkability, Paint, Repair, Terrain from Image, TrigScript, Stamp Library, scmscx.com, scmjs.dev, scm-sim and Aftermath. TrigEdit, the Text Trigger Editor, comes with the editor too but starts off; tick it on in Plugins ▸ Manage Plugins… when you need it.

The rest are in Plugins ▸ Browse Plugins…: Melee Wizard, Section Explorer, Magenta, Trigger Map, Timelapse, the Mod Editor, Hello World and the API Playground among them. The user guide says what each one does and where it appears, and each repository has its own README.

The plugins that come with the editor are defaults: they are built in, so a fresh install has them without going to the network. A default can be turned off but not removed.

Installing one#

Browse Plugins

In every case the editor shows where the code comes from and asks before it adds anything. An address can take any of these forms:

Address What it points at
github:owner/repo A GitHub repository, at its default branch.
github:owner/repo@v1.2 A tag, branch or commit of it.
github:owner/repo@v1.2/plugins/mine A folder inside a repository, for several plugins in one.
https://github.com/owner/repo/tree/v1.2/plugins/mine The same, copied from the browser's address bar.
https://…/plugin.json A plugin's manifest anywhere: GitLab, a gist, your own server.
https://…/plugin.ts A single plugin file with no manifest.
http://localhost:3000/ A folder holding plugin.json on your own machine, while you write a plugin.

What you are trusting#

There is no sandbox. A plugin has the same access as the editor: it can read and change the open map, read and write the files in the map archive and the editor's browser storage, and make network requests. It is the same trust a browser extension asks for, so only add plugins you trust.

Before any code is fetched, the Add screen shows what the plugin says about itself (name, version, author, description and icon from its plugin.json), links to its repository, and the addresses the code will come from. Nothing has run yet, so this is the moment to look at the repository. The screen has three options:

Option Default What it does
Enable it now on Start the plugin as soon as it is added.
Pin to this version on Store the exact commit the address points at today, so the plugin never changes under you.
Load from a copy saved here off Keep a copy of the plugin's files in this browser and load from that until you press Reload.

A plugin that needs another one (see Requiring another plugin) lists it under Also installs.

Keeping a plugin up to date#

A pinned plugin never changes by itself; a push to its repository reaches nobody who has it installed. To move forward, use the buttons in Plugins ▸ Manage Plugins…:

Only releases (version tags) count; commits pushed after the newest release are not offered. Browse Plugins also marks v… available on a row when its list carries a newer version than the one you run.

Preferences ▸ Plugins ▸ Plugin updates decides whether the editor looks for you. It reads the plugin list at most once every six hours.

Choice What happens
Tell me (default) A notice names what is newer, with a button to Manage Plugins.
Do nothing Nothing is checked until you press a row's button.
Install them Newer versions of the plugins you added yourself are installed. Defaults, plugins loading from a saved copy, plugins that are off, and versions that need a newer editor are only named in the notice.

Defaults move with the editor: each release carries the versions it was tested with, and a default is never checked until you press its button. Updating one makes it an ordinary plugin fetched from its repository at each start; Revert on the row goes back to the version the editor ships.

The other buttons on a row:

A plugin that fails to load raises a notice with a button to Manage Plugins, where its row shows the error.

Where a plugin keeps its data#

Sources#

Browse Plugins reads registries: JSON files listing plugins and the address each installs from. The project's own is scm-js/registry, and the Sources button adds others. A registry only decides what is offered; installing from it goes through the same Add screen and pinning as a pasted address.

Plugins you have that no registry lists (one you added by address, or one a list dropped) are shown under Already installed, marked not listed.

scmJS 0.18.0 · Generated from the repository. The source is under the MIT license, which does not cover what ATTRIBUTION.md lists. StarCraft and Brood War are trademarks of Blizzard Entertainment; this project ships none of their data.