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

Require Base URL & handle parser errors #10

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open

Conversation

aimee-gm
Copy link
Member

@aimee-gm aimee-gm commented Sep 14, 2023

Fixed #9.

Also does the following:

  • Upgarde to node 18, which is current LTS.
  • Catch, and report to the user, any errors thrown by microformats-parser
  • Upgrade microformats-parser to v1.5.2
  • Upgrade all other dependencies
  • Added a .nvmrc for anyone using a node version manager
  • Added prettier with a corresponding GitHub action
  • Replaced undici with the native fetch implementation.

index.js Show resolved Hide resolved
@Zegnat
Copy link
Member

Zegnat commented Sep 14, 2023

I see that this bumped some dependencies (nice!) and with that even brought in some completely new dependencies (ugh). These seem to be busboy and streamsearch, both being downstream from undici. Node 18 bundles undici (check process.versions.undici) for its native fetch. Could we drop undici completely and losen some more on external dependencies?

The only thing undici seems to be doing for us right now is allow the configuration of maxRedirections. But I am not sure how important it actually is to overwrite that from the built-in default.

On another note: could we add Prettier to the devDependencies if we are doing automatic formatting? As a fellow Prettier user, I would like that 😉 I am a lot less against development dependencies than shipped dependencies.

@aimee-gm
Copy link
Member Author

@Zegnat thanks for this, lots to do!

For now, I've done the following:

  • Added a .nvmrc for anyone using a node version manager
  • Added prettier. At the moment, the only thing to enforce this has been the addition of lint-staged and husky to run prettier in pre-commit hooks.
  • Replaced undici with the native fetch implementation. Let's use the default redirect behaviour and do something about it if it's a problem.

@aimee-gm
Copy link
Member Author

I am a lot less against development dependencies than shipped dependencies.

Same here, hence why microformats-parser only has the one dependency

@Zegnat
Copy link
Member

Zegnat commented Sep 14, 2023

Nice! 👏

I had not heard about lint-staged. Probably going to have a look at that later. Though I am not a big fan of things that depend on git hooks (like husky). In general I believe the types of things people most often run in hooks to actually belong within CI.

@aimee-gm
Copy link
Member Author

aimee-gm commented Sep 14, 2023

Normally I would have both CI & Git hooks (always annoying to commit & push and for CI to fail for something that could have been auto-fixed in a pre-commit hook)...

But, given how bare-bones this repo is at the moment, I've modified it to just be a GitHub action check, limited to only prettier. I do plan on adding some simple tests, so this can be extended.

I would be keen - for now - not to add anymore to this PR, and perhaps to improve this app in the near future.

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

Successfully merging this pull request may close these issues.

Internal Server Error parsing HTML snippet without Base URL
2 participants