Skip to content

Commit

Permalink
Update according to jdtjenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
Adammatthiesen committed May 9, 2024
1 parent cadb069 commit 6b13a4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/studioCMS/src/integrations/studioCMSDashboard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ export default defineIntegration({
const { resolve } = createResolver(import.meta.url);

// Virtual Resolver
const virtResolver = {
const virtualResolver = {
Auth: resolve('./lib/auth.ts'),
AuthENVChecker: resolve("./utils/authEnvCheck.ts"),
DashboardLayout: resolve('./routes/dashboard/layouts/Layout.astro'),
};

// Virtual Components
const virtualComponentMap = `
export * from '${virtResolver.Auth}';
export * from '${virtResolver.AuthENVChecker}';`;
export * from '${virtualResolver.Auth}';
export * from '${virtualResolver.AuthENVChecker}';`;
const VirtualAstroComponents = `
export {default as Layout} from '${virtResolver.DashboardLayout}';`;
export {default as Layout} from '${virtualResolver.DashboardLayout}';`;

// Add Virtual Imports
integrationLogger(logger, verbose, 'info', 'Adding Virtual Imports...');
Expand All @@ -186,12 +186,12 @@ export default defineIntegration({
const studioCMSDTS = fileFactory();

studioCMSDTS.addLines(`declare module 'studiocms-dashboard:auth' {
export const lucia: typeof import('${virtResolver.Auth}').lucia;
export const authEnvCheck: typeof import('${virtResolver.AuthENVChecker}').authEnvCheck;
export const lucia: typeof import('${virtualResolver.Auth}').lucia;
export const authEnvCheck: typeof import('${virtualResolver.AuthENVChecker}').authEnvCheck;
}`);

studioCMSDTS.addLines(`declare module 'studiocms-dashboard:components' {
export const Layout: typeof import('${virtResolver.DashboardLayout}').default;
export const Layout: typeof import('${virtualResolver.DashboardLayout}').default;
}`);

// Add Virtual DTS File
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const {
---
{SHOW_OAUTH && (
<center>
<div class="bg-base-300 rounded-lg p-6 grid grid-cols-1 md:grid-cols-2 gap-4">

{/* <!-- GitHub Provider --> */}
Expand Down Expand Up @@ -96,13 +95,10 @@ const {
{/* <!-- End of Auth0 Provider --> */}

</div>
</center>
)}

{SHOW_PROVIDER_ERROR && (
<center>
<div class="bg-base-300 rounded-lg p-4">
<p class="text-center">No Login provider configured. Please contact your administrator.</p>
</div>
</center>
)}

0 comments on commit 6b13a4e

Please sign in to comment.