Skip to content

feat: support optional .npmrc mount for dynamic plugin installation - #38

Closed
Fortune-Ndlovu wants to merge 0 commit into
redhat-developer:mainfrom
Fortune-Ndlovu:load-external-plugins-from-.npmrc
Closed

feat: support optional .npmrc mount for dynamic plugin installation#38
Fortune-Ndlovu wants to merge 0 commit into
redhat-developer:mainfrom
Fortune-Ndlovu:load-external-plugins-from-.npmrc

Conversation

@Fortune-Ndlovu

Copy link
Copy Markdown
Member

Description

This PR introduces support for optionally mounting a local .npmrc file into the install-dynamic-plugins container in RHDH Local, enabling developers to install dynamic plugins from private NPM registries without modifying the compose.yaml file.

What’s Included

  • Adds a conditional .npmrc mount in compose.yaml, targeting the plugin installer container
  • Supports an optional NPM_CONFIG_USERCONFIG env var, injected only if .npmrc is present
  • Updates fixes.sh to copy the mounted .npmrc to the correct location (~/.npmrc) for plugin install
  • Adds a new start.sh helper script that:
    • Accepts a path to .npmrc (defaulting to $HOME/.npmrc)
    • Copies it into the repo
    • Exports the appropriate env var
    • Starts the RHDH Local stack with podman-compose
  • README updated with clear instructions on how to use .npmrc for private plugins

Benefits

  • Zero manual edits to Compose files required
  • Seamless developer experience for plugin testing behind a corporate/private registry
  • Backward-compatible with existing workflows
  • Gracefully handles the absence of .npmrc no mount, no env, no errors

Which issue(s) does this PR fix or relate to

PR acceptance criteria

  • Tests
  • Documentation

How to test changes / Special notes to the reviewer

@Fortune-Ndlovu

Copy link
Copy Markdown
Member Author

cc: @rm3l , @kadel

@rm3l rm3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better for this to be built on top of the changes in #34

@kadel

kadel commented Apr 22, 2025

Copy link
Copy Markdown
Member

@Fortune-Ndlovu can you please fix your git config? Your commits have my-name <my-email> as an author. I've noticed this in some of the commits in your other PR.

@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the load-external-plugins-from-.npmrc branch from 84ca29c to 7086b28 Compare April 29, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants