Skip to content

Commit

Permalink
Refactor developer config and remove viewTransitionAPI
Browse files Browse the repository at this point in the history
The viewTransitionAPI property in the developer config schema has been removed as it is no longer needed. This change simplifies the configuration and reduces unnecessary code.

Removed unused middleware files

The middleware.ts and middleware2.ts files have been deleted as they are no longer used in the application. This cleanup improves the codebase by removing unnecessary files.

Update Layout component

The import statement for the Config module has been commented out in the Layout component. This change is made to remove an unused dependency and improve the performance of the component.

Update integration setup

The addMiddleware function call has been commented out in the integration setup. This change is made to remove an unused middleware and simplify the integration setup.
  • Loading branch information
Adammatthiesen committed Dec 1, 2024
1 parent cb357b0 commit 3290f58
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 66 deletions.
8 changes: 0 additions & 8 deletions packages/studiocms_core/src/schemas/config/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ import { z } from 'astro/zod';

export const developerConfigSchema = z
.object({
/**
* Zero-JavaScript View Transitions
*
* Chrome 126 (released last week) and Microsoft Edge 126 (releasing this week) both support “cross-document view transitions” unlocking zero-JavaScript view transitions in Astro.
*
* @see https://astro.build/blog/future-of-astro-zero-js-view-transitions/
*/
viewTransitionAPI: z.boolean().optional().default(false),
/**
* Enable Testing and Demo Mode
*
Expand Down
14 changes: 0 additions & 14 deletions packages/studiocms_dashboard/src/components/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import { ViewTransitions } from 'astro:transitions';
// import Config from 'virtual:studiocms/config';
import { Button } from '@studiocms/ui/components';
import Icon from '@studiocms/ui/utils/Icon.astro';
import { BaseHead } from '../components';
Expand All @@ -10,12 +9,6 @@ import '@studiocms/ui/css/global.css';
import '@fontsource-variable/onest/index.css';
import '../styles/layout.css';
// const {
// dashboardConfig: {
// developerConfig: { viewTransitionAPI },
// },
// } = Config;
type Props = {
title: string;
description: string;
Expand All @@ -31,13 +24,6 @@ const { title, description } = Astro.props;
<head>
<BaseHead title={title} description={description} />
<ViewTransitions />
<!-- {viewTransitionAPI && (
<style>
@view-transition {
navigation: auto; /* enabled! */
}
</style>
)} -->
</head>
<body>
<SingleSidebar transition:persist transition:persist-props />
Expand Down
7 changes: 1 addition & 6 deletions packages/studiocms_dashboard/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineIntegration({
hooks: {
'astro:config:setup': async (params) => {
// Destructure Params
const { logger, injectRoute, addMiddleware } = params;
const { logger, injectRoute } = params;

// Destructure Options
const { verbose } = options;
Expand Down Expand Up @@ -122,11 +122,6 @@ export default defineIntegration({
],
});

// addMiddleware({
// order: "pre",
// entrypoint: resolve('./middleware.ts'),
// });

// // OLD ROUTES - TO BE REMOVED
// injectRouteArray(params, {
// options,
Expand Down
20 changes: 0 additions & 20 deletions packages/studiocms_dashboard/src/middleware.ts

This file was deleted.

18 changes: 0 additions & 18 deletions packages/studiocms_dashboard/src/middleware2.ts

This file was deleted.

0 comments on commit 3290f58

Please sign in to comment.