Documentation

CLI

Plugin commands

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.

Run both commands through your package manager inside an app or plugin folder, for example cd apps/web && pnpm vitnode plugin list. The workspace root does not depend on @vitnode/core, so vitnode is not found there.

List plugins

pnpm vitnode plugin list
ā—† VitNode
  Plugins

  Plugin           Version           Source
  ────────────────────────────────────────────
  @vitnode/blog    2.0.0-canary.13   workspace
  @vitnode/forum   2.0.0-canary.13   workspace
  newsroom         0.1.0             workspace
  site-notes       0.1.0             workspace

  4 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

pnpm vitnode plugin validate              # every plugin, or the one you are in
pnpm vitnode plugin validate site-notes   # one plugin, by id, package name or folder
ā—† VitNode
  Validate plugins

  site-notes  ../../plugins/site-notes
  āœ“ Package  0.1.0
  āœ“ Plugin definition
  āœ“ API definition
  āœ“ Routes  3 routes
  āœ“ Translations  en
  āœ“ AdminCP navigation
  āœ“ Database schema  1 table

  āœ“ 1 plugin valid

Validation reads the plugin's build output, the dist files your app imports, so build the plugin first (its build:plugins script, or pnpm build:plugins at the workspace root). 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/site-notes requires the permission notes.can_create,
      but site-notes does not register it in buildApiPlugin({ permissionStaff: { admin } }).
      dist/src/admin/nav.js

āœ– 1 plugin failed validation: site-notes

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.