|
[[adding-js-dependencies]]
|
|
= NPM dependencies
|
|
:toc: right
|
|
:toclevels: 5
|
|
|
|
## Using/Adding/updating NPM dependencies
|
|
|
|
Foreman manage npm dependencies with a seperate project called `@theforeman/vendor` which responsible to deliver 3rd-party modules to foreman and its plugins.
|
|
Foreman and its plugins consumes `@theforeman/vendor` project from `npm` in development and from `rpm` in production.
|
|
|
|
`@theforeman/vendor` lives inside a monorepo together with other foreman javascript tools in a project called https://github.com/theforeman/foreman-js[foreman-js]
|
|
|
|
|
|
https://github.com/theforeman/foreman-js/tree/master/packages/vendor[Read more about @theforeman/vendor]
|
|
|
|
## Consuming `foreman-js` projects from source (locally)
|
|
|
|
Clone, install, build and link the `foreman-js` project to foreman:
|
|
|
|
```sh
|
|
git clone git@github.com:theforeman/foreman-js.git
|
|
cd foreman-js
|
|
npm install
|
|
npm run build
|
|
npm run link -- --location ../foreman
|
|
```
|
|
|
|
To read to full documentation, please go to `foreman-js` contribution guide:
|
|
https://github.com/theforeman/foreman-js/blob/master/CONTRIBUTING.md
|
|
|
|
**NOTICE: You must remove `./node_modules/@theforeman` before running `npm install`.
|
|
If not, it will destroy your `foreman-js` copy.**
|