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

Separation of logic: migrating to Astro Theme Provider #50

Closed
BryceRussell opened this issue May 3, 2024 · 7 comments · Fixed by #77
Closed

Separation of logic: migrating to Astro Theme Provider #50

BryceRussell opened this issue May 3, 2024 · 7 comments · Fixed by #77
Assignees
Labels
enhancement New feature or request feat refactor

Comments

@BryceRussell
Copy link
Member

Is your feature request related to a problem? Please describe.

  • The blog route is included with StudioCMS. What if a user wants to use StudioCMS independently of the theming/styling it provides? For example, using StudioCMS as a CMS on an existing website. I imagine most user's of StudioCMS will want to use StudioCMS as a backend for content without extra routes like the blog

Describe the solution you'd like

I would like to see StudioCMS be split into separate packages

  1. A core package that provides the core functionality and a dashboard for StudioCMS
  2. Official themes (blog, docs, etc) that use the core package as a backend for editing content

This would allow users to use the core package if they want a CMS for their own routes (like a traditional CMS), and use themes if they want to use pre-built routes for a blog, docs, etc.

This separation of packages is a perfect opportunity to migrate towards Astro Theme provider. Astro Theme Provider already has the APIs that StudioCMS needs to facilitate this migration, and it would simplify the integration code.

Describe alternatives you've considered

One alternative is to not use Astro Theme Provider, but continuing with the current structure has some problems:

  • The problems I have already mentioned in previous sections
  • No reason to re-design and engineer APIs that already exist inside of Astro Theme Provider

Additional context

I am willing to take ownership of this issue. I am looking for opinions/permission before tackling such a large change, I am available to chat if anyone has questions or wants a more detailed explanation than what I can do in text.

@Adammatthiesen
Copy link
Member

Perfect Timing! #45 is the start of the prep for this!

@BryceRussell
Copy link
Member Author

Awesome! I will be publishing ATP v0.3.0 soon, after that is published and #45 is merged, I want to start working on a draft for this. Is that ok?

@Adammatthiesen Adammatthiesen added enhancement New feature or request feat refactor labels May 3, 2024
@Adammatthiesen
Copy link
Member

That should be fine! just let me know if we need any new virtual components added to the helper 😄

@jdtjenkins
Copy link
Contributor

Headless StudioCMS when??????

Yeah I love this idea, as Adam said it's already starting to get more and more separated and more decoupled.

Because I'm imagining something like this:

// astro.config.mjs

integrations: [
  studioCMS({
    themes: [ // don't care about the name, just a placeholder for now
      blog(), // this adds say all the routes for your blog and could even add APIs for you to manage the blog AND adds it's own routes into the dashboard,
      docs(),
      storefront(),
      imageGallery(), // idk but you get the idea
    ],
  })
]

Then we can use ATP to create a whole theme with it's own pages, customisable components and just generally awesome stuff?

Yeah I'm down, I love this idea

@dreyfus92
Copy link
Member

I love the idea, the more flexible we are to bring in other integrations sound good to me 🫡

@Adammatthiesen
Copy link
Member

Adammatthiesen commented May 11, 2024

After our previous discussions i believe this would be better as multi-step PR. The First, to setup the new schemas and helpers, and the Second, to implement ATP for the front-end.

  • Setup new Table Schemas, and Implement Helpers (component and function helpers)
  • Migrate front-end to utilize ATP

Copy link
Contributor

Branch issue-0050 created for issue: Separation of logic: migrating to Astro Theme Provider

create-issue-branch bot added a commit that referenced this issue May 11, 2024
Adammatthiesen added a commit that referenced this issue Jun 26, 2024
* Create draft PR for #50
[skip ci]

* ♻️ Chore: Setup new Table Schemas, and Implement Helpers (component and function helpers) (#79)

* Create draft PR for #78
[skip ci]

* add new workflows to send messages for first time contributors

* Update firsttimepr.yml

* ♻️ Chore: Update Database Start page to reflect new theme and utilize batch transactions (#76)

* Create draft PR for #71
[skip ci]

* Update - New setup page and done page implemented. as well as some OptionsSchema cleanup

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* update as per dreyfus's comment

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

---------

Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Adam Matthiesen <amatthiesen@outlook.com>
Co-authored-by: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update firsttimepr.yml

* Create draft PR for #78
[skip ci]

* Chore: Update Security implementation for local username/password auth and start the process of converting the dashboad edit pages to utilitze HTMX based server rendering

* new schema is working!  Woo! This will give tons of future options!

* more progress updates

* dashboard update progress checkpoint

* another progress checkpoint... dashboard is coming along nicely

* fix old reference about page being a post

* new helper function to get content

* update so frontend doesn't cry about new schema

* progress update - updated frontend to use new content helper and removed old page schema

* chore: Update astro:db:setup hook in studioCMS.ts

* I think everything is updated and working properly.  just running tests now

* Add getUserById and getUserList helper functions to the contentHelper module for retrieving user data from the Astro Studio's Database.

* chore: Update registration API to validate email address before creating a new user and use it to generate a gravatar avatar for local users without oAuth

* more cleanup

* chore: Update StudioCMS config handling and error messages

* update config and admin pages to reflect new UI changes

* Update types and fix typos created from that

* new navbar component working and can be customized

* update navigation

* Update .github/workflows/firsttimepr.yml

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/index.ts

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/components/exports/Navigation.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* Update packages/studioCMS/src/components/exports/Navigation.astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* update helptext on admins page

* Update close button ID in Header component

* chore: Update optionsSchema in studioCMS.ts

---------

Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Adam Matthiesen <amatthiesen@outlook.com>
Co-authored-by: Bryce Russell <brycetrussell@gmail.com>
Co-authored-by: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com>
Co-authored-by: Jacob Jenkins <7649031+jdtjenkins@users.noreply.github.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* progress checkpoint... frontend moved, blog package created

* chore: Update dependencies and paths in tsconfig files

* chore: Update dependencies and paths in tsconfig files

* Progress checkpoint.... its working.... someone tell me im not crazy.... please?

* ASTROENV!!!!!

* Some more Astro:ENV

* Some more cleanup

* Some more work and cleanup

* progress checkpoint

* Buahahaha i fixed the typing stuffs

* cleanup, and some new helpers as well as fixes to some weird CSS styles getting put on pages they werent supposed to be getting put on

* update, and progress checkpoint

* new header system

* fix tsconfig

* cleanup dts file

* AIK Utilities... makes things cleaner

* update monorepo deps

* chore: Update @moonrepo/cli to version 1.25.5

* chore: Update @moonrepo/cli to version 1.25.3

* refactor: Update CMS description in package.json and README.md

* more cleanup and better organization of utilities

* refactor: Add package relation column to page list in dashboard

* cleanup and migrate logger for ImageHandler

* Dashboard integration cleanup

* more cleanup

* Updates... continuing cleanup, and getting ready to start actually finishing this pr...

* more dashboard cleanup.

* Blog index page update

* Tweaking, and page routes, and rss route now!

* More refactoring

* update deps

* fix

* deps

* dedupe

* Update requested changes from Bryce

* update favicon to utilize mrmime

* Create helper function for defining StudioCMS Plugins using the current exports

* update rss feed

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/pages/configuration/admins.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/pages/configuration/admins.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/pages/configuration/index.astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/pages/edit/pages/[...slug].astro

Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

* update AuthSecurityConfig as per Dreyfus request

* rename cFav to configFav as per jdtjenkins request

* rename CImage to CustomImage and update all occurrences

* rename oResolver to optionsResolver

* update UnoCSS

* update scrollbarCSS and remove unocsspresetscrollbar due to not working

* new viewtransition API works!!!! This option is now implemented as an OPTIONAL feature!

* fix responsive layout

* make login page responsive

* update icons - i found a better source for MOST of our dashboard icons instead of local file

* unocss cleanup and fix darkmode selector (used by only a few of the internal things on the dashboard... this will make things way easier)

* update deps, and fix auth tables to align with lucia-astrodb-adapter(custom version for now due to lack of updates)

* Update README.md

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/pages/delete/pages/[...slug].astro

Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>

* update as per jumper requests

* use container API to render post content for RSS feed

* page partial bug resolved

* cleanup names on rssfeed, rss feed is much simplier now

* new const var for SiteConfigId as per jumper request

* do not show delete button as jumper request

* fix lockfile and dupped package.json

* remove exclusion

* disable studioCMSBlog due to weird fserror

---------

Co-authored-by: Adam Matthiesen <amatthiesen@outlook.com>
Co-authored-by: Bryce Russell <brycetrussell@gmail.com>
Co-authored-by: Adam Matthiesen <30383579+Adammatthiesen@users.noreply.github.com>
Co-authored-by: Jacob Jenkins <7649031+jdtjenkins@users.noreply.github.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feat refactor
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants