Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(about): Provide build info #326

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"constants-browserify": "^1.0.0",
"css-loader": "6.8.1",
"fs-extra": "^11.1.1",
"git-revision-webpack-plugin": "^5.0.0",
"mocha": "^10.2.0",
"node-fetch": "2",
"npm-link-shared": "^0.5.6",
Expand Down
17 changes: 13 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const { dependencies, federatedModuleName } = require('./package.json');
const { name, dependencies, federatedModuleName } = require('./package.json');
const { merge } = require("webpack-merge");
const webpack = require('webpack');
const PermissionsOutputPlugin = require('webpack-permissions-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const path = require("path");
const BG_IMAGES_DIRNAME = "bgimages";
const { GitRevisionPlugin } = require('git-revision-webpack-plugin');
const gitRevisionPlugin = new GitRevisionPlugin();

const kaotoUIpkg = require('@kaoto/kaoto-ui/package.json');

Expand Down Expand Up @@ -138,9 +140,16 @@ const commonConfig = (env) => {
},
plugins: [
new webpack.DefinePlugin({
'KAOTO_API': JSON.stringify("http://localhost:8097"),
'process.env.KAOTO_API': JSON.stringify("http://localhost:8097"), // to remove with Kaoto 1.1.0
'KAOTO_VERSION': JSON.stringify(kaotoUIpkg.version),
KAOTO_VERSION: JSON.stringify(kaotoUIpkg.version),
KAOTO_API: JSON.stringify("http://localhost:8097"),

BUILD_INFO: {
NAME: JSON.stringify(name),
VERSION: JSON.stringify(gitRevisionPlugin.version()),
COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()),
BRANCH: JSON.stringify(gitRevisionPlugin.branch()),
LASTCOMMITDATETIME: JSON.stringify(gitRevisionPlugin.lastcommitdatetime()),
},
}),
new webpack.container.ModuleFederationPlugin({
name: federatedModuleName,
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3607,6 +3607,15 @@ __metadata:
languageName: node
linkType: hard

"git-revision-webpack-plugin@npm:^5.0.0":
version: 5.0.0
resolution: "git-revision-webpack-plugin@npm:5.0.0"
peerDependencies:
webpack: ^5.0.0
checksum: be40634cf0a317f02b6231e77a7f97f5ae85855f87d88ee821500e8ad33a25168b96d47f1be8f2d3e814c22b58b7b9fef732aea5e0ba054b1d181c93d4212de7
languageName: node
linkType: hard

"github-from-package@npm:0.0.0":
version: 0.0.0
resolution: "github-from-package@npm:0.0.0"
Expand Down Expand Up @@ -7432,6 +7441,7 @@ __metadata:
constants-browserify: ^1.0.0
css-loader: 6.8.1
fs-extra: ^11.1.1
git-revision-webpack-plugin: ^5.0.0
mocha: ^10.2.0
node-fetch: 2
npm-link-shared: ^0.5.6
Expand Down