Skip to content

Commit

Permalink
fix: ensure legacy runtime config types are populated (#2724)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Sep 10, 2024
1 parent 0923d79 commit d3880b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
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 {}

0 comments on commit d3880b9

Please sign in to comment.