Hello! Our team has actually been (mis)using NPM for the last year or two as a package management solution for Unity. We use NPM packages with git repo links to various custom packages, which works pretty well. However, I’m now looking into whether we should switch to use the Unity system!
A common occurrence for us was that we don’t want EVERY folder or sub-folder in our git repo to be part of the package used by a project. I think a great example is where the package makes use of native code projects to build plugins: you want to include the plugins in the end-user package, but not the C++ source code.
A pretty good Unity-based example of this might be the experimental networking package: GitHub - Unity-Technologies/multiplayer: Unity multiplayer packages and samples. Note that the actual package is not the root of the git repo, but actually the subfolder “com.unity.transport”. At the root of the repo, there’s also the folder “network.bindings” that contains all the platform-specific native code.
In NPM, we could specify this in the package JSON like so:
"files": [ "PackageFolder" ]
This would cause ONLY the “PackageFolder” subfolder to be installed to the end-user’s packages directory.
Is there any way to get this type of behavior with UPM? I tried a test with one of our packages that uses native code, but UPM added the compiled so/a/dll/dylib files AND the native C++ source code and Xcode/VS project files to the target project.