Modules
Every module command takes a module by its short name (users is @frigear-nu/users) or by its full package name,
which is how you name a module outside the @frigear-nu scope (@acme/tickets).
module list
pnpx @frigear-nu/cli module list [--search <text>] [--app <app>] [--json]
| Argument | Default | Purpose |
|---|---|---|
--search | Only modules whose name or description contains this text. | |
--app | see module add | The app whose modules get a ✔. Outside an app nothing is marked. |
--json | Print JSON: name, version, description, links and the version the app has. |
It reads the npm registry: every published @frigear-nu package that is a module (not the CLI, the ESLint config,
Module Kit or the base layer, and nothing deprecated), and every other package with the frigear-module keyword. The
second group gets its own section, since anyone can add a keyword: Frigear has not reviewed those packages.
"keywords": ["frigear-module", "nuxt-module"] in its package.json.module info
pnpx @frigear-nu/cli module info <module> [--app <app>] [--json]
It prints the publisher (Frigear for @frigear-nu packages, else third-party), the module's description, latest version, the version the app has, its documentation and repository, the
modules it pulls in (its Frigear dependencies), the ones it works with (its optional Frigear peer dependencies) and the
command that installs it. A deprecated package says so instead. A short name that is not a @frigear-nu package is
looked up as an unscoped package.
module add
pnpx @frigear-nu/cli module add [module...] [--app <app>] [--all] [--no-install]
| Argument | Default | Purpose |
|---|---|---|
module | pick from a list | One or more modules. Without any, a list of the Frigear modules the app does not have yet opens; space selects, enter installs. |
--all | Add third-party modules to that list, each marked as third-party. | |
--app | see below | The app: a path, or a folder under apps/. |
--no-install | Only edit nuxt.config. |
Without --app, the app is the current directory when it has a nuxt.config, else the only app under apps/ with
one. The command runs pnpm add in the app and adds each module to modules once: the package name, or
<package>/module (then <package>/nuxt) when the package exports its Nuxt module there. It prints each module's
documentation link and the Frigear modules it works with that the app does not have yet. Installing a third-party
module, picked or named, prints a warning first: its code runs in your app.
add is the same command: pnpx @frigear-nu/cli add forms.
pnpm db:generate, as
Adding modules describes.module create
pnpx @frigear-nu/cli module create <name> [--template <template>] [--scope <scope>] [--dir <dir>]
| Argument | Default | Purpose |
|---|---|---|
name | required | Name of the module, for example my-module. It is kebab-cased. |
--template | gh:nuxt/starter#module | A giget template source, for example gh:github.com/my/package. |
--scope | the root package's scope | npm scope, for example @acme. --scope "" leaves the name unscoped. |
--dir | packages | Workspace folder to create the module in. |
It downloads the template into <workspace root>/<dir>/<name> and sets the name in its package.json. It exits
with an error, without changing anything, when that folder already contains a package.json. The rest of a module
(its setup(), runtime files and tests) is yours to write: Scaffold a module
walks through it for the Frigear repository, where the root is @frigear-nu/root and modules are
@frigear-nu/<name>.
module folder and module move refactor local modules: see Refactoring. The old names
module:create, module:folder and module:move still run, with a deprecation warning.
Next steps
- Adding modules – options, migrations and what each module adds.
- Refactoring – turn a local module into a folder module, move it or rename a package.