At the core of any Nodepack project, plugins allow you to build your applications.
Nodepack plugins are packages using the Nodepack APIs. They provide features and tools integrated with each other that you can easily plug into your project.
Each plugin has different parts:
- A service plugin which is executed when
@nodepack/serviceis run (for example, with the
- App migrations that can install dependencies and modify your project code when the plugin is installed, upgraded or removed.
- Environment migrations.
- Database migrations.
For example, when you install the official Typescript plugin, it can:
tsconfig.jsonin your project
- Rename your files to
- Setup TSLint
Then, when you run
nodepack-service dev, it will automatically:
- Check for typing errors
The Nodepack Service is a special plugin installed in any Nodepack project.
To be a valid Nodepack plugin, the package needs its name to be either:
nodepack-plugin-<name>for normal packages
@<scope>/nodepack-plugin-<name>for scoped packages
@nodepack/plugin-<name>for official plugins
Adding a plugin
In your Nodepack project, you can add one plugin at a time with this command:
nodepack add <plugin>
In some case, the plugin name will be automatically expanded. For example, those are equivalent:
nodepack add awesome # is equivalent to nodepack add nodepack-plugin-awesome
It also works with scopes:
nodepack add @scope/awesome # is equivalent to nodepack add @scope/nodepack-plugin-awesome
Official plugin names will be expanded too:
nodepack add typescript # is equivalent to nodepack add @nodepack/plugin-typescript
Adding a plugin may modify your project files. By default, a Git commit will save the state of your app before and after adding the plugin.
You can upgrade one or more plugins which this command:
Nodepack will then check for plugin updates and propose you different upgrade options.
Upgrading a plugin may modify your project files. By default, a Git commit will save the state of your app before and after the upgrade process.
Removing a plugin
To remove a plugin, use the following command:
nodepack remove typescript
The same automatic name rules as
nodepack add applies.
Removing a plugin may modify your project files. By default, a Git commit will save the state of your app before and after removing the plugin.