Skip to content
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

LocalWebMentionStorage is not exported from package #18

Closed
paulrobertlloyd opened this issue Nov 10, 2023 · 6 comments
Closed

LocalWebMentionStorage is not exported from package #18

paulrobertlloyd opened this issue Nov 10, 2023 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@paulrobertlloyd
Copy link
Contributor

Describe the bug

In the readme, under the Setup heading it is suggested that example storage adapter can be imported as follows:

import { localWebMentionStorage } from 'webmention-handler';

const storage = new LocalWebMentionStorage();

I’ve corrected a typo in #17 to update the import to reference LocalWebMentionStorage (capital ‘L’ as it is named in the module), but this function is not exported. It’s unclear from the documentation if this is intended to be exported or not, as later in the readme this function is linked to instead:

An example storage handler can be found in the [local storage class](https://github.com/vandie/webmention-handler/blob/main/src/classes/local-web-mention-storage.class.ts).
@paulrobertlloyd paulrobertlloyd added the bug Something isn't working label Nov 10, 2023
@vandie
Copy link
Owner

vandie commented Nov 10, 2023

It's an example, available in the codebase for reference but should not be used during implementation. The mongoDB handler is the one I use myself.

@paulrobertlloyd
Copy link
Contributor Author

In which case, I think the readme should link to the example (as is done later in the readme) and not show an import from the module which isn’t available. Happy to create a PR for this change, if that’d help?

@vandie vandie added documentation Improvements or additions to documentation wontfix This will not be worked on and removed bug Something isn't working labels Nov 10, 2023
@vandie
Copy link
Owner

vandie commented Nov 10, 2023

I guess it could be clearer but non convinced that linking would avoid this confusion.

@paulrobertlloyd
Copy link
Contributor Author

paulrobertlloyd commented Nov 10, 2023

Perhaps the mongo handler can be used as the example? Right now the readme says:

To create instance of the example storage class, the following code can be used.

but the code shown can’t be used. This tripped me up as I was getting started, and it's the first line of code shown, so it's a bit of a trip hazard.

That said, I’ve been able to get a Webmention endpoint up and running in just a few hours, so thank you for all the work you’ve done on this package so far!

@vandie
Copy link
Owner

vandie commented Nov 11, 2023

@paulrobertlloyd I understand the reasoning and why that tripped you up. My concern is that I don't want to push people towards using mongoDB.

@vandie vandie removed the wontfix This will not be worked on label Nov 11, 2023
vandie added a commit that referenced this issue Nov 11, 2023
* fix(LocalWebMentionStorage): #18 - export LocalWebMentionStorage

* test(index): correct test for exports
@vandie
Copy link
Owner

vandie commented Nov 11, 2023

For now, I've exported the example adapter. We can come back to this once we have an idea of how to improve this in a "non-opinionated" way.

@vandie vandie closed this as completed Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants