fix: use official Headlamp API instead of internal paths

The plugin was importing from internal Headlamp paths like
'@kinvolk/headlamp-plugin/lib/lib/k8s/cluster' instead of using the
official public API '@kinvolk/headlamp-plugin/lib'.

This caused the plugin to fail loading in the browser with:
"TypeError: undefined is not an object (evaluating 'Ot.KubeObject')"

Changes:
- Updated imports to use K8s.cluster and ApiProxy from main export
- Added vite.config.js with custom globals (now obsolete with this fix)
- Moved node-forge to dependencies for proper bundling

The plugin now uses only the official documented Headlamp plugin API.

Fixes: #[issue number if exists]

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
2026-02-12 18:03:37 -05:00
parent 37391cd92a
commit 873ec033fe
5 changed files with 41 additions and 6 deletions
+3 -1
View File
@@ -56,11 +56,13 @@
"overrides": {
"typescript": "5.6.2"
},
"dependencies": {
"node-forge": "^1.3.1"
},
"devDependencies": {
"@iconify/react": "^6.0.2",
"@kinvolk/headlamp-plugin": "^0.13.0",
"@types/node-forge": "^1.3.11",
"node-forge": "^1.3.1",
"typedoc": "^0.28.16",
"typedoc-plugin-markdown": "^4.10.0"
}