Create-react-app: Gauging Interest in Guide for Verdaccio Private Registry Uplink

Created on 18 May 2018  Â·  9Comments  Â·  Source: facebook/create-react-app

I am writing to gauge interest in whether or not create-react-app would like a new User Guide detailing how to run end to end testing with a private verdaccio uplink, enabling the installation of private packages as dependencies.

Context

create-react-app uses verdaccio to spin up a local registry to publish and pull the current changeset being built - effectively testing exactly how the user would. (By the way, this is awesome!)

create-react-app has the luxury of using the default verdaccio config which includes the public npm registry. All packages to be installed are public.

Problem

A problem is encountered if a team wishes to fork create-react-app and add private or proxied npm packages, as they won't be found on the public registry (at least unauthenticated). This causes yarn installs to fail with 404s during CI. I think one could argue this may be a pretty specific problem, depending on if teams choose to fork the whole monorepo or just react-scripts, but we've found value in the former, and as such, am writing this issue to propose the solution.

Solution

What we've down to support this behavior is

  • add our private registry as an uplink
  • alter end to end scripts to add auth or header properties to the verdaccio confg file during CI, being careful not to leak any secret.

This allows us to test generation of create-react-app while pulling down our custom/private packages.

We find it unlikely that we are the only team to encounter this use case. Would create-react-app accept a PR to the User Guide detailing how to accomplish this task?

stale documentation

Most helpful comment

I’m not saying it doesn’t belong in the user guide, just that I’m not sure.

Here’s a proposal: submit a PR adding a section to the user guide (maybe something like “CI testing with private packages”). If it’s general enough and useful to others, we’ll merge it. If not you can move it to a blog post and we’ll just link to the blog post from the user guide.

All 9 comments

I'm not sure if this is something that belongs in the Create React App docs or elsewhere. However, we did just recently merge a PR that uses a custom verdaccio config for tests: https://github.com/facebook/create-react-app/pull/4454.

We can discuss this issue further but I thought that might be of some interest to you.

I know about that - in fact it helped me mid-process solve the issue by not having to create that file myself! If you don't feel like this belongs here, I am happy to blog about it and let people find it that way.

I’m not saying it doesn’t belong in the user guide, just that I’m not sure.

Here’s a proposal: submit a PR adding a section to the user guide (maybe something like “CI testing with private packages”). If it’s general enough and useful to others, we’ll merge it. If not you can move it to a blog post and we’ll just link to the blog post from the user guide.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

I think I can help with this since I was already writing about this topic.

Sure, we can add this somewhere. Send a PR?

Done, please let me know whether I did it correctly or you were expecting something different. btw, thanks for relying on verdaccio project đź’Ż

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@iansu are you fine with the PR? Hopefully closing this the PR #5767 does not get forgotten.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gaearon picture gaearon  Â·  85Comments

rovansteen picture rovansteen  Â·  192Comments

amuehl picture amuehl  Â·  79Comments

gaearon picture gaearon  Â·  86Comments

akctba picture akctba  Â·  80Comments