File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
packages/cloudflare/src/cli/build Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
2020 createWranglerConfigIfNotExistent ,
2121 ensureCloudflareConfig ,
2222} from "./utils/index.js" ;
23+ import { getVersion } from "./utils/version.js" ;
2324
2425/**
2526 * Builds the application in a format that can be passed to workerd
@@ -56,7 +57,9 @@ export async function build(projectOpts: ProjectOptions): Promise<void> {
5657 logger . info ( `App directory: ${ options . appPath } ` ) ;
5758 buildHelper . printNextjsVersion ( options ) ;
5859 ensureNextjsVersionSupported ( options ) ;
59- buildHelper . printOpenNextVersion ( options ) ;
60+ const { aws, cloudflare } = getVersion ( ) ;
61+ logger . info ( `@opennextjs/cloudflare version: ${ cloudflare } ` ) ;
62+ logger . info ( `@opennextjs/aws version: ${ aws } ` ) ;
6063
6164 if ( projectOpts . skipNextBuild ) {
6265 logger . warn ( "Skipping Next.js build" ) ;
Original file line number Diff line number Diff line change 1+ import { createRequire } from "node:module" ;
2+ import { join } from "node:path" ;
3+ import { fileURLToPath } from "node:url" ;
4+
5+ export function getVersion ( ) {
6+ const require = createRequire ( import . meta. url ) ;
7+ const __dirname = fileURLToPath ( new URL ( "." , import . meta. url ) ) ;
8+ const pkgJson = require ( join ( __dirname , "../../../../package.json" ) ) ;
9+ return {
10+ cloudflare : pkgJson . version ,
11+ aws : pkgJson . dependencies [ "@opennextjs/aws" ] ,
12+ } ;
13+ }
You can’t perform that action at this time.
0 commit comments