NarraLeaf

Publish to the store

Release from your own repository, then open one registration pull request on NarraLeaf/Plugins to list the plugin in Studio's store.

A store listing is not what makes a plugin installable: anyone can install your zip with install from a folder. The store answers a different question — how people find it, and how they get updates.

Behind the store is an index in the NarraLeaf/Plugins repository. That repository holds no plugin source: your code and your releases stay in your own repository, and the registry records one release zip per version. Once a registration is reviewed and merged, the zip is copied onto a release of the Plugins repository, and Studio downloads that copy.

StepWhereWhat happens
ReleaseYour repositoryPush a v<version> tag; the workflow builds the zip and publishes a release.
RegisterYour fork of PluginsRun the registration script with the zip's URL and fill in plugin.json.
ReviewA pull request on PluginsCI downloads the zip and compares it byte for byte; a maintainer reviews behaviour and permissions.
ListAutomatic on mergeThe zip is copied to a Plugins release, the index updates, and the store shows the new version.

There is no proposal issue to open first — send the pull request. If the plugin is not a fit for the store, the review says why, and your code is still in your own repository.

Prepare the source repository

template/ in the Plugins repository is a complete repository on its own, with the build script, the packaging script and the release workflow in place. Copy it out as the start of your repository:

cp -r Plugins/template yourname.hello
cd yourname.hello
git init
corepack enable && yarn install && yarn build

Renaming is covered in Create your first plugin. version must be the same in manifest.json and package.json; the packaging script checks it.

The shape of the zip

The store requires the zip to hold exactly one folder, named after the plugin id, containing the build output and manifest.json — the folder a user selects in Install from folder after unzipping:

manifest.json
main.js
runtime.js
icon.png

The template's scripts/package.mjs produces exactly this, after checking that every entry, icon and agent guide the manifest declares is in dist/. Without the template, produce the same layout yourself.

Release

Try it locally

yarn build && node scripts/package.mjs

The zip is written to .out/yourname.hello-1.0.0.zip. Unzip it, install the folder in Studio, and check that the plugin loads and that the permission prompt lists what you expect.

Push a tag

Bump the version in manifest.json and package.json, commit, and push the matching tag:

git tag v1.0.0
git push origin v1.0.0

The template's release.yml type-checks, builds and packages the plugin, and attaches the zip to that tag's GitHub release. A tag that disagrees with the manifest's version fails the workflow instead of publishing the wrong package.

The zip's download URL is what you register — for example https://github.com/yourname/yourname.hello/releases/download/v1.0.0/yourname.hello-1.0.0.zip.

Register

Fork and run the registration script

Fork NarraLeaf/Plugins, branch from master, and run the script with the zip's URL:

node scripts/register.mjs https://github.com/yourname/yourname.hello/releases/download/v1.0.0/yourname.hello-1.0.0.zip \
  --license MIT --category blueprint

The script downloads the zip, copies its manifest.json (and the icon, if one is declared) unchanged into plugins/yourname.hello/, writes plugin.json, and regenerates index.json. The source repository defaults to the GitHub repository the zip is released from; pass --repository <url> when it is somewhere else.

If your package.json has a narraleaf block like the template's, pass --from-package <your repo>/package.json instead, and the licence, categories, keywords, homepage, Studio version range and localized listing are read from it.

Fill in plugin.json

plugin.json holds only what the store needs and the package does not carry. The name, description, publisher, icon, contributions and permissions all come from the manifest and are not repeated here:

plugins/yourname.hello/plugin.json
{
  "$schema": "../../schema/registration.schema.json",
  "repository": "https://github.com/yourname/yourname.hello",
  "download": "https://github.com/yourname/yourname.hello/releases/download/v1.0.0/yourname.hello-1.0.0.zip",
  "license": "MIT",
  "categories": ["blueprint"],
  "keywords": ["dialogue"],
  "studioVersion": ">=2.0.0",
  "locales": {
    "zh-CN": { "name": "你好", "description": "一个入门插件" }
  }
}
FieldRequiredMeaning
repositoryYesThe source repository's https URL.
downloadYesThe https URL of this version's release zip.
licenseYesAn SPDX licence identifier, such as MIT.
categoriesYesOne or more of blueprint, ui, assets, story, workflow, integration, theme, other.
keywordsWords the store's search matches.
homepageAn https URL for the plugin's homepage or documentation.
studioVersionThe semver range of Studio versions the plugin runs on. Studio enforces it: a build outside the range sees which version is required instead of an Install button.
localesThe store name and description per language tag.

Check locally

node scripts/validate.mjs yourname.hello          # offline: the registration and the manifest
node scripts/verify-packages.mjs yourname.hello   # download the zip and compare it with the registration
node scripts/generate-index.mjs                   # after editing plugin.json

Open the pull request

Commit plugins/yourname.hello/ and index.json, open a pull request against master, and fill in the template. Give a reason for every permission — plugins are not sandboxed, so an approved permission is real trust, and requests without a reason are sent back.

What CI checks

The Registry check on the pull request must pass before it can merge. It:

  • validates plugin.json, and validates the copied manifest.json with the same rules Studio applies at install;
  • confirms the directory name equals the plugin id;
  • downloads the zip and confirms it holds one folder named after the id, that the manifest.json and icon beside plugin.json are byte-identical to the ones inside, and that every file the manifest declares — entries, icon, agent guide, bundled binaries and their sha256 — is in the package;
  • requires a declared icon to be .png, .webp, .jpg or .jpeg, square, 64–512 pixels, and no larger than 512 KB;
  • requires the zip for a version that is already published to be the very file that was published;
  • confirms index.json was regenerated.

For an update to a registered plugin, the result also lists how the permissions changed from the registered version.

What review looks at

Passing CI only means the package is complete. A maintainer also looks at:

  • Minimal permissions. File-system and external-API permissions get the closest look. Ask only for what the plugin actually uses.
  • Everything registered is declared. Every blueprint node and widget type passed to register* appears in contributes and is prefixed with the plugin id — otherwise Studio throws at load.
  • Host modules stay external. Do not bundle react, react-dom or narraleaf-studio/*; the host provides them through an import map. The template's build.mjs already does this.
  • Honest version numbers. Removing or renaming a contributed type, or removing a pin, needs a major version bump and a note in the pull request. See the rules in Create your first plugin.

After the merge

Once the pull request is merged to master, the publish workflow downloads the zip again, repeats every check, attaches it to the Plugins repository's yourname.hello@1.0.0 release, and syncs it to the GitCode mirror. The index points only at these copies, so:

  • Downloads from the store do not depend on your repository. Deleting or changing your own release later does not affect a listed version.
  • A published version cannot change. CI rejects a different zip under the same version number — bump the version and release again.
  • Whether a user's Studio reads from GitHub or GitCode, they download the same file.

Studio shows the new plugin the next time the store refreshes, and users with an older version installed see Update available in the Installed list.

Release a new version

Push a new version tag in your repository, wait for the release, then run the registration script again in your fork of Plugins with the new zip's URL:

node scripts/register.mjs https://github.com/yourname/yourname.hello/releases/download/v1.1.0/yourname.hello-1.1.0.zip

The rest of plugin.json is kept; only download and the copied manifest and icon change. Check, commit and open a pull request as above. Review focuses on what the new version adds — new permissions above all.

Official plugins

Official plugins, whose ids start with narraleaf., are developed and reviewed in NarraLeaf/Official-Plugins. They go through the same registration: their release workflow opens the registration pull request on Plugins automatically, and it merges once the Registry check passes. CI compares their packages exactly as it does community plugins.

On this page