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

fix: ensure legacy runtime config types are populated #2724

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { NitroConfig } from "nitropack/types";
import type { NitroConfig, NitroRouteConfig } from "nitropack/types";
import type { NitroOpenAPIConfig } from "../types/openapi";
pi0 marked this conversation as resolved.
Show resolved Hide resolved

// Core
export { createNitro } from "./nitro";
Expand Down Expand Up @@ -50,10 +51,24 @@ export {
} from "./scan";

/** @deprecated Use `NitroRuntimeConfig` from `nitropack/types` */
export interface NitroRuntimeConfig {}
export interface NitroRuntimeConfig {
app: NitroRuntimeConfigApp;
nitro: {
envPrefix?: string;
envExpansion?: boolean;
routeRules?: {
[path: string]: NitroRouteConfig;
};
openAPI?: NitroOpenAPIConfig;
};
[key: string]: any;
}

/** @deprecated Use `NitroRuntimeConfigApp` from `nitropack/types` */
export interface NitroRuntimeConfigApp {}
export interface NitroRuntimeConfigApp {
baseURL: string;
[key: string]: any;
}

/** @deprecated Directly import { ... } from "nitropack/types"; */
export type {
Expand Down
18 changes: 2 additions & 16 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,6 @@ export type DatabaseConnectionConfigs = Record<

// Runtime config

export interface NitroRuntimeConfigApp extends NitroTypesRuntimeConfigApp {
baseURL: string;
[key: string]: any;
}
export interface NitroRuntimeConfigApp extends NitroTypesRuntimeConfigApp {}

export interface NitroRuntimeConfig extends NitroTypeskRuntimeConfig {
app: NitroRuntimeConfigApp;
nitro: {
envPrefix?: string;
envExpansion?: boolean;
routeRules?: {
[path: string]: NitroRouteConfig;
};
openAPI?: NitroOpenAPIConfig;
};
[key: string]: any;
}
export interface NitroRuntimeConfig extends NitroTypeskRuntimeConfig {}