-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: multiple upstreams #397
Conversation
d500ecd
to
e49ea68
Compare
@favoyang I am done with the business side of allowing users to resolve packages from multiple registries. Only two things remain to do here:
|
I’m not sure about that. Maybe you can create a local registry with Verdaccio for end-to-end testing, which is what Verdaccio was originally created for.
I would prefer to make |
Oh yeah thats a good idea. I will implement that in general for all e2e tests.
Ok but that would be a breaking change. People might already have a command like this |
Adding global parameters before the sub-command should work fine:
I'm not sure how JS Commander handles global parameters when placed after the sub-command. Also considering
|
This change shrinks `cli/index.ts`. Composition root and other global app setup was moved into `index.ts`. Logic for each command was moved into the corresponding cmd file. This is in preparation for overhauling the option logic which in itself is in preparation for #397.
Rename references to "upstream" with "Unity". This is in preparation for adding multiple upstreams.
Refactor logic to init isUnityPackage variable so that it works with an arbitrary amount of registries.
63a3d22
to
a4567a1
Compare
a4567a1
to
3f880c6
Compare
f0b88ab
to
0e21feb
Compare
@favoyang Seems like it all works now. I did not write a test because I could not figure out how to setup verdaccio for an e2e test. if you want to give that a go, that would be neat. Anyway i tested it with the registry that is part of my work institution and it worked with no issue. |
@favoyang I also updated the relevant section in the readme. Please take a look if you think it makes sense. |
# [4.2.0](4.1.2...4.2.0) (2024-09-21) ### Features * multiple upstreams ([#397](#397)) ([6d61364](6d61364))
If the registry you referenced is stable enough, we can leave it as it is. For Verdaccio end-to-end (e2e) tests, the easiest way is to use a GitHub Action to launch a Docker service. Then, you can publish a package to it and access it from the localhost IP. Here's an example: https://github.com/juanpicado/e2e-ci-example-gh-actions/blob/master/.github/workflows/node.js.yml You can also launch a verdaccio from the code directly, but it can be quite verbose: https://github.com/juanpicado/verdaccio-end-to-end-tests/blob/main/tasks/index.js |
It's quite clear. |
This allows users to use any number of upstream registries when resolving packages.
See #349.