-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adjust bfe.json so that only classic has sigils #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is that we're channing a bunch of named types which means major changes in ssb-bfe (and here if we're at v1, can't remember)
I think this is the right way.
Oh, did you write a test :every format with a sigil has a suffix?
return [...acc, ...type.formats.filter((format) => format.suffix)] | ||
}, []) | ||
const sigils = new Set() | ||
loopOverTypes: for (const type of bfeTypes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new syntax to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the first or second time ever that I find a legit use case for it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's it called so I can learn what it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...acc, | ||
...type.formats.filter((format) => !format.sigil && format.suffix) | ||
] | ||
, []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor of tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really want to refactor it, but changing the structure of the json forced me to rethink this file, it would have been hard to keep it like it was before, so I just saved some time and followed the spirit of the previous test
Context: See ssbc/ssb-meta-feeds-spec#19, only classic SSB refs would have sigils, so I started working on updating
ssb-bfe
(JS) to use SSB URIs for all non-classic type/formats and it required updatingssb-bfe-spec
.The main change is in
bfe.json
, there is nowformat.sigil
alongsideformat.suffix
, whereas before it wastype.sigil
(making an assumption that the sigil applies universally for that type). I also renamedmsg
tomessage
because if we are to usebfe.json
programatically, we have to build the URI from it, andssb:msg/ed25519/
is not an official SSB URI, it'sssb:message/ed25199/
.