Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

✨ Separation of logic: migrating to Astro Theme Provider #77

Merged
merged 69 commits into from
Jun 26, 2024

Conversation

create-issue-branch[bot]
Copy link
Contributor

Original issue description

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.

closes #50

Adammatthiesen and others added 18 commits May 18, 2024 08:10
…nd 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>
…es getting put on pages they werent supposed to be getting put on
…nternal things on the dashboard... this will make things way easier)
…custom version for now due to lack of updates)
showSuccessToast = true;
})
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
.catch((e: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually it's probably worth thinking of some global error catching/handling/displaying mechanism, but this is fine for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic handling for these pages in regards to editing the database is to be moved to an API Endpoint for better response handling and toasting (see the start of this in the other pages, such as auth routes)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the effect pattern

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the effect pattern

interesting... never seen that, but honestly, with Astro's API endpoints, i think those should be enough being able to return proper responses. (the current plan that I've been building towards since i have to move all the logic anyway so that its easier to interact from different dashboard pages)

id="slug"
name="slug"
class="border-solid border-2 border-gray-300 rounded-lg p-2 w-96"
<div class="container">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh with ya, I'd like new and edit to just be the same component but just given different default values. So thatthe view, new and edit psges dont repeat the same stuff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be a few changes and updates with the planned API endpoint system (including trying to componentize as many of the pages that are duplicating info as possible! (and moving to astrolace now that i have that working)

Adammatthiesen and others added 4 commits June 22, 2024 15:05
Co-authored-by: Jacob Jenkins <jacob_jenkins@live.com>
…dashboard/pages/delete/pages/[...slug].astro

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

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far looking good, just a couple of comments. 😁

showSuccessToast = true;
})
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
.catch((e: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the effect pattern

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but i think you still gotta resolve conflicts on your branch 😁

Copy link
Member

@jdtjenkins jdtjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for now! Let's get it out, anything else can be fixed later!

Looks really good @Adammatthiesen , incredible work

@Adammatthiesen
Copy link
Member

!coauthors

@Adammatthiesen
Copy link
Member

!coauthor

Copy link
Contributor

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: Luiz Ferraz <luiz@lferraz.com>
Co-authored-by: Bryce Russell <brycetrussell@gmail.com>
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>

@Adammatthiesen Adammatthiesen merged commit f006a0d into main Jun 26, 2024
1 check passed
@Adammatthiesen Adammatthiesen removed this from the ATP Migration milestone Jun 30, 2024
@Adammatthiesen Adammatthiesen deleted the issue-0050 branch July 3, 2024 13:21
@create-issue-branch create-issue-branch bot mentioned this pull request Jul 23, 2024
17 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request feat refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separation of logic: migrating to Astro Theme Provider
5 participants