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 all 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
24 changes: 21 additions & 3 deletions src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { NitroConfig } from "nitropack/types";
import type {
NitroConfig,
NitroOpenAPIConfig,
NitroRouteConfig,
} from "nitropack/types";

// Core
export { createNitro } from "./nitro";
Expand Down Expand Up @@ -50,10 +54,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
19 changes: 3 additions & 16 deletions src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import type { NitroHooks } from "./hooks";
import type { NitroModuleInput } from "./module";
import type { NitroFrameworkInfo } from "./nitro";
import type { NitroOpenAPIConfig } from "./openapi";
export type { NitroOpenAPIConfig } from "./openapi";
import type { NitroPreset } from "./preset";
import type { EsbuildOptions, NodeExternalsOptions } from "./rollup";
import type { RollupConfig } from "./rollup";
Expand Down Expand Up @@ -337,20 +338,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 {}