buttercup / buttercup-core

:tophat: The mighty NodeJS password vault
http://buttercup.pw/
MIT License
469 stars 57 forks source link

🦕 Deno Support? #309

Open zicklag opened 3 years ago

zicklag commented 3 years ago

Have you ever considered supporting Deno for buttercup core? It might be quite easy to support. Maybe just requiring some tweaks to certain module imports.

A quick test of importing buttercup core from GitHub yields:

``` > import "https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/index.common.ts" Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/index.common.ts Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/attachments/AttachmentManager Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/core/Entry Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/core/Group Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/core/Vault Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/core/VaultManager Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/core/VaultSource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/credentials/Credentials Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/DatasourceAuthManager Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/DropboxDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/FileDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/GoogleDriveDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/MemoryDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/TextDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/WebDAVDatasource Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/datasources/register Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/env/appEnv Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/env/core/appEnv Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/facades/detection Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/facades/entry Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/facades/symbols Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/facades/tools Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/facades/vault Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/io/VaultFormatA Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/io/VaultFormatB Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/io/formatRouter Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/search/BaseSearch Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/search/VaultEntrySearch Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/search/VaultFacadeEntrySearch Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/search/searcher Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/storage/MemoryStorageInterface Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/storage/StorageInterface Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/tools/encoding Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/tools/entry Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/tools/uuid Download https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/types Check https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/index.common.ts Uncaught TypeError: Import 'https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/attachments/AttachmentManager' failed: 404 Not Found at https://raw.githubusercontent.com/buttercup/buttercup-core/master/source/index.common.ts:6:8 at async :2:1 ```

So not working already, but maybe close. You're already using typescript which is great!


If we ever wanted to bring back a buttercup CLI, Deno could be useful. Deno's nice because it's just a single executable to install and doesn't require NPM. It's just simple.

Anyway, it's not a big deal to me actually, I was just curious and thought I'd bring it up.

Feel free to close if it's not something worth thinking about right now. :)

zicklag commented 2 years ago

Well, after some struggling with import-transforming CDNs, I finally got buttercup core to work in Deno, and produce a standalone executable suitable for a buttercup CLI.

https://github.com/zicklag/buttercup-cli

Right now I just use it so that I can export my passwords from buttercup in a pinch, even if I don't have the desktop app or Node.js.

The deno import situation is far from optimal, so it'd still be nice to have more official support, but at least there's a way to do it!

perry-mitchell commented 2 years ago

I'm sorry I haven't responded sooner to this.. I haven't considered Deno support because I don't use it. I'd be more than happy if someone wanted to maintain Deno support of the core library, but I don't personally have the time.

The error in your initial message looks like it's trying to download individual files, which seems wrong :sweat_smile: - Especially seeing as there's no extension for the AttachmentManager file (it should be .ts if it's download the source files).

zicklag commented 2 years ago

I'm sorry I haven't responded sooner to this...I'd be more than happy if someone wanted to maintain Deno support of the core library, but I don't personally have the time.

Absolutely no problem, I totally understand!

For now I'm happy enough with my little utility and i don't have a ton of time so I'm not going to bother with anything else yet.

Thanks for buttercup, it's great! :)