This NPM package can be used to install the Decidim NPM packages locally in Decidim instances that install the Decidim gems e.g. from GitHub when the Decidim NPM packages might not match those available publicly in NPM. This can happen when the Decidim version hasn't been released yet.
This package:
- Copies the Decidim's NPM
package.jsondefinitions to the local application'stmpfolder from the Decidim folder.- If the
decidimgem is available in the local bundle, the packages are copied from there. - If the
bundle show decidimcommand does not report any installation path for thedecidimgem, the dependencies are installed from the Decidim git repository instead.
- If the
- Updates the local NPM package references in each package to point to the tarballs to be created in the next step.
- Builds the NPM packages as tarballs to the
tmpfolder.
This package also ships with an NPM install script that will automatically
build the tarballs every time npm install is run in the application. This
ensures that the tarballs are available on every install.
Install the NPM package by running:
$ cd path/to/decidim-instance
$ npm i https://github.com/decidim/decidim-npm-local
$ npm exec decidiminstall .Take a look at the project's package.json. It should now have the Decidim NPM
dependencies listed in it.
After the initial installation, you can re-install the NPM packages normally
by running npm i at the project root. The tarballs are re-built on every
installation thanks to the installation script shipped with this package.
If you want to try that this actually works, try running the following commands after the initial installation:
$ rm -rf node_modules
$ rm -rf tmp/npmbuild
$ npm i