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

Consolidate URL utility functions #616

Merged
merged 14 commits into from
Jul 4, 2023
Merged

Conversation

paulrobertlloyd
Copy link
Collaborator

@paulrobertlloyd paulrobertlloyd commented Jul 4, 2023

Consolidates a number of URL utility functions duplicated across different packages:

  • isUrl, used by:
    • create-indiekit
    • endpoint-auth
    • indiekit
  • getCanonicalUrl, used by:
    • endpoint-auth
    • frontend (absoluteUrl)
    • indiekit
    • syndicator-mastodon (getAbsoluteUrl)
    • syndicator-twitter (getAbsoluteUrl)
  • isSameOrigin, used by:
    • syndicator-mastodon (isTootUrl)
    • syndicator-twitter (isTweetUrl)

This reduces the number of tests, down from 632 to 621.

These have been added to a new @indiekit/util package, to which further shared utility functions can be added.

Partly addresses #544.

@paulrobertlloyd paulrobertlloyd added code quality Making things easier to understand plugin-endpoint Endpoint plug-in plugin-syndicator Syndicator plug-in core Core indiekit package frontend labels Jul 4, 2023
@paulrobertlloyd paulrobertlloyd merged commit af6c63c into main Jul 4, 2023
@paulrobertlloyd paulrobertlloyd deleted the consolidate-url-utils branch July 4, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Making things easier to understand core Core indiekit package frontend plugin-endpoint Endpoint plug-in plugin-syndicator Syndicator plug-in
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant