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

Refactor Indiekit class #781

Merged
merged 9 commits into from
Nov 25, 2024
Merged

Refactor Indiekit class #781

merged 9 commits into from
Nov 25, 2024

Conversation

paulrobertlloyd
Copy link
Collaborator

@paulrobertlloyd paulrobertlloyd commented Nov 25, 2024

  • Have plug-ins register features directly onto properties of Indiekit class
  • Use Set() for Indiekit.endpoints, Indiekit.installedPlugins, Indiekit.locales and Indiekit.stores
  • Use Map() for Indiekit.localeCatalog, Indiekit.postTypes and Indiekit.validationSchemas (in addition to preceding refactor which introduced a map for Indiekit.collections)
  • Rename bootstrap to updatePublicationConfig; now that this method has a single purpose we can give it a clearer name
  • The default config now shares the same shape as that used by consumers and no longer adds private or undocumented values.

Introduces the following breaking API change:

  • Indiekit.config.application.postTypes object replaced by Indiekit.postTypes map

While this makes the Indiekit class and its properties and methods clearer, some confusion is still potentially created in that these properties are added to request.app.locals under the application key. Refactoring how locals are named and assigned, and the impacting changes to endpoints that use these values will be tackled in a separate PR. Ideally by the end of this refactor, it should be clearer how Indiekit is structured.

@paulrobertlloyd paulrobertlloyd added code quality Making things easier to understand core Core indiekit package labels Nov 25, 2024
@paulrobertlloyd paulrobertlloyd changed the title Refactor Indiekit class Refactor Indiekit class Nov 25, 2024
@paulrobertlloyd paulrobertlloyd marked this pull request as ready for review November 25, 2024 21:29
@paulrobertlloyd paulrobertlloyd merged commit fcbb479 into main Nov 25, 2024
1 of 2 checks passed
@paulrobertlloyd paulrobertlloyd deleted the refactor/indiekit-setup branch November 25, 2024 21:30
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant