Skip to content

Commit 0c5049e

Browse files
authored
feat: add version meta (#4194)
1 parent be8b79b commit 0c5049e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/core/nitro.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { consola } from "consola";
22
import { createDebugger, createHooks } from "hookable";
33
import { runtimeDir } from "nitropack/runtime/meta";
4+
import { version as nitroVersion } from "nitropack/meta";
45
import type {
56
LoadConfigOptions,
67
Nitro,
@@ -25,6 +26,10 @@ export async function createNitro(
2526

2627
// Create nitro context
2728
const nitro: Nitro = {
29+
meta: {
30+
version: nitroVersion,
31+
majorVersion: 2,
32+
},
2833
options,
2934
hooks: createHooks(),
3035
vfs: {},

src/types/nitro.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import type { NitroHooks } from "./hooks";
1010
import type { PrerenderRoute } from "./prerender";
1111
import type { TSConfig } from "pkg-types";
1212

13+
export interface NitroMeta {
14+
version: string;
15+
majorVersion: number;
16+
}
17+
1318
export interface Nitro {
19+
meta: NitroMeta;
1420
options: NitroOptions;
1521
scannedHandlers: NitroEventHandler[];
1622
vfs: Record<string, string>;

0 commit comments

Comments
 (0)