keycloak-scim/themes/UPDATING-NODE-MODULES.md
Alex Szczuczko 52d8b759d3 KEYCLOAK-11293 Update theme build for keycloak-preview
`npm install` is changed to run at build time, removing the need for commiting
the js modules, which are getting a bit silly in size with the introduction of
account2. Appropriate changes to prod-arguments.json are included that should
enable the product build to function properly. The community and developer
builds will continue to work without the proxying PNC provides.

This also changes the themes pom to work with more than one `package.json`
file. The only other one at the moment is for the new account console /
account2.

The documentation file has been updated.

Since we're building directly out of the source directories, it is possible in
a local dev environment for unintended files (e.g. old compiled .js files),
placed within src/main/resources/, to be included in the themes jar. This
shouldn't be a problem for actual builds though, which use a fresh clone.

Other small changes include refactoring the npm setup stuff to a global
definition, and the introduction of some properties to avoid duplicating path
definitions everywhere.

This commit does not include the churn that would result from deleting the
existing commited modules.
2020-01-29 05:26:55 -03:00

22 lines
1.4 KiB
Markdown

## Updating dependencies for login, admin console, and old account console
Edit `src/main/package.json` to update the dependency versions. Then run the following commands to download the new dependencies:
cd themes
mvn clean install -Pnpm-update
The above will download the full NPM dependencies to `src/main/resources/theme/keycloak/common/resources/node_modules`. The main purpose of this directory is that we have the full source code available for dependencies in the future. This will be removed in the future as the internal build systems will take care of this.
Before committing changes review changes in `src/main/resources/theme/keycloak/common/resources/node_modules` making sure that it hasn't added new unused dependencies (transitive dependencies) and added any files that are not needed in the distribution (this is importat as the full node_modules downloaded are 176M while the filtered dependencies are 42M).
## Updating dependencies for the new account console
The node dependencies will be downloaded at build time, based on the content of `package-lock.json`. To update `package-lock.json`:
cd src/main/resources/theme/keycloak-preview/account/resources/
npm install
git add package-lock.json
cd -
You should verify the new set of packages don't break anything before commiting the new `package-lock.json`. Do not commit the `node_modules` directory for the new account console.