Skip to content

Commit 15440d8

Browse files
authored
log @opennextjs package versions (#324)
1 parent 0a6191d commit 15440d8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/cloudflare/src/cli/build/build.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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");
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}

0 commit comments

Comments
 (0)