Docs/API Reference/Plugins

Plugin CLI

@veap/plugins ships scaffolding and management helpers under src/cli. They are exported as library functions, not registered as a binary by this package (its package.json declares…

2 min read

@veap/plugins ships scaffolding and management helpers under src/cli. They are exported as library functions, not registered as a binary by this package (its package.json declares no bin entry). Applications such as the reference host expose a veap command through their own tooling that calls into these helpers.

The functions live on the package's internal cli module and are surfaced through the root export in the inspected source; verify the exact export path for your installed version before relying on a deep import.

addPlugin(pluginArg, options?)#

Installs and registers a plugin into the project at the detected root.

  • pluginArg — a package name, or (with options.local) a Git URL / repository reference.
  • options.local — resolve a Git repository URL (from npm view <pkg> repository.url when a package name is given) and clone it into plugins/<repoName>.
  • options.skipInstall — skip the dependency install step.

After installation it regenerates the project's plugins registry.

ejectPlugin(name) / ejectPackage(packageName)#

Copies an installed plugin (or a *-template package) out of node_modules into the project's plugins/ directory so it becomes locally editable, then regenerates the registry. Requires the package to be present in dependencies/devDependencies and in node_modules.

generatePlugin(name, options?)#

Scaffolds a new plugin at plugins/<name>-plugin from stubs, substituting the name, title, PascalCase name and date. Refuses to overwrite an existing directory. options.skipInstall skips the install step.

Helpers#

ExportBehavior
detectPackageManager(dir)Resolves pnpm/npm/yarn/bun from the packageManager field, then lockfiles, defaulting to pnpm (pnpm wins on conflicting lockfiles).
applyDockerfileForPackageManager(...)Selects the Dockerfile variant matching the package manager.
findProjectRoot(cwd)Walks up to locate the project root.
regeneratePluginsRegistry()Rewrites the generated plugins registry (for example lib/plugins.gen.ts).
processStubs(srcDir, destDir, variables)Copies stubs with {{placeholder}} substitution and strips a trailing .stub extension.
findStubsDir() / stubPath(name)Locate the package's stub templates.

Naming caveat#

The reference host's docs list commands such as veap add, veap register, veap make:plugin and veap make:migration. The mapping between those command names and these functions is owned by the host's CLI wrapper, not by this package; confirm the actual command names in the application that exposes them.

veap
Preparing0%