build: add editor version in build log

This commit is contained in:
himself65
2022-12-22 12:45:09 +08:00
committed by DarkSky
parent 31876cde56
commit 93e74af60b
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -1,4 +1,5 @@
const { getGitVersion, getCommitHash } = require('./scripts/gitInfo');
const { dependencies } = require('./package.json')
/** @type {import('next').NextConfig} */
const nextConfig = {
@@ -12,6 +13,7 @@ const nextConfig = {
CI: process.env.CI || null,
VERSION: getGitVersion(),
COMMIT_HASH: getCommitHash(),
EDITOR_VERSION: dependencies['@blocksuite/editor']
},
images: {
unoptimized: true,
@@ -4,6 +4,7 @@ type Config = {
BUILD_DATE: string;
NODE_ENV: string;
PROJECT_NAME: string;
EDITOR_VERSION: string;
VERSION: string;
CI?: string;
COMMIT_HASH: string;
@@ -28,6 +29,7 @@ const printBuildInfo = () => {
'Environment:',
`${publicRuntimeConfig.NODE_ENV}${publicRuntimeConfig.CI ? '(ci)' : ''}`
);
console.log('Editor Version:', publicRuntimeConfig.EDITOR_VERSION)
console.log('Version:', publicRuntimeConfig.VERSION);
console.log(
'AFFiNE is an open source project, you can view its source code on GitHub!'