Skip to content

Commit

Permalink
app: add build step to bundle plugin-mgmt
Browse files Browse the repository at this point in the history
This patch introduces a new build step
that bundles and copies the plugin
management file.

Signed-off-by: yolossn <sannagaraj@microsoft.com>
  • Loading branch information
yolossn committed Apr 15, 2024
1 parent aacdb43 commit 9d72132
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
/electron/i18n-helper.js
/electron/preload.js
/electron/windowSize.js
electron/windowSize.test.js
electron/windowSize.test.js
plugin-management.js
5 changes: 3 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/headlamp-k8s/headlamp/#readme",
"productName": "Headlamp",
"scripts": {
"build": "npm run copy-icons && npm run copy-plugins && npm run compile-electron && npm run prod-deps && electron-builder --dir --publish never",
"build": "npm run build-copy-plugin-mgmt && npm run copy-icons && npm run copy-plugins && npm run compile-electron && npm run prod-deps && electron-builder --dir --publish never",
"compile-electron": "babel electron --out-dir electron/ --extensions .ts",
"copy-icons": "mkdirp build/icons && copyfiles -f ../frontend/build/*.png ../frontend/build/*.ico ../frontend/build/*.icns ../frontend/build/*.svg build/icons",
"copy-plugins": "npx --no-install rimraf build/.plugins && mkdirp build/.plugins && copyfiles ../.plugins build/.plugins",
Expand All @@ -17,7 +17,8 @@
"package-msi": "npm run build && node windows/msi/build.js",
"prod-deps": "mkdirp prod_deps && cd ./prod_deps && copyfiles -f ../package.json ../package-lock.json . && npm i --only=prod && cd .. && npx --no-install rimraf ./prod_deps/node_modules/.bin",
"start": "node scripts/start.js",
"test": "jest"
"test": "jest",
"build-copy-plugin-mgmt": "cd ../plugins/headlamp-plugin && (test -e node_modules || npm install) && npx webpack --config ./webpack.config.js && cp ./bin/dist/plugin-management.js ../../app/plugin-management.js"
},
"build": {
"appId": "com.microsoft.Headlamp",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/App/runCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export function runCommand(
throw new Error('runCommand only works in Headlamp app mode.');
}

if (process.env.REACT_APP_ENABLE_RUN_CMD !== 'true') {
throw new Error('Running commands is disabled.');
}
// if (process.env.REACT_APP_ENABLE_RUN_CMD !== 'true') {
// throw new Error('Running commands is disabled.');
// }

// Generate a unique ID for the command, so that we can distinguish between
// multiple commands running at the same time.
Expand Down

0 comments on commit 9d72132

Please sign in to comment.