Are there plans to expose the js bagger API like bagit-python?
Closed this issue · 9 comments
Hi,
Sorry to ask this here in Github issues, but I think this project contains the only actively maintained implementation of bagger in js, which would be very useful for a project of mine.
Are there plans to publish your js bagger implementation to npm? If not, are there plans to provide usage examples similar to (https://libraryofcongress.github.io/bagit-python/) for bagging a directory and adding metadata as a one-line call?
Thanks!
I hadn't planned on breaking out the bagger into it's own module, but I'm open to the idea. At the moment, the bagger has two main limitations: it's tied into the larger DART software, and it only produces tarred bags.
If you could let me know what features you're most interested in, and some sample use cases, I can consider them. I can't make any guarantees, but since this project is intended for the benefit of the community, the more needs & uses cases I know, the better.
Well, essentially, I've been maintaining this app to provide a simple, customizable bagging interface: https://github.com/axfelix/moveit-electron
Currently, however, it bundles a compiled Python bagit, and Apple has finally changed their signing guidelines in a way that don't seem to allow me to ship on macOS anymore, so I'm hoping to be able to replace the Python dependency and switch to a pure js/Electron app.
All the Python code does is a single bagit.make_bag()
call (https://github.com/axfelix/moveit-electron/blob/master/moveit.py), so it's highly replaceable in theory, I just need to be able to make that same call.
I think I have some cross-platform Electron packaging expertise I could share in exchange, if that's helpful for you!
OK, I will take a look at what it would take to abstract the bagging code from DART. I won't be able to get to that for at least a week because of other work.
At the moment, the DART bagging code is pretty deeply embedded in to main app and may be hard to abstract. You may want to take a look at https://github.com/LibraryOfCongress/bagger-js. It may be easier to adapt.
BTW, are you saying that you were embedding an executable in your Electron app and Apple is no longer allowing that? I'm curious, because I was thinking of doing that in a future DART release, but if Apple forbids it, it's a no go.
A week is definitely sooner than I'd need it -- if we had a better-abstracted js bagit implementation within 3 months, that would work great for us. Unfortunately, we aren't resourced to maintain an npm package (like LoC's bagit-python), and my main goal is avoiding having to pull a ton of difficult-to-maintain bagger code directly into our project, if it isn't currently standalone, but I'd be happy to check with the LoC maintainers if you think this is of interest to them too.
Technically I think you can still embed executables in signed applications, but I'd worked out a very complex way of walking through an embedded app and signing everything I needed signed using the Electron packager tooling, and it was challenging enough the first time that I don't have a lot of confidence in figuring out what's changed or whether what I'm doing is still supported (there's very little documentation of this, the Electron community seems to treat Apple's signing APIs as a black box).
Thanks for the info on that. I'll try my luck with the embedded executable and see if signing works.
In the meantime, just to be clear, I'll try to figure out next week how much work would be involved in extracting the bagging code. I don't know how much it might take, or if/when I'd have time to do that work.
Thanks -- I really appreciate you following up on this. It's not urgent at all, I'll be grateful for any updates.
Any update on this? Happy to provide packaging expertise still if that's of any help.
Sorry. At this point, I don't any time in the next few months when I'd have an opportunity to do this. I'm actually moving DART away from Electron and JavaScript, because Electron and the Node ecosystem have been too unstable and have caused too many maintenance headaches.
If I can abstract the bagging JavaScript later this year, I might give it a shot, but I think the chances of that are low. In the meantime, this is open source code issued under the BSD license, which means you can do anything you want with it. The code base is documented at https://aptrust.github.io/dart/, but even so, extracting the bagging component will be challenging because JavaScript is inherently a tangle of callbacks, promises, and event listeners.
Sorry I can't help here, but I'm maintaining a number of other projects and I have to attend to the highest priorities first.
That sounds totally fair, thank you for clarifying!