Refactor and migrate Confirm-UPMConfig into UnitySetup.powershell - #256
Conversation
Josh Wittner (jwittner)
left a comment
There was a problem hiding this comment.
Definitely a good stride, but we've confused up some of the UPMConfig noun, intermingling it with 'ProjectManifest' in some cases. We want something like this:
Import-UpmConfig | Update-UpmConfig -ProjectManifest <manifestPaths> | Sync-UpmConfig | Export-UpmConfig We could support ProjectManifest as a first class citizen too and use that to for loading/reading in the Update-UpmConfig cmdlet.
Josh Wittner (jwittner)
left a comment
There was a problem hiding this comment.
Lots of code to clean up here, that I understand you are likely not the original author for, but now that we're going OSS with this we need to raise the bar.
…ojectManifestPath.
…ectManifest. Deleted docstrings for now-private helpers
|
This is almost done, but I'll need to move the dynamic install logic to the script leveraging this, and push another commit to fix a runtime error I'm seeing now (dropped a param during a refactor) |
- Remove dynamic install of Az.Accounts - Declare Az.Accounts dependency
+ Rename Sync-UPMConfig to Update-PackageAuthConfig since to potentially expose a public Sync method with just the .toml path as a target.
Josh Wittner (jwittner)
left a comment
There was a problem hiding this comment.
Just a couple renames and I think we're good to go.
…method, so removing dupes/invalid keys wasn't working yet.
Josh Wittner (jwittner)
left a comment
There was a problem hiding this comment.
Yay, this is a great feature!
Internally we've had a script called Confirm-UPMConfig for quite some time that provides the utility of scanning for all NPM packaging feeds used by a given Unity project and creating auth tokens for each of them, storing them in the user's .toml file.
This pull request migrates that functionality, to UnitySetup, allowing users to call Update-UPMConfig -ProjectManifestPath to have the script find and update auth tokens for their unity project's NPM for all manifests or a given manifest.
Additionally there are a few structural changes incorporated here as the process is now 3 stages of logic in the code:
The logic is a bit clunky since Sync does most of the work here. Would appreciate feedback where applicable