I’m currently testing a Yak package with a local repository, but the icon doesn’t seem to load in the package manager?
It’s a 32 by 32 pixel PNG with a transparent background that’s hosted online and available! I’ve already tried hosting it on my VPS, on imgur, on Github, but nothing seems to work.
Here’s the relevant passage from the manifest.yml:
For local package repositories you need to include the icon file in the package and set the icon field, e.g.
icon: my_icon.png
I’m working on bringing the same functionality to the public package server, so icons become immutable and package authors don’t need to worry about hosting images online.
You could push the package to https://test.yak.rhino3d.com and add it to the list of package sources in Rhino. This test server is wiped clean once per day.
In my opinion, hosting the image online isn’t that big of a hurdle, since there are many free services out there and most people have a website either way. However it’s a little confusing that local packages don’t load online icons.
Locally it works with setting the icon field, however I’ve too optimistically pushed it to the server and it seems to produce an error in the PackageManager now!
PackageManager: Error fetching icon for Tapeworm (1.0.2)
Could not initialize an instance of the type 'AppKit.NSImage': the native 'initWithData:' method returned nil.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
I’d removed the icon field and substituted it for icon_url: https://github.com/diff-arch/Tapeworm/blob/main/resources/Logo_Tapeworm_32.png before publishing it.
I hope I haven’t broken the PackageManager for everybody on macOS!
I wanted to avoid making HTTP requests to external servers when querying a local package repository. I’m hoping to remove the confusion by using icon in both places, and deprecating the use of icon_url for the public server.
The first two redirect to the third one. They’ll all work, but picking one of the first two might be a little more future proof in case GitHub changes something…
Oh, my bad! Sorry. Would it be possible to remove a package and re-upload it. We are publishing to Food4Rhino, GitHub, and Yak, and it would be weird to have another, higher version only on the PackageManager.
Edit:
Or can the manifest be edited to change the image url, since the package is only a ZIP file?
Versions can’t be removed, edited or overwritten, they can only be hidden via the yank command.
There are of course exceptions where privacy/security are concerned, but in general this immutability is a pretty important concept when you potentially have users relying on specific versions of a package.
Trying to think of the least number of hoops you’ll need to jump through in this particular situation… The package manager supports 4-digit version numbers, so what about pushing a new “1.0.2.1” version of your package with the updated URL? It’s just a temporary measure to avoid re-publishing everywhere until you’re ready to roll the version number.