File tree 3 files changed +7
-13
lines changed
3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
import { defineCommand , runMain } from "citty" ;
3
- import { version as nitroVersion } from "nitropack/package.json" with {
4
- type : "json" ,
5
- } ;
3
+ import nitroPkg from "nitropack/package.json" with { type : "json" } ;
6
4
7
5
const main = defineCommand ( {
8
6
meta : {
9
7
name : "nitro" ,
10
8
description : "Nitro CLI" ,
11
- version : nitroVersion ,
9
+ version : nitroPkg . version ,
12
10
} ,
13
11
subCommands : {
14
12
dev : ( ) => import ( "./commands/dev" ) . then ( ( r ) => r . default ) ,
Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import { generateFSTree } from "../utils/fs-tree";
5
5
import { writeFile } from "nitropack/kit" ;
6
6
import { scanHandlers } from "../scan" ;
7
7
import type { Nitro , NitroBuildInfo , RollupConfig } from "nitropack/types" ;
8
- import { version as nitroVersion } from "nitropack/package.json" with {
9
- type : "json" ,
10
- } ;
8
+ import nitroPkg from "nitropack/package.json" with { type : "json" } ;
11
9
import { snapshotStorage } from "../utils/storage" ;
12
10
import { formatRollupError } from "./error" ;
13
11
import { writeTypes } from "./types" ;
@@ -40,7 +38,7 @@ export async function buildProduction(
40
38
preset : nitro . options . preset ,
41
39
framework : nitro . options . framework ,
42
40
versions : {
43
- nitro : nitroVersion ,
41
+ nitro : nitroPkg . version ,
44
42
} ,
45
43
commands : {
46
44
preview : nitro . options . commands . preview ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {
13
13
toNodeListener ,
14
14
} from "h3" ;
15
15
import { createProxyServer , ProxyServerOptions } from "httpxy" ;
16
- import { listen , Listener , ListenOptions } from "listhen" ;
16
+ import { listen , Listener } from "listhen" ;
17
17
import { servePlaceholder } from "serve-placeholder" ;
18
18
import serveStatic from "serve-static" ;
19
19
import { resolve } from "pathe" ;
@@ -29,9 +29,7 @@ import { createVFSHandler } from "./vfs";
29
29
import defaultErrorHandler from "./error" ;
30
30
import type { IncomingMessage , OutgoingMessage } from "node:http" ;
31
31
import type { Duplex } from "node:stream" ;
32
- import { version as nitroVersion } from "nitropack/package.json" with {
33
- type : "json" ,
34
- } ;
32
+ import nitroPkg from "nitropack/package.json" with { type : "json" } ;
35
33
36
34
function initWorker ( filename : string ) : Promise < NitroWorker > | undefined {
37
35
if ( ! existsSync ( filename ) ) {
@@ -128,7 +126,7 @@ export function createDevServer(nitro: Nitro): NitroDevServer {
128
126
preset : nitro . options . preset ,
129
127
framework : nitro . options . framework ,
130
128
versions : {
131
- nitro : nitroVersion ,
129
+ nitro : nitroPkg . version ,
132
130
} ,
133
131
dev : {
134
132
pid : process . pid ,
You can’t perform that action at this time.
0 commit comments