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

Extract URL Service utils into SDK #10773

Closed
6 tasks done
naz opened this issue Jun 4, 2019 · 0 comments · Fixed by #10787
Closed
6 tasks done

Extract URL Service utils into SDK #10773

naz opened this issue Jun 4, 2019 · 0 comments · Fixed by #10787
Assignees

Comments

@naz
Copy link
Contributor

naz commented Jun 4, 2019

Problem

URL Service utils are being used throughout the codebase in Ghost API/server and in the theme layer, which makes impossible to run the server without a theme layer.

Solution

To decouple these utils from theme layer and make it a reusable utility library it should be extracted into Ghost-SDK in line how it's done in #10618

LIst of changes:

Future improvements

As Ghost becomes more split into visible "frontend" and "server" parts these utilities might have a visible use case by only one or another, so these utils might benefit from splitting as well.

Nice-to-have:

  • make BASE_API_PATH and STATIC_IMAGE_URL_PREFIX configurable

refs #10360

@naz naz self-assigned this Jun 4, 2019
naz added a commit to TryGhost/SDK that referenced this issue Jun 13, 2019
naz added a commit that referenced this issue Jun 18, 2019
closes #10773

- The refactoring is a substitute for `urlService.utils` used previously throughout the codebase and now extracted into the separate module in Ghost-SDK
- Added url-utils stubbing utility for test suites
- Some tests had to be refactored to avoid double mocks (when url's are being reset inside of rested 'describe' groups)
naz added a commit that referenced this issue Jul 8, 2019
refs #10773

- All instances of `urlService.utils` were previously migrated to use standalone SDK module `url-utils`
naz added a commit to naz/Ghost-SDK that referenced this issue Sep 24, 2020
naz added a commit to naz/Ghost-SDK that referenced this issue Sep 28, 2020
naz added a commit to naz/Ghost-SDK that referenced this issue Sep 28, 2020
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 a pull request may close this issue.

1 participant