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

Should we split this into packages? #18

Open
slifty opened this issue Apr 13, 2021 · 2 comments
Open

Should we split this into packages? #18

slifty opened this issue Apr 13, 2021 · 2 comments

Comments

@slifty
Copy link
Contributor

slifty commented Apr 13, 2021

This repository has three projects:

  1. The SimpleBook mediawiki plugin (PHP)
  2. The SimpleBook API, which is a python / flask based service which reads and writes to rq
  3. mw2pdf, which is a nodejs tool that takes URL (+ MW credentials) and converts it to a PDF.

These tools have various integration points, but ultimately could exist separately from the code bases that depend on them.

For instance: mw2pdf should not depend on the SimpleBook API (rather, it implements features necessary for the API to utilize it, but this can be done generically)

I think we should consider:

  • Separating these three projects into separate repositories.
  • Releasing mw2pdf as an npm package.
@slifty
Copy link
Contributor Author

slifty commented Apr 13, 2021

This issue isn't a priority yet, but I wanted to document the thought.

I'd like to add linting and tests to mw2pdf, which is probably the point at which separating it into its own repository and treating it as an imported dependency would make the most sense.

@slifty
Copy link
Contributor Author

slifty commented Apr 13, 2021

Another note:

I just realized that the majority of mw2pdf is actually agnostic to MediaWiki. If you look at the API it provides, it takes in cookies and a set of URLs, navigates to those urls, and combines them into a PDF.

I'm about to add MW auth to it via #11 but if we decide to release it as a package we might consider separating that MediaWiki logic / changing the cookie support to more generic HTTP header forwarding ad releasing that code as a new core as url2pdf.

From there we could either create a second npm package mw2pdf that utilizes the generic generation while providing mediawiki wrappers, or we could put that MW authentication logic in the SimpleBook API service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant