Logo VitNode

CLI

List and validate plugins

List the plugins a VitNode app uses with vitnode plugin list, and check them with vitnode plugin validate before a build or in CI.

vitnode plugin list shows which plugins your app uses and where they come from. vitnode plugin validate loads each plugin the way your app will, so a broken plugin fails here with a clear message instead of halfway through a build.

To create a plugin, use the generator, which also registers, installs and builds it. See Create a plugin.

List plugins

Run it from your app, or from anywhere in its workspace:

vitnode plugin list
◆ VitNode
  Plugins

  Plugin                         Version           Source
  ───────────────────────────────────────────────────────────
  @vitnode/blog                  2.0.0-canary.13   workspace
  @acme/search                   1.1.2             package
  @acme/forum (not configured)   0.1.0             workspace

  2 plugins configured in this app

The list comes from your app's vitnode.config.ts, read by the same loader the app's build uses.

ValueMeaning
workspaceA package in this repository
packageInstalled from a registry into node_modules
(not configured)A workspace plugin your app does not use yet
not installedThe app's config names the plugin, but the package is missing

--verbose adds each plugin's path and description.

Validate plugins

vitnode plugin validate        # every plugin, or the one you are in
vitnode plugin validate blog   # one plugin, by id, package name or folder
◆ VitNode
  Validate plugins

  @vitnode/blog  plugins/blog
  ✓ Package  2.0.0-canary.13
  ✓ Plugin definition
  ✓ API definition
  ✓ Routes  3 routes
  ✓ Translations  en
  ✓ AdminCP navigation
  ✓ Database schema  6 tables

  ✓ 1 plugin valid

Validation reads the plugin's build output, the dist files your app imports, so build the plugin first. Each check runs only when the plugin has that part:

CheckFails when
Packagepackage.json is missing, name is not a valid plugin id, type is not module, or exports lacks ./* or ./config
Build outputdist/src/config.js is missing: build the plugin first
Plugin definitiondist/src/config.js exports no buildPlugin() factory, or its pluginId is not the package name
API definitiondist/src/config.api.js exports no working buildApiPlugin() factory, or its pluginId does not match
RoutesThe route tree does not compile, or a lazy(() => import(...)) page file is missing
TranslationsA locale file is unreadable, lacks the plugin's top-level key, or a route's messages namespace is missing
AdminCP navigationA nav item requires a permission the plugin does not register in permissionStaff.admin
Database schemaA schema module fails to load, or two modules declare the same table

A translation file that is only missing some keys gets a ! warning, not a failure, so a half-translated language does not block a release.

A failure says what is wrong and where:

  ✖ AdminCP navigation
      AdminCP navigation item /admin/blog requires the permission posts.can_manage,
      but @acme/blog does not register it in buildApiPlugin({ permissionStaff: { admin } }).
      dist/src/admin/nav.js

✖ 1 plugin failed validation: @acme/blog

vitnode plugin validate exits with code 1 when any plugin is invalid, so it can gate a CI job. An unknown plugin name exits with code 2 and lists the plugins it knows.

Next steps