Skip to content

Commit f83b540

Browse files
committed
refactor(types): rename integration options to AstroIntegrationOptions
Replace AstroAuthConfig (integration options) with AstroIntegrationOptions to avoid collision with the Auth.js-style AstroAuthConfig in src/types.ts. Update FullAuthConfig extension and all imports/usages accordingly for clearer DX.
1 parent 2da28d0 commit f83b540

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { AuthConfig } from '@auth/core/types';
66
*
77
* @public
88
*/
9-
export interface AstroAuthConfig {
9+
export interface AstroIntegrationOptions {
1010
/**
1111
* Base path for authentication routes.
1212
*
@@ -50,7 +50,7 @@ export interface AstroAuthConfig {
5050
* @public
5151
*/
5252
export interface FullAuthConfig
53-
extends AstroAuthConfig,
53+
extends AstroIntegrationOptions,
5454
Omit<AuthConfig, 'raw'> {}
5555

5656
/**

src/integration.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { AstroIntegration } from 'astro';
2-
import { dirname, join } from 'node:path';
3-
import { type AstroAuthConfig, virtualConfigModule } from './config';
2+
import { type AstroIntegrationOptions, virtualConfigModule } from './config';
43
import { fileURLToPath } from 'node:url';
54

65
/**
@@ -21,14 +20,13 @@ import { fileURLToPath } from 'node:url';
2120
*
2221
* @public
2322
*/
24-
export default (config: AstroAuthConfig = {}): AstroIntegration => ({
23+
export default (config: AstroIntegrationOptions = {}): AstroIntegration => ({
2524
name: 'astro-auth',
2625
hooks: {
2726
'astro:config:setup': async ({
2827
config: astroConfig,
2928
injectRoute,
3029
updateConfig,
31-
logger,
3230
}) => {
3331
// Configure Vite to handle the virtual auth config module
3432
updateConfig({

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"outDir": "./dist",
1111
"rootDir": "./src",
1212
"paths": {
13-
"auth:config": ["src/module.d.ts"]
13+
"auth:config": ["./src/module.d.ts"]
1414
}
1515
},
1616
"include": ["src/**/*"],

0 commit comments

Comments
 (0)