1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Compare commits

..

206 Commits

Author SHA1 Message Date
gitstart
f1a960fd78 Add timestamps to the logger messages
Signed-off-by: gitstart <bot@gitstart.com>
Co-authored-by: LuisChiej <54555805+LuisChiej@users.noreply.github.com>
2023-08-09 12:01:42 -04:00
Dustin Feucht
452042f5c5 chore: Update link in CONTRIBUTING.md
The page the link is redirecting to does return a 404.
That's why a link to the most general sub-page is more ideal.

Signed-off-by: Dustin Feucht <code.nopjar@gmail.com>
2023-08-09 09:26:57 -04:00
John Daly
de5fc19240 Update packages/core/src/renderer/components/workloads-pods/container-metrics.injectable.ts
Signed-off-by: John Daly <john.daly2@gmail.com>
2023-08-09 09:26:38 -04:00
John Daly
6e8e58eaf9 Updating PodDetailsContainerMetrics to support fetching metrics for Pods that have multiple containers
Signed-off-by: John Daly <john.daly2@gmail.com>
2023-08-09 09:26:38 -04:00
Gabriel
4ab97d2372 chore: Extract @k8slens/spinner
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-02 13:08:18 +02:00
Gabriel
323b3759fc chore: resolve comments
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 23:38:14 +02:00
Gabriel
2547b19245 chore: update snapshots
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 23:38:14 +02:00
Gabriel
8b69c12ed4 chore: extract @k8slens/notifications
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 23:38:14 +02:00
Jari Kolehmainen
f602ce8f46 chore: extract prometheus from core
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-06-01 13:53:39 -04:00
Gabriel
7274cdde50 chore: include types with void operator for coverage
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 19:03:09 +02:00
Gabriel
34ca6509b8 chore: extract tokens
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 19:03:09 +02:00
Sebastian Malton
21914db35b chore: Fix unit tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
e7f32bce30 fix: Add registration of kubeApiSpecificsFeature
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
d144558c6d chore: Update lockfile
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
a546ae1000 chore: Extract specific KubeApi injectables to own package
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
84017b48db chore: Fix spelling mistake in KubeApi documentation
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
0dd833c00b chore!: Switch to using specific log functions in KubeApi dependencies
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
eee567b7f2 chore: Move storesAndApisCanBeCreatedInjectionToken to @k8slens/kube-api-specifics
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Sebastian Malton
2efa801838 chore: Fix typo in kube-api documentation
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-06-01 09:41:59 -04:00
Jan-Otto Kröpke
48a5e3c3be Update @electron/notarize
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-06-01 08:42:27 -04:00
Gabriel
683ac4efcc chore: remove injectable from export
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 11:36:30 +02:00
Gabriel
58e4ebcdea chore: bump package.json
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 11:36:30 +02:00
Gabriel
86fa93ac8b chore: extract @k8slens/random
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-06-01 11:36:30 +02:00
Janne Savolainen
847f2b1b7b Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Bump ogre-tools to latest

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-06-01 11:09:58 +03:00
Janne Savolainen
fe77164311 Bump ogre-tools for linkable improvements
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-06-01 11:09:58 +03:00
Iku-turso
9a2d585e62 feat: Add support for lens-webpack-build --watch
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-06-01 08:57:01 +03:00
Iku-turso
28c9eeec36 feat: Make lens-webpack-build cope long lasting processes, eg. watch
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-06-01 08:57:01 +03:00
Iku-turso
0c2cc25b5b feat: Make webpack configuration trigger linkable-push
Previously this was done by lens-webpack-build, which is awkward for
build-scripts that watch.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-06-01 08:57:01 +03:00
Sebastian Malton
0c1e822788 chore: Move files around to better places
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 16:21:35 -04:00
Sebastian Malton
34adfcd20b fix: Retrieve projectVersion from main for 'extensions-persistent-storage'
- Prevent the version being changed by the renderer

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 16:21:35 -04:00
Sebastian Malton
5511a2f461 chore: Update snapshots after rebase
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
f6cc1b00c2 chore: Fix lint after rebase
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
b3990b535e chore: Fixup dependency versions of @k8slens/cluster-sidebar
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
a0e38b2178 chore: Update @orge-tools/* deps
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
b1a988e133 chore: Move around Custom Resource and Custom Resource Definition files to simplify names
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
66a7615e9c chore: Factor out NavigateToCustomResources type
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
e641509e3d chore: Cleanup custom resource route definition
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
147be22db3 fix: The command pallet command for navigating to Custom Resource Definitions should navigate to the correct route
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
bedd7a25bb fix: Custom Resource Definitions sidebar item should navigate to the correct route
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
49db31a9aa fix: Custom Resource Definitions should be the first entry in the side bar
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
1ff2436240 chore: Fix tests after rebase
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
54b6375a7e chore: Fix integration tests failing due to helm testid's changing
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
eb78edb226 fix: Fix formatting of custom resource sidebar items
- The titles should better handle being line wrapped

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
d37a765ac2 chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
27a14714c3 chore: Fix IDs for some sidebar items
- Also cleanup formatting of the sidebar item titles

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
27aaa3623d chore: Fixup tests snapshots to match new testid behaviour
- Move order-of-sidebar-items to the new package
- Fix the extension sidebar item registrator

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
7924ab5504 chore: Convert sidebarItemInjectionToken to use InjectWithMetadata instead of duplicating the IDs
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
04273dcda2 chore: Rename sidebar item injectable files
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Sebastian Malton
500ac15703 chore: Extract sidebar item injection token into separate package
- Add unit tests to cover custom resources sidebar items

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-31 14:23:53 -04:00
Gabriel
d28da8e7ac chore: update package version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 23:02:45 +02:00
Gabriel
da1d35d1de chore: extract @k8slens/animate
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 23:02:45 +02:00
Gabriel
ea1f85f224 extract @k8slens/icon
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 23:02:45 +02:00
Gabriel
9e751938bd chore: bump ogre-tools
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 21:35:33 +02:00
Gabriel
8ebe99ae54 chore: update snapshots
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 21:35:33 +02:00
Gabriel
3715a47067 chore: fix lint
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 21:35:33 +02:00
Gabriel
41798b718a extract @k8slens/icon
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-30 21:35:33 +02:00
Iku-turso
7a4f30ab61 chore: Add infra for linkable
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-30 10:56:53 -04:00
Iku-turso
f02e09245b chore: Bump linkable to recover from yalc error
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-30 10:56:53 -04:00
Jim Ehrismann
9f13931318
Temporary fix for extensions always disabled on startup (#7801)
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
2023-05-30 10:24:27 -04:00
Sebastian Malton
5432259e05 fix: Fix build not working due to missing dependencies
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-29 09:38:24 -04:00
Sebastian Malton
8fd0b5fab4 chore: Move kubeApiInjectionToken into own package
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-29 09:38:24 -04:00
Sebastian Malton
711ad11bf1 chore: Revert kube-api-parse test changes
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-29 09:38:24 -04:00
Sami Tiilikainen
75beacfa7c Lint and dependency fix
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
2023-05-29 09:38:24 -04:00
Sami Tiilikainen
b7a636dd74 Add kube-object dependency to prevent duplicate instances
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
2023-05-29 09:38:24 -04:00
Sami Tiilikainen
d674680cbb Use lens-webpack-build to get linkable
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
2023-05-29 09:38:24 -04:00
Jari Kolehmainen
0298b36a9f chore: kube-api lint fixes
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-05-29 09:38:24 -04:00
Jari Kolehmainen
7b8bd1e758 chore: move kube-api related tests from core
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-05-29 09:38:24 -04:00
Jari Kolehmainen
e8be89eb51 chore: fix kube-api dependency to core
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-05-29 09:38:24 -04:00
Jari Kolehmainen
1ab5323f68 chore: extract kube-api from core
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-05-29 09:38:24 -04:00
Alex Andreev
a22229ba60 Linter fix
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-29 12:00:33 +03:00
Alex Andreev
26b8ed66da Reverting table injection tokens (7754)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-29 12:00:33 +03:00
Sebastian Malton
79e4eaa394 Release 6.5.0
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-26 14:00:45 -04:00
Sebastian Malton
f9098bf639 feat: Support picking rebased PRs for patch releases
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-26 11:03:19 -04:00
Alex Andreev
1ffdb6c89f
Table component injection tokens (#7754)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-26 13:32:25 +03:00
Sebastian Malton
4b63bc238e chore: Fix lens-webpack-build failing due to warnings
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 15:15:19 -04:00
Juho Heikka
208262a447 Fix helm chart rollback API address
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
2023-05-25 15:06:56 -04:00
Juho Heikka
6520f2d767 Add space to the Rollback dialog header
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
2023-05-25 15:06:56 -04:00
K8s Lens Bot
e493f982d2 Release 6.5.0-alpha.16
Signed-off-by: K8s Lens Bot <info@k8slens.dev>
2023-05-25 09:57:41 -04:00
Sebastian Malton
4e6b51e2ef chore: Rename KubeObject tests to better clarity
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 09:51:40 -04:00
Sebastian Malton
e7b030e2cd chore: Simplify KubeObject tests to use stub data
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 09:51:40 -04:00
Sebastian Malton
723e8452cf chore: Improve KubeObject tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 09:51:40 -04:00
Sebastian Malton
74cf677b1b chore: Fixup use of ServiceAccount to use getId
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 09:51:40 -04:00
Sebastian Malton
18b89d9a85 fix: Remove incorrect KubeObject validations
- Default to using the ensured selfLink for ID if UID is not present

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-25 09:51:40 -04:00
Sami Tiilikainen
90c449cc0d
fix: Handle log responses as text (#7776)
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
2023-05-25 09:23:18 -04:00
Janne Savolainen
738985c9b7 fix: Make application size not blow up by consolidating dependencies in core package to peerDependencies
"dependencies" are going to be added in the app.asar, which means that e.g. "electron" gets added.

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-25 15:42:53 +03:00
Sebastian Malton
dd62e034b7 Release 6.5.0-alpha.15
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 15:33:41 -04:00
Sebastian Malton
597dd36580 fix: Fix setting milestone on new release PRs
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 15:20:19 -04:00
K8s Lens Bot
a8cf8e11f7 Release 6.5.0-alpha.14
Signed-off-by: K8s Lens Bot <info@k8slens.dev>
2023-05-23 14:52:41 -04:00
Gabriel
bffa39c5ba chore: rebuilt lock
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-23 14:17:18 -04:00
Gabriel
dbbb41eca7 chore: switch from latest to hat 9.6.7
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-23 14:17:18 -04:00
Gabriel
99b6af7246 chore: add engine hat
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-23 14:17:18 -04:00
Gabriel
6bf1544ddb chore: Support and switch to using ^9.6.7 version of NPM
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-23 14:17:18 -04:00
Sebastian Malton
84f6a6a5ac fix: Switch to using authenticated GitHub API to increase rate limit
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 13:21:07 -04:00
Sebastian Malton
ac0e384154 Release 6.5.0-alpha.14
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 11:34:49 -04:00
Sebastian Malton
8f4aa497cc Revert "chore: Extract sidebar item injection token into separate package"
This reverts commit 8ac66380ad.
2023-05-23 10:08:42 -04:00
Sebastian Malton
cb0e8764ac Revert "chore: Rename sidebar item injectable files"
This reverts commit 72a1e2aaa0.
2023-05-23 10:08:42 -04:00
Sebastian Malton
93bc41f9a3 Revert "chore: Convert sidebarItemInjectionToken to use InjectWithMetadata instead of duplicating the IDs"
This reverts commit 81293304a7.
2023-05-23 10:08:42 -04:00
Sebastian Malton
9276df0592 Revert "chore: Fixup tests snapshots to match new testid behaviour"
This reverts commit e6bef1a168.
2023-05-23 10:08:42 -04:00
Sebastian Malton
d90bdf6f14 Revert "chore: Fix lint"
This reverts commit 747f8cec94.
2023-05-23 10:08:42 -04:00
Sebastian Malton
813705fe90 Revert "chore: Fix more lint"
This reverts commit 83244ceefc.
2023-05-23 10:08:42 -04:00
Sebastian Malton
be1fbcf8c3 Revert "chore: Update integration tests to new testid format"
This reverts commit d2183cb975.
2023-05-23 10:08:42 -04:00
Sebastian Malton
753c8bfa85 Revert "chore: Fix IDs for some sidebar items"
This reverts commit a267c0ee7d.
2023-05-23 10:08:42 -04:00
Sebastian Malton
d4c12becfc Revert "chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers"
This reverts commit d51ccb5dd5.
2023-05-23 10:08:42 -04:00
Sebastian Malton
5608a199be Revert "fix: Fix formatting of custom resource sidebar items"
This reverts commit 86dcbb10c0.
2023-05-23 10:08:42 -04:00
Sebastian Malton
96b7ecbadd Revert "chore: Fix integration tests failing due to helm testid's changing"
This reverts commit 6d4d331a41.
2023-05-23 10:08:42 -04:00
Sebastian Malton
1b43de50fe Revert "chore: Fix tests after rebase"
This reverts commit 58426370de.
2023-05-23 10:08:42 -04:00
Sebastian Malton
1099e65c52 Revert "fix: Custom Resource Definitions should be the first entry in the side bar"
This reverts commit a8ff6ce095.
2023-05-23 10:08:42 -04:00
Sebastian Malton
7d46cb845d Revert "fix: Custom Resource Definitions sidebar item should navigate to the correct route"
This reverts commit 897e289514.
2023-05-23 10:08:42 -04:00
Sebastian Malton
fda4b928d2 Revert "fix: The command pallet command for navigating to Custom Resource Definitions should navigate to the correct route"
This reverts commit 723cfe8ae8.
2023-05-23 10:08:42 -04:00
Sebastian Malton
40f1180579 Revert "chore: Cleanup custom resource route definition"
This reverts commit f65e5672b5.
2023-05-23 10:08:42 -04:00
Sebastian Malton
d3cf7088d6 Revert "chore: Factor out NavigateToCustomResources type"
This reverts commit 5ba2dbab81.
2023-05-23 10:08:42 -04:00
Sebastian Malton
5f4cdbc519 Revert "chore: Move around Custom Resource and Custom Resource Definition files to simplify names"
This reverts commit e0e2194b11.
2023-05-23 10:08:42 -04:00
Sebastian Malton
8960142342 Revert "chore: Update @orge-tools/* deps"
This reverts commit 015a585a84.
2023-05-23 10:08:42 -04:00
Jari Kolehmainen
ec9a68bf09 fix: wrong order of ids when sendToFrame is called
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2023-05-23 08:28:10 -04:00
Sebastian Malton
015a585a84 chore: Update @orge-tools/* deps
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
e0e2194b11 chore: Move around Custom Resource and Custom Resource Definition files to simplify names
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
5ba2dbab81 chore: Factor out NavigateToCustomResources type
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
f65e5672b5 chore: Cleanup custom resource route definition
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
723cfe8ae8 fix: The command pallet command for navigating to Custom Resource Definitions should navigate to the correct route
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
897e289514 fix: Custom Resource Definitions sidebar item should navigate to the correct route
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
a8ff6ce095 fix: Custom Resource Definitions should be the first entry in the side bar
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
58426370de chore: Fix tests after rebase
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
6d4d331a41 chore: Fix integration tests failing due to helm testid's changing
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
86dcbb10c0 fix: Fix formatting of custom resource sidebar items
- The titles should better handle being line wrapped

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
d51ccb5dd5 chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
a267c0ee7d chore: Fix IDs for some sidebar items
- Also cleanup formatting of the sidebar item titles

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
d2183cb975 chore: Update integration tests to new testid format
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
83244ceefc chore: Fix more lint
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
747f8cec94 chore: Fix lint
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
e6bef1a168 chore: Fixup tests snapshots to match new testid behaviour
- Move order-of-sidebar-items to the new package
- Fix the extension sidebar item registrator

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
81293304a7 chore: Convert sidebarItemInjectionToken to use InjectWithMetadata instead of duplicating the IDs
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
72a1e2aaa0 chore: Rename sidebar item injectable files
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
8ac66380ad chore: Extract sidebar item injection token into separate package
- Add unit tests to cover custom resources sidebar items

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:46:02 +02:00
Sebastian Malton
add1a0a39e chore: Remove previous daily alpha when trying to create a new one
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:29:13 +02:00
Sebastian Malton
99e6b77fc1 fix: Use correct path for node-shell shell PTY
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-23 10:19:49 +02:00
Sebastian Malton
a20a1eade1 chore: Bumps [electron](https://github.com/electron/electron) from 22.3.7 to 22.3.10
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](electron/electron@v22.3.7...v22.3.10)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-19 15:45:20 -04:00
Sebastian Malton
00f0b9fce4 fix: Remove erroneous prefixes when using loggerInjectable and prefixLoggerInjectable
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-19 14:19:50 -04:00
Gabriel
32a6179681 chore: switch back to arm64
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-17 08:09:59 -04:00
Alex Andreev
2dfb5c00f7
Replace StatusBar bgcolor from --colorInfo to --primary (#7738)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-17 14:26:13 +03:00
Iku-turso
fc641b3838 chore: Update package-lock.json
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
Iku-turso
1b5145bac3 chore: Deprecate obsolete ways to log
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
Iku-turso
62a76d05ab chore: Consolidate to using a shared NPM-script
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
Iku-turso
f9e5f9bf43 feat: Implement automatic Feature-specific prefixing for logging
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
Iku-turso
2e4aba735f chore: Bump ogre-tools to permit Feature-specific logging prefixes
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
Iku-turso
f7b77c781d feat: Expose different ways to log as tokens, and add unit tests
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-17 11:55:05 +03:00
K8s Lens Bot
7c1c7d45e8 Release 6.5.0-alpha.13
Signed-off-by: K8s Lens Bot <info@k8slens.dev>
2023-05-16 16:47:36 -04:00
Sebastian Malton
618a1c7004 chore: Fixup dependencies and ensure no duplication between kinds of dependencies
- Also un-bump xterm-fit-addon as it is only compatible with xterm@^5

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-16 16:42:33 -04:00
Sebastian Malton
a9f48ee93a chore: Simplify file route handling
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-16 16:42:27 -04:00
Sebastian Malton
33a9f3ea35 fix: Copy fonts from @k8slens/core to open-lens correctly
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-16 16:42:27 -04:00
Sebastian Malton
14653c84e6 chore: Fix lint
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-16 16:42:15 -04:00
Sebastian Malton
4f8e4707f9 fix: Switch to using IAsyncComputed to resolve bad setState error within ClusterOverview from react
- The ClusterOverviewStore (now just ClusterStore) is not an exported type,
  so removing the legacy and wrong-abstraction code from it is not
  a breaking change

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-16 16:42:15 -04:00
K8s Lens Bot
4a7eff1841 Release 6.5.0-alpha.12
Signed-off-by: K8s Lens Bot <info@k8slens.dev>
2023-05-16 08:10:45 -04:00
Sebastian Malton
6fc01284d3 chore: Support and switch to using ^9.6.5 version of NPM
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 15:58:46 -04:00
Sebastian Malton
f2247adfdb chore: Fix dev mode of open-lens running is circles
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 15:58:35 -04:00
Sebastian Malton
1a817d314c chore: Update snapshot after rebase with master
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
978015510a chore: Add some behavioural tests for custom columns for custom resources
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
2ca77ecfe8 fix: Fix StrictReactNode not accepting multiple children
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
9ab8cf7bef chore: Remove incorrect function documentation
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
c76b30cf4a chore: Fix typo in CRD view
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
05784f5dfe chore: Fix spelling mistake in CRD type
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
7b57f0d52d chore: Remove unnecessary use of toSafeReactChildrenArray
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
58263497ae chore: Add documenting ref to StrictReactNode type
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
d8823085a8 chore: Change name from SafeReactNode to StrictReactNode
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
e88de58b5d chore: Remove unnecessary use of SingleOrMany<SafeReactNode>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
adb288e48a chore: Update snapshots due to adding new data-testid
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
15b942aa39 chore: Add unit tests to cover the hovering bug
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
Sebastian Malton
9d51ef2aa6 fix: Don't crash when hovering hotbar menu index
- Remove all uses of React.ReactNode as it is unsafe, replace them with
  usages of SafeReactNode which doesn't contain the '{}' type

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-15 11:56:30 -04:00
dependabot[bot]
f13a145a27 chore(deps-dev): Bump xterm-addon-fit from 0.5.0 to 0.7.0
Bumps [xterm-addon-fit](https://github.com/xtermjs/xterm.js) from 0.5.0 to 0.7.0.
- [Release notes](https://github.com/xtermjs/xterm.js/releases)
- [Commits](https://github.com/xtermjs/xterm.js/compare/0.5...0.7)

---
updated-dependencies:
- dependency-name: xterm-addon-fit
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 09:58:32 -04:00
dependabot[bot]
5dd49c1c3c chore(deps-dev): Bump xterm from 4.17.0 to 4.19.0
Bumps [xterm](https://github.com/xtermjs/xterm.js) from 4.17.0 to 4.19.0.
- [Release notes](https://github.com/xtermjs/xterm.js/releases)
- [Commits](https://github.com/xtermjs/xterm.js/compare/4.17.0...4.19.0)

---
updated-dependencies:
- dependency-name: xterm
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 09:53:23 -04:00
dependabot[bot]
266ee3917d chore(deps-dev): Bump monaco-editor from 0.37.1 to 0.38.0
Bumps [monaco-editor](https://github.com/microsoft/monaco-editor) from 0.37.1 to 0.38.0.
- [Release notes](https://github.com/microsoft/monaco-editor/releases)
- [Changelog](https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/microsoft/monaco-editor/compare/v0.37.1...v0.38.0)

---
updated-dependencies:
- dependency-name: monaco-editor
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-15 09:53:09 -04:00
Simon Smith
f7755828bf Update package.json
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
2023-05-15 09:50:31 -04:00
Gabriel
0c7a0b3787 chore: remove commented code
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
3714fb24c1 chore: half remove unoverride, more to follow
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
cc94b69860 chore: half remove unoverride, more to follow
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
8445d6eabc unbump version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
4933b2a402 chore: fix package exports
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
c3bc1ff0d9 chore: revert version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
5bc3f604d8 chore: revert version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
7b28cf89f7 chore: unbump version
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Gabriel
9fc07ab56c chore: export ui-component styles
Signed-off-by: Gabriel <gaccettola@mirantis.com>
2023-05-12 19:57:06 +02:00
Juho Heikka
4dcdd9152c
Add welcome page to hotbar (#7717)
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
2023-05-12 10:05:33 +03:00
Sebastian Malton
138f9d14ff chore: Only download binaries for the current platform by default
- Set the DOWNLOAD_ALL_ARCHITECTURES env var to "true" to download for both platforms

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-11 09:31:49 -04:00
K8s Lens Bot
d73ef8fb1b Release 6.5.0-alpha.11
Signed-off-by: K8s Lens Bot <info@k8slens.dev>
2023-05-11 08:23:35 -04:00
Iku-turso
6902851026 fix: Add missing styles to fix terminal resizing
Co-authored-by: Gabriel <gaccettola@mirantis.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-10 15:14:31 +03:00
Janne Savolainen
e8491ca2d3 fix: Kludge cluster settings not opening when extension introduces new settings without ID when title contains spaces
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-10 15:01:20 +03:00
Janne Savolainen
9c7be39eb1 fix: Bring back search filters for pods which were accidentally removed previously
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-10 14:21:20 +03:00
Alex Andreev
3ffb243111
Fix open-lens package address in prestart-dev (#7714)
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2023-05-10 13:48:09 +03:00
Janne Savolainen
f2cb51884f chore: Adapt unit tests for more strict API parsing
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-10 09:39:01 +03:00
Iku-turso
befbe62e63 chore: Refactor legacy code to use pattern matching
Also add missing unit tests to cover more.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-10 09:39:01 +03:00
Iku-turso
bba0759d27 chore: Introduce utility function to prepend strings
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-10 09:39:01 +03:00
Iku-turso
7ca54d8f07 chore: Introduce utility function for "pattern matching" using regex
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
2023-05-10 09:39:01 +03:00
Janne Savolainen
ce31715cfd chore: Remove dead code in API parsing
apiPrefix is always at least "/", making the removed code unreachable.

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-10 09:39:01 +03:00
Janne Savolainen
bb400ae667 fix: Add test as repro, and fix bug about kube API details not opening
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2023-05-10 09:39:01 +03:00
Sebastian Malton
786e0e8ac9 chore: Fix build failing on non-windows platforms
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 12:50:45 -04:00
Sebastian Malton
c4d56ef1a7 chore: Don't fail daily alpha workflow when there is nothing to release
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 10:10:30 -04:00
Sebastian Malton
3b3d86c9d5 chore: Replace fil:/// instead of file://
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
9f72b628be chore: Remove use of glob in CopyPlugin to fix build
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
2d19948a77 chore: Fix building open-lens on windows
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
71461feec7 chore: Update snapshot of @k8slens/webpack
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
81a9a94acb chore: Remove debug logging
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
0a2bc6cf2c chore: Move describeIf and itIf to @k8slens/test-utils
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
b3f7f9cc56 chore: Remove dead comment
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
700a9024a8 chore: Run lint on webpack/renderer
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
91354eae01 chore: Fix build of open-lens
- Remove need for using relative paths during build

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:55:25 -04:00
Sebastian Malton
6167ad2c25 chore: Fixup unit tests calling 'allowKubeResource' at the wrong time
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:28:18 -04:00
Sebastian Malton
40af0d31c5 fix: Do not crash when opening details of a helm release
- Switch to using RequestChannel instead of LensProxy for better
  type safety

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2023-05-09 09:28:18 -04:00
1169 changed files with 47585 additions and 35548 deletions

View File

@ -23,7 +23,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Generate Extensions API Reference using typedocs - name: Generate Extensions API Reference using typedocs
run: | run: |

View File

@ -28,7 +28,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Get npm cache directory path - name: Get npm cache directory path
if: ${{ runner.os != 'Windows' }} if: ${{ runner.os != 'Windows' }}

View File

@ -19,7 +19,7 @@ jobs:
registry-url: "https://npm.pkg.github.com" registry-url: "https://npm.pkg.github.com"
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Install deps - name: Install deps
run: | run: |
@ -35,4 +35,5 @@ jobs:
env: env:
BUMP_PACKAGE_ARGS: -- --conventional-commits --conventional-prerelease --yes BUMP_PACKAGE_ARGS: -- --conventional-commits --conventional-prerelease --yes
PICK_ALL_PRS: "true" PICK_ALL_PRS: "true"
FAIL_ON_NO_CHANGES: "false"
GH_TOKEN: ${{ secrets.GH_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }}

View File

@ -23,7 +23,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Install deps - name: Install deps
run: npm install run: npm install
@ -33,3 +33,6 @@ jobs:
- name: Verify Publish Configurations - name: Verify Publish Configurations
run: ./scripts/lint-publish-configs.sh run: ./scripts/lint-publish-configs.sh
- name: Verify No Duplicate Dependencies
run: ./scripts/lint-package-dependencies.sh

View File

@ -36,7 +36,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Generate Extensions API Reference using typedocs - name: Generate Extensions API Reference using typedocs
run: | run: |

View File

@ -33,7 +33,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Generate Extensions API Reference using typedocs - name: Generate Extensions API Reference using typedocs
run: | run: |
@ -79,7 +79,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Generate Extensions API Reference using typedocs - name: Generate Extensions API Reference using typedocs
run: | run: |

View File

@ -31,7 +31,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Generate NPM packages - name: Generate NPM packages
run: | run: |

View File

@ -35,7 +35,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Get npm cache directory path - name: Get npm cache directory path
if: ${{ runner.os != 'Windows' }} if: ${{ runner.os != 'Windows' }}
@ -105,7 +105,7 @@ jobs:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install specific npm version - name: Install specific npm version
run: npm install -g npm@9.6.5 run: npm install -g npm@^9.6.7
- name: Get npm cache directory path - name: Get npm cache directory path
if: ${{ runner.os != 'Windows' }} if: ${{ runner.os != 'Windows' }}

3
.gitignore vendored
View File

@ -9,3 +9,6 @@ lerna-debug.log
coverage coverage
dist dist
node_modules node_modules
.linkable.json
yalc.lock
.yalc

View File

@ -1,3 +1,7 @@
open-lens/dist
open-lens/static/build
open-lens/static/webpack
open-lens/binaries
packages/**/dist packages/**/dist
packages/**/static/build packages/**/static/build
packages/**/build/webpack packages/**/build/webpack

View File

@ -1,3 +1,3 @@
# Contributing to Lens # Contributing to Lens
See [Contributing to Lens](https://docs.k8slens.dev/contributing/) documentation. See [Contributing to Lens](https://docs.k8slens.dev/contributing/contribute-to-lens/) documentation.

23
nx.json
View File

@ -4,9 +4,7 @@
"runner": "nx/tasks-runners/default", "runner": "nx/tasks-runners/default",
"options": { "options": {
"cacheableOperations": [ "cacheableOperations": [
"build", "build"
"prepare:dev",
"prepare:lint"
] ]
} }
} }
@ -17,24 +15,29 @@
"^build" "^build"
] ]
}, },
"build:app": {
"dependsOn": [
"^build"
]
},
"test:integration": {
"dependsOn": [
"^build"
]
},
"build:docs": { "build:docs": {
"dependsOn": [ "dependsOn": [
"^build" "^build"
] ]
}, },
"dev": {
"dependsOn": [
"prepare:dev"
]
},
"lint": { "lint": {
"dependsOn": [ "dependsOn": [
"^prepare:test" "^build"
] ]
}, },
"test:unit": { "test:unit": {
"dependsOn": [ "dependsOn": [
"^prepare:test" "^build"
] ]
} }
} }

434
open-lens/CHANGELOG.md Normal file
View File

@ -0,0 +1,434 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 6.5.0 (2023-05-26)
# 6.5.0-alpha.16 (2023-05-25)
### Bug Fixes
* Make application size not blow up by consolidating dependencies in core package to peerDependencies ([738985c](https://github.com/lensapp/lens/commit/738985c9b7406ef0722c3994c560f0337e3c5b7c))
# 6.5.0-alpha.15 (2023-05-23)
# 6.5.0-alpha.14 (2023-05-23)
### Reverts
* Revert "chore: Extract sidebar item injection token into separate package" ([8f4aa49](https://github.com/lensapp/lens/commit/8f4aa497cc54655f83813d57c224f77dd1472141))
* Revert "chore: Update integration tests to new testid format" ([be1fbcf](https://github.com/lensapp/lens/commit/be1fbcf8c3642fbf5a5ee06c3b03ac1756e4b1dd))
* Revert "chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers" ([d4c12be](https://github.com/lensapp/lens/commit/d4c12becfc9020009d64f48e4c8f9dd3b7725bb6))
* Revert "chore: Fix integration tests failing due to helm testid's changing" ([96b7ecb](https://github.com/lensapp/lens/commit/96b7ecbaddedd45cc667cc2d6c25fdc0813557ec))
# 6.5.0-alpha.13 (2023-05-16)
### Bug Fixes
* Copy fonts from @k8slens/core to open-lens correctly ([33a9f3e](https://github.com/lensapp/lens/commit/33a9f3ea3501c04738c8d74b82725bbe83e148bb))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.17 (2023-05-25)
### Bug Fixes
* Make application size not blow up by consolidating dependencies in core package to peerDependencies ([738985c](https://github.com/lensapp/lens/commit/738985c9b7406ef0722c3994c560f0337e3c5b7c))
# 6.5.0-alpha.15 (2023-05-23)
# 6.5.0-alpha.14 (2023-05-23)
### Reverts
* Revert "chore: Extract sidebar item injection token into separate package" ([8f4aa49](https://github.com/lensapp/lens/commit/8f4aa497cc54655f83813d57c224f77dd1472141))
* Revert "chore: Update integration tests to new testid format" ([be1fbcf](https://github.com/lensapp/lens/commit/be1fbcf8c3642fbf5a5ee06c3b03ac1756e4b1dd))
* Revert "chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers" ([d4c12be](https://github.com/lensapp/lens/commit/d4c12becfc9020009d64f48e4c8f9dd3b7725bb6))
* Revert "chore: Fix integration tests failing due to helm testid's changing" ([96b7ecb](https://github.com/lensapp/lens/commit/96b7ecbaddedd45cc667cc2d6c25fdc0813557ec))
# 6.5.0-alpha.13 (2023-05-16)
### Bug Fixes
* Copy fonts from @k8slens/core to open-lens correctly ([33a9f3e](https://github.com/lensapp/lens/commit/33a9f3ea3501c04738c8d74b82725bbe83e148bb))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.16 (2023-05-23)
# 6.5.0-alpha.14 (2023-05-23)
### Reverts
* Revert "chore: Extract sidebar item injection token into separate package" ([8f4aa49](https://github.com/lensapp/lens/commit/8f4aa497cc54655f83813d57c224f77dd1472141))
* Revert "chore: Update integration tests to new testid format" ([be1fbcf](https://github.com/lensapp/lens/commit/be1fbcf8c3642fbf5a5ee06c3b03ac1756e4b1dd))
* Revert "chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers" ([d4c12be](https://github.com/lensapp/lens/commit/d4c12becfc9020009d64f48e4c8f9dd3b7725bb6))
* Revert "chore: Fix integration tests failing due to helm testid's changing" ([96b7ecb](https://github.com/lensapp/lens/commit/96b7ecbaddedd45cc667cc2d6c25fdc0813557ec))
# 6.5.0-alpha.13 (2023-05-16)
### Bug Fixes
* Copy fonts from @k8slens/core to open-lens correctly ([33a9f3e](https://github.com/lensapp/lens/commit/33a9f3ea3501c04738c8d74b82725bbe83e148bb))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.15 (2023-05-23)
# 6.5.0-alpha.14 (2023-05-23)
### Reverts
* Revert "chore: Extract sidebar item injection token into separate package" ([8f4aa49](https://github.com/lensapp/lens/commit/8f4aa497cc54655f83813d57c224f77dd1472141))
* Revert "chore: Update integration tests to new testid format" ([be1fbcf](https://github.com/lensapp/lens/commit/be1fbcf8c3642fbf5a5ee06c3b03ac1756e4b1dd))
* Revert "chore: Improve title formatting for Horizontal/Vertical Pod Autoscalers" ([d4c12be](https://github.com/lensapp/lens/commit/d4c12becfc9020009d64f48e4c8f9dd3b7725bb6))
* Revert "chore: Fix integration tests failing due to helm testid's changing" ([96b7ecb](https://github.com/lensapp/lens/commit/96b7ecbaddedd45cc667cc2d6c25fdc0813557ec))
# 6.5.0-alpha.13 (2023-05-16)
### Bug Fixes
* Copy fonts from @k8slens/core to open-lens correctly ([33a9f3e](https://github.com/lensapp/lens/commit/33a9f3ea3501c04738c8d74b82725bbe83e148bb))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.13 (2023-05-16)
### Bug Fixes
* Copy fonts from @k8slens/core to open-lens correctly ([33a9f3e](https://github.com/lensapp/lens/commit/33a9f3ea3501c04738c8d74b82725bbe83e148bb))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.11 (2023-05-11)
### Bug Fixes
* Add missing styles to fix terminal resizing ([6902851](https://github.com/lensapp/lens/commit/6902851026e74428f515fc5f3e01e6dc8a4c2d50))
# 6.5.0-alpha.10 (2023-05-09)
# 6.5.0-alpha.9 (2023-05-04)
### Bug Fixes
* Add new packages to open-lens to fix build ([f2f6cc5](https://github.com/lensapp/lens/commit/f2f6cc500c38cdeb4d6e8bd1da16e36c61a07aea))
* Disable cycle detection due to bug in ogre-tools ([d4e8b48](https://github.com/lensapp/lens/commit/d4e8b48b4a166e2aabeab76355765d78a445c43c))
* Fix generating tray icons and downloading binaries on windows ([289d62c](https://github.com/lensapp/lens/commit/289d62caaadcf4899719c6a8b8c2ee4b7e725e9c))
* Fix paths provided as parameters to workspace scripts ([d5acd57](https://github.com/lensapp/lens/commit/d5acd57584887f8eed544650761ef4408481a6a2))
* Readd run-script-os to open-lens to fix build:app ([430beba](https://github.com/lensapp/lens/commit/430bebaa6f90941d0b7e2c88d59aaac0a9260d7f))
* Revise paths for generating tray icons ([58b8b4f](https://github.com/lensapp/lens/commit/58b8b4f1f9113aaedb136ebbf00c568abea0173c))
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.6 (2023-04-12)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
### Bug Fixes
* remove platform specific injectable file names ([9b0318b](https://github.com/lensapp/lens/commit/9b0318b493fe2e49a34b8a4cb3d0bef1600759b8))
### Features
* Allow built versions to specify an environment ([#7495](https://github.com/lensapp/lens/issues/7495)) ([128b05d](https://github.com/lensapp/lens/commit/128b05d4d46344a511398f654865c133c6e36514))
# 6.5.0-alpha.3 (2023-03-15)
# 6.5.0-alpha.2 (2023-03-14)
# 6.5.0-alpha.1 (2023-03-14)
# 6.4.0-beta.13 (2023-02-03)
# 6.4.0-beta.12 (2023-02-01)
# 6.4.0-beta.11 (2023-02-01)
# 6.4.0-beta.10 (2023-01-27)
# 6.4.0-beta.9 (2023-01-27)
# 6.4.0-beta.8 (2023-01-27)
# 6.4.0-beta.7 (2023-01-27)
# 6.4.0-beta.6 (2023-01-26)
# 6.4.0-beta.5 (2023-01-26)
# 6.4.0-beta.4 (2023-01-26)
# 6.4.0-beta.3 (2023-01-26)
# 6.5.0-alpha.9 (2023-05-04)
### Bug Fixes
* Add new packages to open-lens to fix build ([f2f6cc5](https://github.com/lensapp/lens/commit/f2f6cc500c38cdeb4d6e8bd1da16e36c61a07aea))
* Disable cycle detection due to bug in ogre-tools ([d4e8b48](https://github.com/lensapp/lens/commit/d4e8b48b4a166e2aabeab76355765d78a445c43c))
* Fix generating tray icons and downloading binaries on windows ([289d62c](https://github.com/lensapp/lens/commit/289d62caaadcf4899719c6a8b8c2ee4b7e725e9c))
* Fix paths provided as parameters to workspace scripts ([d5acd57](https://github.com/lensapp/lens/commit/d5acd57584887f8eed544650761ef4408481a6a2))
* Readd run-script-os to open-lens to fix build:app ([430beba](https://github.com/lensapp/lens/commit/430bebaa6f90941d0b7e2c88d59aaac0a9260d7f))
* Revise paths for generating tray icons ([58b8b4f](https://github.com/lensapp/lens/commit/58b8b4f1f9113aaedb136ebbf00c568abea0173c))
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.6 (2023-04-12)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
### Bug Fixes
* remove platform specific injectable file names ([9b0318b](https://github.com/lensapp/lens/commit/9b0318b493fe2e49a34b8a4cb3d0bef1600759b8))
### Features
* Allow built versions to specify an environment ([#7495](https://github.com/lensapp/lens/issues/7495)) ([128b05d](https://github.com/lensapp/lens/commit/128b05d4d46344a511398f654865c133c6e36514))
# 6.5.0-alpha.3 (2023-03-15)
# 6.5.0-alpha.2 (2023-03-14)
# 6.5.0-alpha.1 (2023-03-14)
# 6.4.0-beta.13 (2023-02-03)
# 6.4.0-beta.12 (2023-02-01)
# 6.4.0-beta.11 (2023-02-01)
# 6.4.0-beta.10 (2023-01-27)
# 6.4.0-beta.9 (2023-01-27)
# 6.4.0-beta.8 (2023-01-27)
# 6.4.0-beta.7 (2023-01-27)
# 6.4.0-beta.6 (2023-01-26)
# 6.4.0-beta.5 (2023-01-26)
# 6.4.0-beta.4 (2023-01-26)
# 6.4.0-beta.3 (2023-01-26)

View File

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -2,7 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
const { notarize } = require("electron-notarize"); const { notarize } = require("@electron/notarize");
exports.default = async function notarizing(context) { exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context; const { electronPlatformName, appOutDir } = context;
@ -23,5 +23,7 @@ exports.default = async function notarizing(context) {
appleId: process.env.APPLEID, appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS, appleIdPassword: process.env.APPLEIDPASS,
ascProvider: process.env.ASCPROVIDER, ascProvider: process.env.ASCPROVIDER,
teamId: process.env.APPLETEAMID,
tool: process.env.NOTARIZE_TOOL || "legacy",
}); });
}; };

View File

@ -14,7 +14,7 @@ import { minikubeReady } from "../helpers/minikube";
import type { Frame, Page } from "playwright"; import type { Frame, Page } from "playwright";
import { groupBy, toPairs } from "lodash/fp"; import { groupBy, toPairs } from "lodash/fp";
import { pipeline } from "@ogre-tools/fp"; import { pipeline } from "@ogre-tools/fp";
import { describeIf } from "../../../core/src/test-utils/skippers"; import { describeIf } from "@k8slens/test-utils";
const TEST_NAMESPACE = "integration-tests"; const TEST_NAMESPACE = "integration-tests";
@ -172,219 +172,219 @@ const scenarios = [
{ {
expectedSelector: "div[data-testid='cluster-overview-page'] div.label", expectedSelector: "div[data-testid='cluster-overview-page'] div.label",
parentSidebarItemTestId: null, parentSidebarItemTestId: null,
sidebarItemTestId: "sidebar-item-link-for-cluster-overview", sidebarItemTestId: "link-for-sidebar-item-cluster-overview",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: null, parentSidebarItemTestId: null,
sidebarItemTestId: "sidebar-item-link-for-nodes", sidebarItemTestId: "link-for-sidebar-item-nodes",
}, },
{ {
expectedSelector: 'h5 >> text="Overview"', expectedSelector: 'h5 >> text="Overview"',
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-overview", sidebarItemTestId: "link-for-sidebar-item-workloads-overview",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-pods", sidebarItemTestId: "link-for-sidebar-item-pods",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-deployments", sidebarItemTestId: "link-for-sidebar-item-deployments",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-daemon-sets", sidebarItemTestId: "link-for-sidebar-item-daemon-sets",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-stateful-sets", sidebarItemTestId: "link-for-sidebar-item-stateful-sets",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-replica-sets", sidebarItemTestId: "link-for-sidebar-item-replica-sets",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-jobs", sidebarItemTestId: "link-for-sidebar-item-jobs",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-workloads", parentSidebarItemTestId: "link-for-sidebar-item-workloads",
sidebarItemTestId: "sidebar-item-link-for-cron-jobs", sidebarItemTestId: "link-for-sidebar-item-cron-jobs",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-config-maps", sidebarItemTestId: "link-for-sidebar-item-config-maps",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-secrets", sidebarItemTestId: "link-for-sidebar-item-secrets",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-resource-quotas", sidebarItemTestId: "link-for-sidebar-item-resource-quotas",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-limit-ranges", sidebarItemTestId: "link-for-sidebar-item-limit-ranges",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-horizontal-pod-auto-scalers", sidebarItemTestId: "link-for-sidebar-item-horizontal-pod-autoscalers",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-pod-disruption-budgets", sidebarItemTestId: "link-for-sidebar-item-pod-disruption-budgets",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-network", parentSidebarItemTestId: "link-for-sidebar-item-network",
sidebarItemTestId: "sidebar-item-link-for-services", sidebarItemTestId: "link-for-sidebar-item-services",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-network", parentSidebarItemTestId: "link-for-sidebar-item-network",
sidebarItemTestId: "sidebar-item-link-for-endpoints", sidebarItemTestId: "link-for-sidebar-item-endpoints",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-network", parentSidebarItemTestId: "link-for-sidebar-item-network",
sidebarItemTestId: "sidebar-item-link-for-ingresses", sidebarItemTestId: "link-for-sidebar-item-ingresses",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-network", parentSidebarItemTestId: "link-for-sidebar-item-network",
sidebarItemTestId: "sidebar-item-link-for-network-policies", sidebarItemTestId: "link-for-sidebar-item-network-policies",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-storage", parentSidebarItemTestId: "link-for-sidebar-item-storage",
sidebarItemTestId: "sidebar-item-link-for-persistent-volume-claims", sidebarItemTestId: "link-for-sidebar-item-persistent-volume-claims",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-storage", parentSidebarItemTestId: "link-for-sidebar-item-storage",
sidebarItemTestId: "sidebar-item-link-for-persistent-volumes", sidebarItemTestId: "link-for-sidebar-item-persistent-volumes",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-storage", parentSidebarItemTestId: "link-for-sidebar-item-storage",
sidebarItemTestId: "sidebar-item-link-for-storage-classes", sidebarItemTestId: "link-for-sidebar-item-storage-classes",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: null, parentSidebarItemTestId: null,
sidebarItemTestId: "sidebar-item-link-for-namespaces", sidebarItemTestId: "link-for-sidebar-item-namespaces",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: null, parentSidebarItemTestId: null,
sidebarItemTestId: "sidebar-item-link-for-events", sidebarItemTestId: "link-for-sidebar-item-events",
}, },
{ {
expectedSelector: "div.HelmCharts input", expectedSelector: "div.HelmCharts input",
parentSidebarItemTestId: "sidebar-item-link-for-helm", parentSidebarItemTestId: "link-for-sidebar-item-helm",
sidebarItemTestId: "sidebar-item-link-for-charts", sidebarItemTestId: "link-for-sidebar-item-helm-charts",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-helm", parentSidebarItemTestId: "link-for-sidebar-item-helm",
sidebarItemTestId: "sidebar-item-link-for-releases", sidebarItemTestId: "link-for-sidebar-item-helm-releases",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-user-management", parentSidebarItemTestId: "link-for-sidebar-item-user-management",
sidebarItemTestId: "sidebar-item-link-for-service-accounts", sidebarItemTestId: "link-for-sidebar-item-service-accounts",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-user-management", parentSidebarItemTestId: "link-for-sidebar-item-user-management",
sidebarItemTestId: "sidebar-item-link-for-cluster-roles", sidebarItemTestId: "link-for-sidebar-item-cluster-roles",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-user-management", parentSidebarItemTestId: "link-for-sidebar-item-user-management",
sidebarItemTestId: "sidebar-item-link-for-roles", sidebarItemTestId: "link-for-sidebar-item-roles",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-user-management", parentSidebarItemTestId: "link-for-sidebar-item-user-management",
sidebarItemTestId: "sidebar-item-link-for-cluster-role-bindings", sidebarItemTestId: "link-for-sidebar-item-cluster-role-bindings",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-user-management", parentSidebarItemTestId: "link-for-sidebar-item-user-management",
sidebarItemTestId: "sidebar-item-link-for-role-bindings", sidebarItemTestId: "link-for-sidebar-item-role-bindings",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: null, parentSidebarItemTestId: null,
sidebarItemTestId: "sidebar-item-link-for-custom-resources", sidebarItemTestId: "link-for-sidebar-item-custom-resources",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-validating-webhook-configurations", sidebarItemTestId: "link-for-sidebar-item-validating-webhook-configurations",
}, },
{ {
expectedSelector: "h5.title", expectedSelector: "h5.title",
parentSidebarItemTestId: "sidebar-item-link-for-config", parentSidebarItemTestId: "link-for-sidebar-item-config",
sidebarItemTestId: "sidebar-item-link-for-mutating-webhook-configurations", sidebarItemTestId: "link-for-sidebar-item-mutating-webhook-configurations",
}, },
]; ];
const navigateToPods = async (frame: Frame) => { const navigateToPods = async (frame: Frame) => {
await frame.click(`[data-testid="sidebar-item-link-for-workloads"]`); await frame.click(`[data-testid="link-for-sidebar-item-workloads"]`);
await frame.click(`[data-testid="sidebar-item-link-for-pods"]`); await frame.click(`[data-testid="link-for-sidebar-item-pods"]`);
}; };
const navigateToNamespaces = async (frame: Frame) => { const navigateToNamespaces = async (frame: Frame) => {
await frame.click(`[data-testid="sidebar-item-link-for-namespaces"]`); await frame.click(`[data-testid="link-for-sidebar-item-namespaces"]`);
}; };

View File

@ -4,7 +4,7 @@
"productName": "OpenLens", "productName": "OpenLens",
"description": "OpenLens - Open Source IDE for Kubernetes", "description": "OpenLens - Open Source IDE for Kubernetes",
"homepage": "https://github.com/lensapp/lens", "homepage": "https://github.com/lensapp/lens",
"version": "6.5.0-alpha.10", "version": "6.5.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/lensapp/lens.git" "url": "git+https://github.com/lensapp/lens.git"
@ -19,28 +19,25 @@
"author": "OpenLens Authors <info@k8slens.dev>", "author": "OpenLens Authors <info@k8slens.dev>",
"scripts": { "scripts": {
"clean": "rimraf binaries/ dist/ static/build", "clean": "rimraf binaries/ dist/ static/build",
"build": "npm run compile", "build": "cross-env NODE_ENV=production webpack --config webpack/webpack.ts --progress",
"postbuild": "npm run build:tray-icons && npm run download:binaries", "postbuild": "npm run build:tray-icons && npm run download:binaries",
"build:app": "electron-builder --publish onTag", "build:app": "electron-builder --publish onTag",
"prebuild:app": "run-script-os", "prebuild:app": "run-script-os",
"prebuild:app:default": "exit 0", "prebuild:app:default": "exit 0",
"prebuild:app:win32": "rimraf node_modules/win-ca/pem", "prebuild:app:win32": "rimraf node_modules/win-ca/pem",
"build:dir": "npm run compile && electron-builder --dir",
"compile": "cross-env NODE_ENV=production webpack --config webpack/webpack.ts --progress",
"postcompile": "npm run build:tray-icons && npm run download:binaries",
"start": "concurrently -i -k \"npm run dev-run -C\" npm:dev:*", "start": "concurrently -i -k \"npm run dev-run -C\" npm:dev:*",
"dev-run": "nodemon --watch ./static/build/main.js --exec \"electron --remote-debugging-port=9223 --inspect .\"", "dev-run": "nodemon --watch ./static/build/main.js --exec \"electron --remote-debugging-port=9223 --inspect .\"",
"dev:main": "cross-env NODE_ENV=development webpack --config webpack/main.ts --progress --watch", "dev:main": "cross-env NODE_ENV=development webpack --config webpack/main.ts --progress --watch",
"dev:renderer": "cross-env NODE_ENV=development ts-node ./webpack/dev-server.ts", "dev:renderer": "cross-env NODE_ENV=development ts-node ./webpack/dev-server.ts",
"test:integration": "jest -xyz --runInBand --modulePaths=[\"<rootDir>/integration/\"];", "test:integration": "jest -xyz --runInBand --modulePaths=[\"<rootDir>/integration/\"];",
"build:tray-icons": "npm run --workspace @k8slens/generate-tray-icons generate -- --output static/build/tray --input ../core/src/renderer/components/icon/logo-lens.svg --notice-icon ../core/src/renderer/components/icon/notice.svg --spinner-icon ../core/src/renderer/components/icon/arrow-spinner.svg", "build:tray-icons": "npm run --workspace @k8slens/generate-tray-icons generate -- --output static/build/tray --input @k8slens/icon/icons/logo-lens.svg --notice-icon @k8slens/icon/icons/notice.svg --spinner-icon @k8slens/icon/icons/arrow-spinner.svg",
"download:binaries": "npm run --workspace @k8slens/ensure-binaries ensure -- --package package.json --base-dir binaries/client", "download:binaries": "npm run --workspace @k8slens/ensure-binaries ensure -- --package package.json --base-dir binaries/client",
"postinstall": "electron-rebuild" "postinstall": "electron-rebuild"
}, },
"config": { "config": {
"k8sProxyVersion": "0.3.0", "k8sProxyVersion": "0.3.0",
"bundledKubectlVersion": "1.23.3", "bundledKubectlVersion": "1.23.3",
"bundledHelmVersion": "3.7.2", "bundledHelmVersion": "3.11.0",
"sentryDsn": "", "sentryDsn": "",
"contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src https://*.lens.app:*/; img-src * data:", "contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src https://*.lens.app:*/; img-src * data:",
"welcomeRoute": "/welcome" "welcomeRoute": "/welcome"
@ -180,39 +177,132 @@
} }
}, },
"dependencies": { "dependencies": {
"@k8slens/application": "^6.5.0-alpha.5", "@astronautlabs/jsonpath": "^1.1.0",
"@k8slens/application-for-electron-main": "^6.5.0-alpha.4", "@hapi/call": "^9.0.1",
"@k8slens/core": "^6.5.0-alpha.10", "@hapi/subtext": "^7.1.0",
"@k8slens/ensure-binaries": "^6.5.0-alpha.5", "@k8slens/application": "^6.5.0",
"@k8slens/event-emitter": "^1.0.0-alpha.2", "@k8slens/application-for-electron-main": "^6.5.0",
"@k8slens/feature-core": "^6.5.0-alpha.4", "@k8slens/button": "^1.0.0",
"@k8slens/keyboard-shortcuts": "^1.0.0-alpha.4", "@k8slens/cluster-settings": "^6.5.0",
"@k8slens/kube-object": "^1.0.0-alpha.2", "@k8slens/cluster-sidebar": "^1.0.0",
"@k8slens/kubectl-versions": "^1.0.0-alpha.3", "@k8slens/core": "^6.5.0",
"@k8slens/legacy-extension-example": "^1.0.0-alpha.8", "@k8slens/ensure-binaries": "^6.5.0",
"@k8slens/legacy-extensions": "^1.0.0-alpha.4", "@k8slens/error-boundary": "^1.0.0",
"@k8slens/legacy-global-di": "^1.0.0-alpha.1", "@k8slens/event-emitter": "^1.0.0",
"@k8slens/logger": "^1.0.0-alpha.6", "@k8slens/feature-core": "^6.5.0",
"@k8slens/messaging": "^1.0.0-alpha.4", "@k8slens/json-api": "^1.0.0-alpha.3",
"@k8slens/messaging-for-main": "^1.0.0-alpha.4", "@k8slens/keyboard-shortcuts": "^1.0.0",
"@k8slens/messaging-for-renderer": "^1.0.0-alpha.4", "@k8slens/kube-api": "^1.0.0-alpha.1",
"@k8slens/node-fetch": "^6.5.0-alpha.3", "@k8slens/kube-api-specifics": "^1.0.0",
"@k8slens/react-application": "^1.0.0-alpha.3", "@k8slens/kube-object": "^1.0.0",
"@k8slens/run-many": "^1.0.0-alpha.4", "@k8slens/kubectl-versions": "^1.0.0",
"@k8slens/startable-stoppable": "^1.0.0-alpha.3", "@k8slens/legacy-extension-example": "^1.0.0",
"@k8slens/utilities": "^1.0.0-alpha.3", "@k8slens/legacy-extensions": "^1.0.0",
"@ogre-tools/fp": "^15.8.1", "@k8slens/legacy-global-di": "^1.0.0",
"@ogre-tools/injectable": "^15.8.1", "@k8slens/list-layout": "^1.0.0",
"@ogre-tools/injectable-extension-for-auto-registration": "^15.8.1", "@k8slens/logger": "^1.0.0",
"@ogre-tools/injectable-extension-for-mobx": "^15.8.1", "@k8slens/messaging": "^1.0.0",
"@ogre-tools/injectable-react": "^15.8.1", "@k8slens/messaging-for-main": "^1.0.0",
"mobx": "^6.8.0", "@k8slens/messaging-for-renderer": "^1.0.0",
"rimraf": "^4.4.1" "@k8slens/metrics": "^6.5.0",
"@k8slens/node-fetch": "^6.5.0",
"@k8slens/prometheus": "^1.0.0",
"@k8slens/random": "^1.0.0",
"@k8slens/react-application": "^1.0.0",
"@k8slens/resizing-anchor": "^1.0.0",
"@k8slens/resource-templates": "^1.0.0",
"@k8slens/routing": "^1.0.0",
"@k8slens/run-many": "^1.0.0",
"@k8slens/startable-stoppable": "^1.0.0",
"@k8slens/tooltip": "^1.0.0",
"@k8slens/utilities": "^1.0.0",
"@kubernetes/client-node": "^0.18.1",
"@material-ui/core": "^4.12.3",
"@material-ui/lab": "^4.0.0-alpha.60",
"@ogre-tools/fp": "^17.2.0",
"@ogre-tools/injectable": "^17.2.0",
"@ogre-tools/injectable-extension-for-auto-registration": "^17.2.0",
"@ogre-tools/injectable-extension-for-mobx": "^17.2.0",
"@ogre-tools/injectable-react": "^17.2.0",
"@sentry/electron": "^3.0.8",
"@sentry/integrations": "^6.19.3",
"ansi_up": "^5.2.1",
"auto-bind": "^4.0.0",
"await-lock": "^2.2.2",
"byline": "^5.0.0",
"chalk": "^4.1.2",
"chart.js": "^2.9.4",
"chokidar": "^3.5.3",
"color": "^3.2.1",
"conf": "^10.2.0",
"crypto-js": "^4.1.1",
"dompurify": "^2.4.4",
"electron-devtools-installer": "^3.2.0",
"electron-updater": "^4.6.5",
"electron-window-state": "^5.0.3",
"fs-extra": "^9.0.1",
"glob-to-regexp": "^0.4.1",
"grapheme-splitter": "^1.0.4",
"handlebars": "^4.7.7",
"history": "^4.10.1",
"hpagent": "^1.2.0",
"http-proxy": "^1.18.1",
"immer": "^9.0.21",
"joi": "^17.9.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.15",
"marked": "^4.2.12",
"mobx": "^6.9.0",
"mobx-observable-history": "^2.0.3",
"mobx-react": "^7.6.0",
"mobx-utils": "^6.0.4",
"moment": "^2.29.4",
"moment-timezone": "^0.5.40",
"monaco-editor": "^0.38.0",
"node-pty": "0.10.1",
"npm": "^9.6.7",
"p-limit": "^3.1.0",
"path-to-regexp": "^6.2.0",
"proper-lockfile": "^4.1.2",
"query-string": "^7.1.3",
"randomcolor": "^0.6.2",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^17.0.2",
"react-material-ui-carousel": "^2.3.11",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-select": "^5.7.0",
"react-select-event": "^5.5.1",
"react-table": "^7.8.0",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.8.8",
"readable-stream": "^3.6.2",
"rfc6902": "^5.0.1",
"selfsigned": "^2.1.1",
"semver": "^7.3.8",
"stoppable": "^1.1.0",
"tar": "^6.1.13",
"tcp-port-used": "^1.0.2",
"tempy": "1.0.1",
"type-fest": "^2.14.0",
"typed-emitter": "^1.4.0",
"typed-regex": "^0.0.8",
"url-parse": "^1.5.10",
"uuid": "^8.3.2",
"win-ca": "^3.5.0",
"winston": "^3.8.2",
"winston-transport-browserconsole": "^1.0.5",
"ws": "^8.12.1",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-link-provider": "^1.3.1"
}, },
"devDependencies": { "devDependencies": {
"@electron/notarize": "^1.2.3",
"@electron/rebuild": "^3.2.10", "@electron/rebuild": "^3.2.10",
"@k8slens/generate-tray-icons": "^6.5.0-alpha.5", "@k8slens/generate-tray-icons": "^6.5.0",
"@k8slens/test-utils": "^1.0.0-alpha.4", "@k8slens/test-utils": "^1.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@swc/cli": "^0.1.62", "@swc/cli": "^0.1.62",
"@swc/core": "^1.3.53", "@swc/core": "^1.3.53",
@ -234,18 +324,15 @@
"@types/url-parse": "^1.4.8", "@types/url-parse": "^1.4.8",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@types/webpack": "^5.28.1", "@types/webpack": "^5.28.1",
"@types/webpack-dev-server": "^4.7.2",
"@types/webpack-env": "^1.18.0", "@types/webpack-env": "^1.18.0",
"@types/webpack-node-externals": "2.5.3", "@types/webpack-node-externals": "2.5.3",
"autoprefixer": "^10.4.13",
"circular-dependency-plugin": "^5.2.2", "circular-dependency-plugin": "^5.2.2",
"concurrently": "^7.6.0", "concurrently": "^7.6.0",
"copy-webpack-plugin": "^11.0.0", "copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.7.2", "css-loader": "^6.7.2",
"electron": "^22.3.7", "electron": "^22.3.10",
"electron-builder": "^23.6.0", "electron-builder": "^23.6.0",
"electron-notarize": "^0.3.0",
"esbuild-loader": "^2.20.0", "esbuild-loader": "^2.20.0",
"fork-ts-checker-webpack-plugin": "^7.3.0", "fork-ts-checker-webpack-plugin": "^7.3.0",
"html-webpack-plugin": "^5.5.1", "html-webpack-plugin": "^5.5.1",
@ -253,28 +340,21 @@
"jest-environment-jsdom": "^28.1.3", "jest-environment-jsdom": "^28.1.3",
"jsonfile": "^6.1.0", "jsonfile": "^6.1.0",
"mini-css-extract-plugin": "^2.7.1", "mini-css-extract-plugin": "^2.7.1",
"monaco-editor": "^0.37.1",
"monaco-editor-webpack-plugin": "^7.0.1", "monaco-editor-webpack-plugin": "^7.0.1",
"node-loader": "^2.0.0", "node-loader": "^2.0.0",
"nodemon": "^2.0.20", "nodemon": "^2.0.20",
"playwright": "^1.33.0", "playwright": "^1.33.0",
"react-refresh": "^0.14.0",
"react-refresh-typescript": "^2.0.7",
"react-select": "^5.7.0",
"rimraf": "^4.4.1", "rimraf": "^4.4.1",
"run-script-os": "^1.1.6", "run-script-os": "^1.1.6",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"tailwindcss": "^3.3.2", "tailwindcss": "^3.3.2",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"type-fest": "^2.14.0",
"typed-emitter": "^1.4.0",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"typescript-plugin-css-modules": "^4.1.1", "typescript-plugin-css-modules": "^5.0.1",
"webpack": "^5.81.0", "webpack": "^5.81.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.13.3", "webpack-dev-server": "^4.13.3",
"webpack-node-externals": "^3.0.0", "webpack-node-externals": "^3.0.0"
"xterm-addon-fit": "^0.5.0"
} }
} }

View File

@ -12,6 +12,9 @@ import { applicationFeature, startApplicationInjectionToken } from '@k8slens/app
import { applicationFeatureForElectronMain } from '@k8slens/application-for-electron-main' import { applicationFeatureForElectronMain } from '@k8slens/application-for-electron-main'
import { messagingFeatureForMain } from "@k8slens/messaging-for-main"; import { messagingFeatureForMain } from "@k8slens/messaging-for-main";
import { loggerFeature } from "@k8slens/logger"; import { loggerFeature } from "@k8slens/logger";
import { randomFeature } from "@k8slens/random";
import { kubeApiSpecificsFeature } from "@k8slens/kube-api-specifics";
import { prometheusFeature } from "@k8slens/prometheus";
const environment = "main"; const environment = "main";
@ -24,14 +27,15 @@ registerMobX(di);
runInAction(() => { runInAction(() => {
registerLensCore(di, environment); registerLensCore(di, environment);
registerFeature(di, registerFeature(
di,
loggerFeature, loggerFeature,
); prometheusFeature,
registerFeature(di,
applicationFeature, applicationFeature,
applicationFeatureForElectronMain, applicationFeatureForElectronMain,
messagingFeatureForMain, messagingFeatureForMain,
randomFeature,
kubeApiSpecificsFeature,
); );
try { try {

View File

@ -1,13 +1,19 @@
import "@k8slens/core/styles"; import "@k8slens/core/styles";
import "@k8slens/button/dist/index.css"; import "@k8slens/button/styles";
import "@k8slens/error-boundary/dist/index.css"; import "@k8slens/error-boundary/styles";
import "@k8slens/tooltip/dist/index.css"; import "@k8slens/tooltip/styles";
import "@k8slens/resizing-anchor/styles";
import "@k8slens/icon/styles";
import "@k8slens/animate/styles";
import "@k8slens/notifications/styles";
import "@k8slens/spinner/styles";
import { runInAction } from "mobx"; import { runInAction } from "mobx";
import { import {
rendererExtensionApi as Renderer, rendererExtensionApi as Renderer,
commonExtensionApi as Common, commonExtensionApi as Common,
registerLensCore, registerLensCore,
metricsFeature metricsFeature,
} from "@k8slens/core/renderer"; } from "@k8slens/core/renderer";
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration"; import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
import { registerFeature } from "@k8slens/feature-core"; import { registerFeature } from "@k8slens/feature-core";
@ -23,6 +29,11 @@ import { keyboardShortcutsFeature } from "@k8slens/keyboard-shortcuts";
import { reactApplicationFeature } from "@k8slens/react-application"; import { reactApplicationFeature } from "@k8slens/react-application";
import { routingFeature } from "@k8slens/routing"; import { routingFeature } from "@k8slens/routing";
import { loggerFeature } from "@k8slens/logger"; import { loggerFeature } from "@k8slens/logger";
import { animateFeature } from "@k8slens/animate";
import { clusterSidebarFeature } from "@k8slens/cluster-sidebar";
import { randomFeature } from "@k8slens/random";
import { kubeApiSpecificsFeature } from "@k8slens/kube-api-specifics";
import { notificationsFeature } from "@k8slens/notifications";
const environment = "renderer"; const environment = "renderer";
@ -47,7 +58,12 @@ runInAction(() => {
keyboardShortcutsFeature, keyboardShortcutsFeature,
reactApplicationFeature, reactApplicationFeature,
routingFeature, routingFeature,
metricsFeature metricsFeature,
animateFeature,
clusterSidebarFeature,
randomFeature,
kubeApiSpecificsFeature,
notificationsFeature,
); );
autoRegister({ autoRegister({

View File

@ -1,5 +1,5 @@
{ {
"extends": "../../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
@ -15,7 +15,7 @@
}, },
"include": [ "include": [
"src/**/*", "src/**/*",
"../core/types/*.d.ts" "../packages/core/types/*.d.ts"
], ],
"exclude": [ "exclude": [
"out", "out",
@ -23,10 +23,5 @@
"coverage", "coverage",
"binaries", "binaries",
"static" "static"
],
"references": [
{
"path": "../core"
}
] ]
} }

View File

@ -0,0 +1,200 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import path from "path";
import type webpack from "webpack";
import HtmlWebpackPlugin from "html-webpack-plugin";
import MiniCssExtractPlugin from "mini-css-extract-plugin";
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
import MonacoWebpackPlugin from "monaco-editor-webpack-plugin";
import CircularDependencyPlugin from "circular-dependency-plugin";
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
import type { WebpackPluginInstance } from "webpack";
import { DefinePlugin } from "webpack";
import {
assetsFolderName,
isDevelopment,
rendererDir,
buildDir,
htmlTemplate,
publicPath,
} from "./vars";
import corePackageJson from "@k8slens/core/package.json";
const renderer: webpack.Configuration = {
target: "electron-renderer",
name: "lens-app-renderer",
mode: isDevelopment ? "development" : "production",
// https://webpack.js.org/configuration/devtool/ (see description of each option)
devtool: isDevelopment ? "cheap-module-source-map" : "source-map",
cache: isDevelopment ? { type: "filesystem" } : false,
entry: {
lens: path.resolve(rendererDir, "index.ts"),
},
output: {
libraryTarget: "global",
globalObject: "this",
publicPath,
path: buildDir,
filename: "[name].js",
chunkFilename: "chunks/[name].js",
assetModuleFilename: `${assetsFolderName}/[name][ext][query]`,
},
watchOptions: {
ignored: /node_modules/, // https://webpack.js.org/configuration/watch/
},
ignoreWarnings: [
/Critical dependency: the request of a dependency is an expression/,
/require.extensions is not supported by webpack./, // handlebars
/\[ReactRefreshPlugin] .*?HMR.*? is not enabled/, // enabled in webpack.dev-server
],
resolve: {
extensions: [".js", ".jsx", ".json", ".ts", ".tsx"],
},
externals: ["npm", "win-ca"],
optimization: {
minimize: false,
},
module: {
parser: {
javascript: {
commonjsMagicComments: true,
},
},
rules: [
{
test: /\.node$/,
use: "node-loader",
},
{
test: /\.tsx?$/,
loader: "ts-loader",
options: {},
},
cssModulesWebpackRule(),
...iconsAndImagesWebpackRules(),
...fontsLoaderWebpackRules(),
],
},
plugins: [
new DefinePlugin({
CONTEXT_MATCHER_FOR_NON_FEATURES: `/\\.injectable\\.tsx?$/`,
CONTEXT_MATCHER_FOR_FEATURES: `/\\/(renderer|common)\\/.+\\.injectable\\.tsx?$/`,
}),
new ForkTsCheckerPlugin(),
// see also: https://github.com/Microsoft/monaco-editor-webpack-plugin#options
new MonacoWebpackPlugin({
// publicPath: "/",
// filename: "[name].worker.js",
languages: ["json", "yaml"],
globalAPI: isDevelopment,
}),
new HtmlWebpackPlugin({
filename: "index.html",
template: htmlTemplate,
inject: true,
hash: true,
templateParameters: {
assetPath: `${publicPath}${assetsFolderName}`,
},
}),
new CircularDependencyPlugin({
cwd: __dirname,
exclude: /node_modules/,
failOnError: true,
}) as unknown as WebpackPluginInstance,
new MiniCssExtractPlugin({
filename: "[name].css",
}),
new CopyPlugin({
patterns: [
{
from: path.resolve(
path.dirname(require.resolve("@k8slens/core/package.json")),
corePackageJson.exports["./fonts"]
),
to: "fonts/[name][ext]",
},
],
}),
...(isDevelopment ? [new ReactRefreshWebpackPlugin()] : []),
],
};
/**
* Import icons and image files.
* Read more about asset types: https://webpack.js.org/guides/asset-modules/
*/
export function iconsAndImagesWebpackRules(): webpack.RuleSetRule[] {
return [
{
test: /\.svg$/,
type: "asset/source", // exports the source code of the asset, so we get XML
},
{
test: /\.(jpg|png|ico)$/,
type: "asset/resource",
generator: {
filename: "images/[name][ext]",
},
},
];
}
/**
* Import custom fonts as URL.
*/
export function fontsLoaderWebpackRules(): webpack.RuleSetRule[] {
return [
{
test: /\.(ttf|eot|woff2?)$/,
type: "asset/resource",
generator: {
filename: "fonts/[name][ext]",
},
},
];
}
export interface CssModulesWebpackRuleOptions {
styleLoader?: string;
}
/**
* Import CSS or SASS styles with modules support (*.module.scss)
*/
export function cssModulesWebpackRule({
styleLoader,
}: CssModulesWebpackRuleOptions = {}): webpack.RuleSetRule {
styleLoader ??= isDevelopment ? "style-loader" : MiniCssExtractPlugin.loader;
return {
test: /\.s?css$/,
use: [
styleLoader,
{
loader: "css-loader",
options: {
sourceMap: isDevelopment,
modules: {
auto: /\.module\./i, // https://github.com/webpack-contrib/css-loader#auto
mode: "local", // :local(.selector) by default
localIdentName: "[name]__[local]--[hash:base64:5]",
},
},
},
],
};
}
export default renderer;

View File

@ -13,9 +13,7 @@ export const assetsFolderName = "assets";
export const rendererDir = path.join(process.cwd(), "src", "renderer"); export const rendererDir = path.join(process.cwd(), "src", "renderer");
export const publicPath = "/build/"; export const publicPath = "/build/";
export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191; export const webpackDevServerPort = Number(process.env.WEBPACK_DEV_SERVER_PORT) || 9191;
export const htmlTemplate = require.resolve("@k8slens/core/template.html");
// TODO: Figure out a way to access these without relative paths export const sassCommonVars = require.resolve("@k8slens/core/vars.scss");
export const htmlTemplate = path.resolve(__dirname, "..", "..", "..", "node_modules", "@k8slens", "core", "src/renderer", "template.html");
export const sassCommonVars = path.resolve(__dirname, "..", "..", "..", "node_modules", "@k8slens", "core", "src", "renderer", "components/vars.scss");
assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer"); assert(Number.isInteger(webpackDevServerPort), "WEBPACK_DEV_SERVER_PORT environment variable must only be an integer");

13620
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,13 @@
{ {
"name": "lens-monorepo", "name": "lens-monorepo",
"private": true, "private": true,
"workspaces": [ "workspaces": [
"packages/**/*" "packages/**/*",
"open-lens"
], ],
"scripts": { "scripts": {
"all:reinstall": "npm run clean:node_modules && npm run all:install", "all:reinstall": "npm run clean:node_modules && npm run all:install",
"all:install": "npx --yes --package npm@9.6.5 npm install", "all:install": "npx --yes --package npm@^9.6.7 npm install",
"adr:create": "echo \"What is the title?\"; read title; adr new \"$title\"", "adr:create": "echo \"What is the title?\"; read title; adr new \"$title\"",
"adr:change-status": "echo \"Decision number?:\"; read decision; adr status $decision", "adr:change-status": "echo \"Decision number?:\"; read decision; adr status $decision",
"adr:update-readme": "adr update", "adr:update-readme": "adr update",
@ -19,14 +18,16 @@
"clean": "lerna run clean --stream", "clean": "lerna run clean --stream",
"clean:node_modules": "lerna clean -y && rimraf node_modules", "clean:node_modules": "lerna clean -y && rimraf node_modules",
"dev": "cross-env NODE_ENV=development lerna run build --stream --skip-nx-cache", "dev": "cross-env NODE_ENV=development lerna run build --stream --skip-nx-cache",
"postdev": "lerna watch -- lerna run build --stream --scope \\$LERNA_PACKAGE_NAME", "postdev": "lerna watch -- lerna run build --stream --include-dependents --scope \\$LERNA_PACKAGE_NAME",
"prestart-dev": "cd packages/open-lens && rimraf static/build/ && npm run build:tray-icons && npm run download:binaries", "prestart-dev": "cd ./open-lens && npm run build:tray-icons && npm run download:binaries",
"start-dev": "lerna run start", "start-dev": "lerna run start",
"postinstall": "linkable",
"lint": "lerna run lint --stream --no-bail", "lint": "lerna run lint --stream --no-bail",
"lint:fix": "lerna run lint:fix --stream", "lint:fix": "lerna run lint:fix --stream",
"mkdocs:serve-local": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest", "mkdocs:serve-local": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest",
"mkdocs:verify": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict", "mkdocs:verify": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -v ${PWD}:/docs mkdocs-serve-local:latest build --strict",
"test:unit": "lerna run --stream test:unit --no-bail", "test:unit": "lerna run --stream test:unit --no-bail",
"test:unit:updatesnapshot": "lerna run --stream test:unit --no-bail -- -u",
"test:unit:watch": "jest --watch", "test:unit:watch": "jest --watch",
"test:integration": "lerna run --stream test:integration --no-bail", "test:integration": "lerna run --stream test:integration --no-bail",
"bump-version": "lerna version --no-git-tag-version --no-push", "bump-version": "lerna version --no-git-tag-version --no-push",
@ -39,13 +40,14 @@
"@types/react": "^17" "@types/react": "^17"
}, },
"devDependencies": { "devDependencies": {
"@ogre-tools/linkable": "^15.8.1", "@ogre-tools/linkable": "^17.2.0",
"adr": "^1.4.3", "adr": "^1.4.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"lerna": "^6.6.1", "lerna": "^6.6.1",
"npm": "^9.6.7",
"rimraf": "^4.4.1" "rimraf": "^4.4.1"
}, },
"engines": { "engines": {
"npm": "9.6.5" "npm": "^9.6.7"
} }
} }

View File

@ -3,6 +3,123 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 1.0.0 (2023-05-26)
# 6.5.0-alpha.14 (2023-05-23)
# 6.5.0-alpha.13 (2023-05-16)
# 6.5.0-alpha.12 (2023-05-16)
### Bug Fixes
* Don't crash when hovering hotbar menu index ([9d51ef2](https://github.com/lensapp/lens/commit/9d51ef2aa69c6c9df0fd57281b25131a10efd27a))
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
# 1.0.0-alpha.7 (2023-05-16)
# 6.5.0-alpha.12 (2023-05-16)
### Bug Fixes
* Don't crash when hovering hotbar menu index ([9d51ef2](https://github.com/lensapp/lens/commit/9d51ef2aa69c6c9df0fd57281b25131a10efd27a))
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
# 1.0.0-alpha.6 (2023-05-16)
### Bug Fixes
* Don't crash when hovering hotbar menu index ([9d51ef2](https://github.com/lensapp/lens/commit/9d51ef2aa69c6c9df0fd57281b25131a10efd27a))
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
# 1.0.0-alpha.5 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
# 6.5.0-alpha.5 (2023-04-12)
# 6.5.0-alpha.4 (2023-04-12)
**Note:** Version bump only for package @k8slens/keyboard-shortcuts
# 1.0.0-alpha.4 (2023-05-04) # 1.0.0-alpha.4 (2023-05-04)

View File

@ -1,7 +1,7 @@
{ {
"name": "@k8slens/keyboard-shortcuts", "name": "@k8slens/keyboard-shortcuts",
"private": false, "private": false,
"version": "1.0.0-alpha.4", "version": "1.0.0",
"description": "Keyboard shortcuts for Lens", "description": "Keyboard shortcuts for Lens",
"type": "commonjs", "type": "commonjs",
"files": [ "files": [
@ -33,17 +33,17 @@
"peerDependencies": { "peerDependencies": {
"@k8slens/feature-core": "^6.5.0-alpha.0", "@k8slens/feature-core": "^6.5.0-alpha.0",
"@k8slens/react-application": "^1.0.0-alpha.0", "@k8slens/react-application": "^1.0.0-alpha.0",
"@ogre-tools/fp": "^15.8.1", "@ogre-tools/fp": "^17.2.0",
"@ogre-tools/injectable": "^15.8.1", "@ogre-tools/injectable": "^17.2.0",
"@ogre-tools/injectable-extension-for-auto-registration": "^15.8.1", "@ogre-tools/injectable-extension-for-auto-registration": "^17.2.0",
"@ogre-tools/injectable-react": "^15.8.1", "@ogre-tools/injectable-react": "^17.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"react": "^17 || ^18" "react": "^17 || ^18"
}, },
"devDependencies": { "devDependencies": {
"@async-fn/jest": "^1.6.4", "@async-fn/jest": "^1.6.4",
"@k8slens/eslint-config": "^6.5.0-alpha.3", "@k8slens/eslint-config": "^6.5.0",
"@k8slens/react-testing-library-discovery": "^1.0.0-alpha.4", "@k8slens/react-testing-library-discovery": "^1.0.0",
"@k8slens/webpack": "^6.5.0-alpha.5" "@k8slens/webpack": "^6.5.0"
} }
} }

View File

@ -1,10 +1,11 @@
import type { StrictReactNode } from "@k8slens/utilities";
import { withInjectables } from "@ogre-tools/injectable-react"; import { withInjectables } from "@ogre-tools/injectable-react";
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import invokeShortcutInjectable, { InvokeShortcut } from "./invoke-shortcut.injectable"; import invokeShortcutInjectable, { InvokeShortcut } from "./invoke-shortcut.injectable";
export interface KeyboardShortcutListenerProps { export interface KeyboardShortcutListenerProps {
children: React.ReactNode; children: StrictReactNode;
} }
interface Dependencies { interface Dependencies {

View File

@ -1,8 +1,9 @@
import type { StrictReactNode } from "@k8slens/utilities";
import React from "react"; import React from "react";
export interface KeyboardShortcutScopeProps { export interface KeyboardShortcutScopeProps {
id: string; id: string;
children: React.ReactNode; children: StrictReactNode;
} }
export const KeyboardShortcutScope = ({ id, children }: KeyboardShortcutScopeProps) => ( export const KeyboardShortcutScope = ({ id, children }: KeyboardShortcutScopeProps) => (

View File

@ -3,6 +3,110 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 6.5.0 (2023-05-26)
# 6.5.0-alpha.14 (2023-05-23)
# 6.5.0-alpha.13 (2023-05-16)
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.4 (2023-04-12)
# 6.5.0-alpha.7 (2023-05-16)
# 6.5.0-alpha.12 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.4 (2023-04-12)
# 6.5.0-alpha.6 (2023-05-16)
# 6.5.0-alpha.11 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.4 (2023-04-12)
# 6.5.0-alpha.5 (2023-05-11)
# 6.5.0-alpha.9 (2023-05-04)
### Features
* Compute the kubectl download version map at build time ([0bd7b1f](https://github.com/lensapp/lens/commit/0bd7b1fe92a173379c8a5a1ab7e13cf9e4f8223b))
# 6.5.0-alpha.4 (2023-04-12)
# 6.5.0-alpha.4 (2023-05-04) # 6.5.0-alpha.4 (2023-05-04)

View File

@ -1,6 +1,6 @@
{ {
"name": "@k8slens/cluster-settings", "name": "@k8slens/cluster-settings",
"version": "6.5.0-alpha.4", "version": "6.5.0",
"description": "Injection token exporter for cluster settings configuration", "description": "Injection token exporter for cluster settings configuration",
"license": "MIT", "license": "MIT",
"type": "commonjs", "type": "commonjs",
@ -19,10 +19,10 @@
"build": "lens-webpack-build" "build": "lens-webpack-build"
}, },
"devDependencies": { "devDependencies": {
"@k8slens/webpack": "^6.5.0-alpha.5", "@k8slens/webpack": "^6.5.0",
"rimraf": "^4.4.1" "rimraf": "^4.4.1"
}, },
"peerDependencies": { "peerDependencies": {
"@ogre-tools/injectable": "^15.8.1" "@ogre-tools/injectable": "^17.2.0"
} }
} }

View File

@ -0,0 +1,6 @@
module.exports = {
extends: "@k8slens/eslint-config/eslint",
parserOptions: {
project: "./tsconfig.json",
},
};

View File

@ -0,0 +1 @@
"@k8slens/eslint-config/prettier"

View File

@ -3,7 +3,6 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
export * from "./crd-list"; export * from "./src/tokens";
export * from "./crd-details"; export * from "./src/feature";
export * from "./crd-resources"; export { default as sidebarItemsInjectable } from "./src/sidebar-items.injectable";
export * from "./crd-resource-details";

View File

@ -0,0 +1 @@
module.exports = require("@k8slens/jest").monorepoPackageConfig(__dirname).configForReact;

View File

@ -0,0 +1,48 @@
{
"name": "@k8slens/cluster-sidebar",
"private": false,
"version": "1.0.0",
"description": "Injection tokens for adding new sidebar items within the Cluster View",
"type": "commonjs",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/lensapp/lens.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": {
"name": "OpenLens Authors",
"email": "info@k8slens.dev"
},
"license": "MIT",
"homepage": "https://github.com/lensapp/lens",
"scripts": {
"build": "lens-webpack-build",
"clean": "rimraf dist/",
"test": "jest --coverage --runInBand",
"lint": "lens-lint",
"lint:fix": "lens-lint --fix"
},
"peerDependencies": {
"@k8slens/feature-core": "^6.5.0-alpha.4",
"@k8slens/utilities": "^1.0.0-alpha.3",
"@ogre-tools/injectable": "^17.2.0",
"@ogre-tools/injectable-extension-for-auto-registration": "^17.2.0",
"@ogre-tools/injectable-extension-for-mobx": "^17.2.0",
"mobx": "^6.9.0",
"react": "^17.0.2"
},
"devDependencies": {
"@k8slens/eslint-config": "^6.5.0-alpha.3",
"@k8slens/jest": "^6.5.0-alpha.5",
"@k8slens/typescript": "^6.5.0-alpha.2",
"@k8slens/webpack": "^6.5.0-alpha.5"
}
}

View File

@ -0,0 +1,14 @@
import { getFeature } from "@k8slens/feature-core";
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
export const clusterSidebarFeature = getFeature({
id: "cluster-side-feature",
register: (di) => {
autoRegister({
di,
targetModule: module,
getRequireContexts: () => [require.context("./", true, /\.injectable\.(ts|tsx)$/)],
});
},
});

View File

@ -0,0 +1,174 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { createContainer, DiContainer, getInjectable } from "@ogre-tools/injectable";
import { computed, IComputedValue } from "mobx";
import { noop } from "lodash/fp";
import sidebarItemsInjectable from "./sidebar-items.injectable";
import { SidebarItemDeclaration, sidebarItemInjectionToken } from "./tokens";
import { registerMobX } from "@ogre-tools/injectable-extension-for-mobx";
import { clusterSidebarFeature } from "./feature";
const someParentSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-parent",
instantiate: () => ({
parentId: null,
title: "Some parent",
onClick: noop,
orderNumber: 42,
}),
injectionToken: sidebarItemInjectionToken,
});
const someOtherParentSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-other-parent",
instantiate: () => ({
parentId: null,
title: "Some other parent",
onClick: noop,
orderNumber: 126,
}),
injectionToken: sidebarItemInjectionToken,
});
const someAnotherParentSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-another-parent",
instantiate: () => ({
parentId: null,
title: "Some another parent",
onClick: noop,
orderNumber: 84,
}),
injectionToken: sidebarItemInjectionToken,
});
const someForthParentSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-forth-parent",
instantiate: () => ({
parentId: null,
title: "Some another parent",
onClick: noop,
orderNumber: 84,
isVisible: computed(() => false),
isActive: computed(() => true),
}),
injectionToken: sidebarItemInjectionToken,
});
const someChildSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-child",
instantiate: () => ({
parentId: someParentSidebarItemInjectable.id,
title: "Some child",
onClick: noop,
orderNumber: 168,
}),
injectionToken: sidebarItemInjectionToken,
});
const someOtherChildSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-other-child",
instantiate: () => ({
parentId: someParentSidebarItemInjectable.id,
title: "Some other child",
onClick: noop,
orderNumber: 252,
}),
injectionToken: sidebarItemInjectionToken,
});
const someAnotherChildSidebarItemInjectable = getInjectable({
id: "sidebar-item-some-another-child",
instantiate: () => ({
parentId: someParentSidebarItemInjectable.id,
title: "Some another child",
onClick: noop,
orderNumber: 210,
}),
injectionToken: sidebarItemInjectionToken,
});
describe("order of sidebar items", () => {
let di: DiContainer;
let sidebarItems: IComputedValue<SidebarItemDeclaration[]>;
beforeEach(() => {
di = createContainer("test");
di.register(
someParentSidebarItemInjectable,
someOtherParentSidebarItemInjectable,
someAnotherParentSidebarItemInjectable,
someChildSidebarItemInjectable,
someOtherChildSidebarItemInjectable,
someAnotherChildSidebarItemInjectable,
someForthParentSidebarItemInjectable,
);
clusterSidebarFeature.register(di);
registerMobX(di);
sidebarItems = di.inject(sidebarItemsInjectable);
});
it("has parent items in order", () => {
const actual = sidebarItems.get().map((item) => item.id);
expect(actual).toEqual([
"sidebar-item-some-parent",
"sidebar-item-some-another-parent",
"sidebar-item-some-forth-parent",
"sidebar-item-some-other-parent",
]);
});
it("an item with no children and no isVisible configuration by default is visible", () => {
const item = sidebarItems.get().find((item) => item.id === someAnotherParentSidebarItemInjectable.id);
expect(item?.isVisible.get()).toBe(true);
});
it("an item with no children and an isVisible configuration is whatever the configuration specifies", () => {
const item = sidebarItems.get().find((item) => item.id === someForthParentSidebarItemInjectable.id);
expect(item?.isVisible.get()).toBe(false);
});
it("an item with children is visible if at least one of the children is visible", () => {
const item = sidebarItems.get().find((item) => item.id === "sidebar-item-some-parent");
expect(item?.isVisible.get()).toBe(true);
});
it("an item with no children and no isActive configuration by default is not active", () => {
const item = sidebarItems.get().find((item) => item.id === someAnotherParentSidebarItemInjectable.id);
expect(item?.isActive.get()).toBe(false);
});
it("an item with no children and an isActive configuration is whatever the configuration specifies", () => {
const item = sidebarItems.get().find((item) => item.id === someForthParentSidebarItemInjectable.id);
expect(item?.isActive.get()).toBe(true);
});
it("an item with children is active if at least one of the children is active", () => {
const item = sidebarItems.get().find((item) => item.id === "sidebar-item-some-parent");
expect(item?.isActive.get()).toBe(false);
});
it("has child items in order", () => {
const actual = sidebarItems
.get()
.find((item) => item.id === "sidebar-item-some-parent")
?.children.map((item) => item.id);
expect(actual).toEqual([
"sidebar-item-some-child",
"sidebar-item-some-another-child",
"sidebar-item-some-other-child",
]);
});
});

View File

@ -0,0 +1,60 @@
import { getInjectable, InjectionInstanceWithMeta } from "@ogre-tools/injectable";
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
import { SidebarItemDeclaration, sidebarItemInjectionToken, SidebarItemRegistration } from "./tokens";
import { computed } from "mobx";
import { byOrderNumber } from "@k8slens/utilities";
const getSidebarItemsHierarchy = (
registrations: InjectionInstanceWithMeta<SidebarItemRegistration>[],
parentId: string | null,
): SidebarItemDeclaration[] =>
registrations
.filter(({ instance }) => instance.parentId === parentId)
.map(({ instance: { isActive, isVisible, ...registration }, meta: { id } }) => {
const children = getSidebarItemsHierarchy(registrations, id);
return {
...registration,
id,
children,
isVisible: computed(() => {
if (children.length === 0) {
if (isVisible) {
return isVisible.get();
}
return true;
}
return children.some((child) => child.isVisible.get());
}),
isActive: computed(() => {
if (children.length === 0) {
if (isActive) {
return isActive.get();
}
return false;
}
return children.some((child) => child.isActive.get());
}),
};
})
.sort(byOrderNumber);
const sidebarItemsInjectable = getInjectable({
id: "sidebar-items",
instantiate: (di) => {
const computedInjectMany = di.inject(computedInjectManyInjectable);
const sidebarItemRegistrations = computedInjectMany(sidebarItemInjectionToken);
return computed(() => {
void sidebarItemRegistrations.get();
return getSidebarItemsHierarchy(di.injectManyWithMeta(sidebarItemInjectionToken), null);
});
},
});
export default sidebarItemsInjectable;

View File

@ -0,0 +1,34 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectionToken } from "@ogre-tools/injectable";
import type { IComputedValue } from "mobx";
import type { StrictReactNode } from "@k8slens/utilities";
export interface SidebarItemRegistration {
id?: undefined;
parentId: string | null;
title: StrictReactNode;
onClick: () => void;
getIcon?: () => StrictReactNode;
isActive?: IComputedValue<boolean>;
isVisible?: IComputedValue<boolean>;
orderNumber: number;
}
export interface SidebarItemDeclaration {
id: string;
parentId: string | null;
title: StrictReactNode;
onClick: () => void;
getIcon?: () => StrictReactNode;
isActive: IComputedValue<boolean>;
isVisible: IComputedValue<boolean>;
children: SidebarItemDeclaration[];
}
export const sidebarItemInjectionToken = getInjectionToken<SidebarItemRegistration>({
id: "sidebar-item-injection-token",
});

View File

@ -0,0 +1,4 @@
{
"extends": "@k8slens/typescript/config/base.json",
"include": ["**/*.ts"]
}

View File

@ -0,0 +1 @@
module.exports = require("@k8slens/webpack").configForReact;

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"productName": "", "productName": "",
"description": "Lens Desktop Core", "description": "Lens Desktop Core",
"homepage": "https://github.com/lensapp/lens", "homepage": "https://github.com/lensapp/lens",
"version": "6.5.0-alpha.10", "version": "6.5.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/lensapp/lens.git" "url": "git+https://github.com/lensapp/lens.git"
@ -18,9 +18,13 @@
}, },
"main": "static/build/main.js", "main": "static/build/main.js",
"exports": { "exports": {
"./package.json": "./package.json",
"./main": "./static/build/library/main.js", "./main": "./static/build/library/main.js",
"./renderer": "./static/build/library/renderer.js", "./renderer": "./static/build/library/renderer.js",
"./styles": "./static/build/library/renderer.css" "./styles": "./static/build/library/renderer.css",
"./template.html": "./src/renderer/template.html",
"./vars.scss": "./src/renderer/components/vars.scss",
"./fonts": "./static/build/library/fonts"
}, },
"typesVersions": { "typesVersions": {
"*": { "*": {
@ -38,7 +42,7 @@
"build/notarize.js", "build/notarize.js",
"static/build/library/**/*", "static/build/library/**/*",
"src/renderer/template.html", "src/renderer/template.html",
"templates/**/*", "src/renderer/components/vars.scss",
"types/*", "types/*",
"tsconfig.json" "tsconfig.json"
], ],
@ -96,97 +100,14 @@
], ],
"runtime": "@side/jest-runtime" "runtime": "@side/jest-runtime"
}, },
"nx": {
"targets": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"{workspaceRoot}/static/build/"
]
}
}
},
"dependencies": {
"@astronautlabs/jsonpath": "^1.1.0",
"@hapi/call": "^9.0.1",
"@hapi/subtext": "^7.1.0",
"@k8slens/list-layout": "^1.0.0-alpha.2",
"@k8slens/metrics": "^6.5.0-alpha.5",
"@k8slens/node-fetch": "^6.5.0-alpha.3",
"@k8slens/react-application": "^1.0.0-alpha.3",
"@k8slens/resource-templates": "^1.0.0-alpha.1",
"@kubernetes/client-node": "^0.18.1",
"@material-ui/styles": "^4.11.5",
"@sentry/electron": "^3.0.8",
"@sentry/integrations": "^6.19.3",
"@side/jest-runtime": "^1.1.0",
"auto-bind": "^4.0.0",
"await-lock": "^2.2.2",
"byline": "^5.0.0",
"chokidar": "^3.5.3",
"conf": "^10.2.0",
"crypto-js": "^4.1.1",
"electron-devtools-installer": "^3.2.0",
"electron-updater": "^4.6.5",
"electron-window-state": "^5.0.3",
"filehound": "^1.17.6",
"fs-extra": "^9.0.1",
"glob-to-regexp": "^0.4.1",
"grapheme-splitter": "^1.0.4",
"handlebars": "^4.7.7",
"history": "^4.10.1",
"hpagent": "^1.2.0",
"http-proxy": "^1.18.1",
"immer": "^9.0.21",
"joi": "^17.9.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.15",
"marked": "^4.2.12",
"md5-file": "^5.0.0",
"mobx": "^6.8.0",
"mobx-observable-history": "^2.0.3",
"mobx-react": "^7.6.0",
"mobx-utils": "^6.0.4",
"moment": "^2.29.4",
"moment-timezone": "^0.5.40",
"node-pty": "0.10.1",
"npm": "^9.6.5",
"p-limit": "^3.1.0",
"path-to-regexp": "^6.2.0",
"proper-lockfile": "^4.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-material-ui-carousel": "^2.3.11",
"react-router": "^5.3.4",
"react-virtualized-auto-sizer": "^1.0.7",
"readable-stream": "^3.6.0",
"rfc6902": "^5.0.1",
"selfsigned": "^2.1.1",
"semver": "^7.3.8",
"stoppable": "^1.1.0",
"tar": "^6.1.13",
"tcp-port-used": "^1.0.2",
"tempy": "1.0.1",
"typed-regex": "^0.0.8",
"url-parse": "^1.5.10",
"uuid": "^8.3.2",
"win-ca": "^3.5.0",
"winston": "^3.8.2",
"winston-transport-browserconsole": "^1.0.5",
"ws": "^8.12.1",
"xterm-link-provider": "^1.3.1"
},
"devDependencies": { "devDependencies": {
"@async-fn/jest": "1.6.4", "@async-fn/jest": "1.6.4",
"@k8slens/messaging-fake-bridge": "^1.0.0-alpha.4", "@k8slens/messaging-fake-bridge": "^1.0.0",
"@k8slens/react-testing-library-discovery": "^1.0.0-alpha.4", "@k8slens/react-testing-library-discovery": "^1.0.0",
"@material-ui/core": "^4.12.3", "@k8slens/test-utils": "^1.0.0",
"@material-ui/icons": "^4.11.2", "@ogre-tools/linkable": "^17.2.0",
"@material-ui/lab": "^4.0.0-alpha.60",
"@ogre-tools/linkable": "^15.8.1",
"@sentry/types": "^6.19.7", "@sentry/types": "^6.19.7",
"@side/jest-runtime": "^1.1.0",
"@swc/cli": "^0.1.62", "@swc/cli": "^0.1.62",
"@swc/core": "^1.3.53", "@swc/core": "^1.3.53",
"@swc/jest": "^0.2.26", "@swc/jest": "^0.2.26",
@ -234,24 +155,14 @@
"@types/url-parse": "^1.4.8", "@types/url-parse": "^1.4.8",
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@types/webpack": "^5.28.1", "@types/webpack": "^5.28.1",
"@types/webpack-dev-server": "^4.7.2",
"@types/webpack-env": "^1.18.0", "@types/webpack-env": "^1.18.0",
"@types/webpack-node-externals": "^2.5.3", "@types/webpack-node-externals": "^2.5.3",
"@typescript-eslint/eslint-plugin": "^5.59.1", "@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1", "@typescript-eslint/parser": "^5.59.1",
"adr": "^1.4.3",
"ansi_up": "^5.2.1",
"chalk": "^4.1.2",
"chart.js": "^2.9.4",
"circular-dependency-plugin": "^5.2.2", "circular-dependency-plugin": "^5.2.2",
"color": "^3.2.1",
"command-line-args": "^5.2.1",
"concurrently": "^7.6.0", "concurrently": "^7.6.0",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.7.3", "css-loader": "^6.7.3",
"deepdash": "^5.3.9",
"dompurify": "^2.4.4",
"electron": "^22.3.7",
"electron-builder": "^23.6.0", "electron-builder": "^23.6.0",
"esbuild": "^0.17.8", "esbuild": "^0.17.8",
"esbuild-loader": "^2.21.0", "esbuild-loader": "^2.21.0",
@ -263,98 +174,151 @@
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^2.0.0", "eslint-plugin-unused-imports": "^2.0.0",
"fork-ts-checker-webpack-plugin": "^7.3.0", "fork-ts-checker-webpack-plugin": "^7.3.0",
"identity-obj-proxy": "^3.0.0",
"ignore-loader": "^0.1.2", "ignore-loader": "^0.1.2",
"include-media": "^1.4.9", "include-media": "^1.4.10",
"jest": "^29.5.0", "jest": "^29.5.0",
"jest-canvas-mock": "^2.3.1", "jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^28.1.3", "jest-environment-jsdom": "^28.1.3",
"jest-mock-extended": "^2.0.9", "jest-mock-extended": "^2.0.9",
"make-plural": "^6.2.2",
"memfs": "^3.5.1", "memfs": "^3.5.1",
"memorystream": "^0.3.1", "memorystream": "^0.3.1",
"mini-css-extract-plugin": "^2.7.2", "mini-css-extract-plugin": "^2.7.2",
"mock-http": "^1.1.0", "mock-http": "^1.1.0",
"monaco-editor": "^0.37.1",
"monaco-editor-webpack-plugin": "^7.0.1", "monaco-editor-webpack-plugin": "^7.0.1",
"node-gyp": "^8.3.0",
"node-loader": "^2.0.0", "node-loader": "^2.0.0",
"nodemon": "^2.0.20", "nodemon": "^2.0.20",
"postcss": "^8.4.23",
"postcss-loader": "^6.2.1", "postcss-loader": "^6.2.1",
"query-string": "^7.1.3",
"randomcolor": "^0.6.2",
"react-beautiful-dnd": "^13.1.1",
"react-refresh": "^0.14.0",
"react-refresh-typescript": "^2.0.7",
"react-router-dom": "^5.3.4",
"react-select": "^5.7.0",
"react-select-event": "^5.5.1",
"react-table": "^7.8.0",
"react-window": "^1.8.8",
"rimraf": "^4.4.1", "rimraf": "^4.4.1",
"sass": "^1.62.1",
"sass-loader": "^12.6.0", "sass-loader": "^12.6.0",
"style-loader": "^3.3.1", "style-loader": "^3.3.1",
"tailwindcss": "^3.3.2", "tailwindcss": "^3.3.2",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"type-fest": "^2.14.0",
"typed-emitter": "^1.4.0",
"typedoc": "^0.24.6", "typedoc": "^0.24.6",
"typedoc-plugin-markdown": "^3.15.1", "typedoc-plugin-markdown": "^3.15.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"typescript-plugin-css-modules": "^3.4.0", "typescript-plugin-css-modules": "^5.0.1",
"webpack": "^5.81.0", "webpack": "^5.81.0",
"webpack-cli": "^4.9.2", "webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.13.3", "webpack-dev-server": "^4.13.3",
"webpack-node-externals": "^3.0.0", "webpack-node-externals": "^3.0.0"
"xterm": "4.17.0",
"xterm-addon-fit": "^0.5.0"
}, },
"peerDependencies": { "peerDependencies": {
"@hapi/call": "^9.0.1",
"@hapi/subtext": "^7.1.0",
"@k8slens/animate": "^1.0.0-alpha.0",
"@k8slens/notifications": "^1.0.0",
"@k8slens/application": "^6.5.0-alpha.0", "@k8slens/application": "^6.5.0-alpha.0",
"@k8slens/application-for-electron-main": "^6.5.0-alpha.0", "@k8slens/application-for-electron-main": "^6.5.0-alpha.0",
"@k8slens/button": "^1.0.0-alpha.5", "@k8slens/button": "^1.0.0-alpha.5",
"@k8slens/cluster-settings": "^6.5.0-alpha.1", "@k8slens/cluster-settings": "^6.5.0-alpha.1",
"@k8slens/cluster-sidebar": "^1.0.0",
"@k8slens/error-boundary": "^1.0.0-alpha.5", "@k8slens/error-boundary": "^1.0.0-alpha.5",
"@k8slens/event-emitter": "^1.0.0-alpha.1", "@k8slens/event-emitter": "^1.0.0-alpha.1",
"@k8slens/icon": "^1.0.0-alpha.7",
"@k8slens/kube-api": "^1.0.0-alpha.1",
"@k8slens/kube-api-specifics": "^1.0.0-alpha.1",
"@k8slens/kube-object": "^1.0.0-alpha.5",
"@k8slens/kubectl-versions": "^1.0.0-alpha.0", "@k8slens/kubectl-versions": "^1.0.0-alpha.0",
"@k8slens/legacy-extensions": "^1.0.0-alpha.0", "@k8slens/legacy-extensions": "^1.0.0-alpha.0",
"@k8slens/legacy-global-di": "^1.0.0-alpha.0", "@k8slens/legacy-global-di": "^1.0.0-alpha.0",
"@k8slens/list-layout": "^1.0.0-alpha.4",
"@k8slens/logger": "^1.0.0-alpha.5", "@k8slens/logger": "^1.0.0-alpha.5",
"@k8slens/messaging": "^1.0.0-alpha.1", "@k8slens/messaging": "^1.0.0-alpha.1",
"@k8slens/messaging-for-main": "^1.0.0-alpha.1", "@k8slens/messaging-for-main": "^1.0.0-alpha.1",
"@k8slens/messaging-for-renderer": "^1.0.0-alpha.1", "@k8slens/messaging-for-renderer": "^1.0.0-alpha.1",
"@k8slens/metrics": "^6.5.0-alpha.7",
"@k8slens/node-fetch": "^6.5.0-alpha.3",
"@k8slens/prometheus": "^1.0.0",
"@k8slens/react-application": "^1.0.0-alpha.5",
"@k8slens/random": "^1.0.0",
"@k8slens/resizing-anchor": "^1.0.0-alpha.5", "@k8slens/resizing-anchor": "^1.0.0-alpha.5",
"@k8slens/resource-templates": "^1.0.0-alpha.1",
"@k8slens/routing": "^1.0.0-alpha.5", "@k8slens/routing": "^1.0.0-alpha.5",
"@k8slens/run-many": "^1.0.0-alpha.1", "@k8slens/run-many": "^1.0.0-alpha.1",
"@k8slens/spinner": "^1.0.0",
"@k8slens/startable-stoppable": "^1.0.0-alpha.1", "@k8slens/startable-stoppable": "^1.0.0-alpha.1",
"@k8slens/test-utils": "^1.0.0-alpha.3",
"@k8slens/tooltip": "^1.0.0-alpha.5", "@k8slens/tooltip": "^1.0.0-alpha.5",
"@k8slens/utilities": "^1.0.0-alpha.1", "@k8slens/utilities": "^1.0.0-alpha.1",
"@ogre-tools/fp": "^15.8.1", "@kubernetes/client-node": "^0.18.1",
"@ogre-tools/injectable": "^15.8.1", "@material-ui/core": "^4.12.3",
"@ogre-tools/injectable-extension-for-auto-registration": "^15.8.1", "@material-ui/lab": "^4.0.0-alpha.60",
"@ogre-tools/injectable-extension-for-mobx": "^15.8.1", "@ogre-tools/fp": "^17.2.0",
"@ogre-tools/injectable-react": "^15.8.1", "@ogre-tools/injectable": "^17.2.0",
"@types/byline": "^4.2.33", "@ogre-tools/injectable-extension-for-auto-registration": "^17.2.0",
"@types/chart.js": "^2.9.36", "@ogre-tools/injectable-extension-for-mobx": "^17.2.0",
"@types/color": "^3.0.3", "@ogre-tools/injectable-react": "^17.2.0",
"@types/crypto-js": "^3.1.47", "@sentry/electron": "^3.0.8",
"@types/lodash": "^4.14.191", "@sentry/integrations": "^6.19.3",
"@types/proper-lockfile": "^4.1.2", "ansi_up": "^5.2.1",
"@types/react-dom": "^17.0.16", "auto-bind": "^4.0.0",
"@types/react-router-dom": "^5.3.3", "await-lock": "^2.2.2",
"@types/react-virtualized-auto-sizer": "^1.0.1", "byline": "^5.0.0",
"@types/react-window": "^1.8.5", "chalk": "^4.1.2",
"@types/tar": "^6.1.4", "chart.js": "^2.9.4",
"@types/tcp-port-used": "^1.0.1", "chokidar": "^3.5.3",
"@types/url-parse": "^1.4.8", "color": "^3.2.1",
"@types/uuid": "^8.3.4", "conf": "^10.2.0",
"monaco-editor": "^0.37.1", "crypto-js": "^4.1.1",
"dompurify": "^2.4.4",
"electron": "^22.3.10",
"electron-devtools-installer": "^3.2.0",
"electron-updater": "^4.6.5",
"electron-window-state": "^5.0.3",
"fs-extra": "^9.0.1",
"glob-to-regexp": "^0.4.1",
"grapheme-splitter": "^1.0.4",
"handlebars": "^4.7.7",
"history": "^4.10.1",
"hpagent": "^1.2.0",
"http-proxy": "^1.18.1",
"immer": "^9.0.21",
"joi": "^17.9.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.15",
"marked": "^4.2.12",
"mobx": "^6.9.0",
"mobx-observable-history": "^2.0.3",
"mobx-react": "^7.6.0",
"mobx-utils": "^6.0.4",
"moment": "^2.29.4",
"moment-timezone": "^0.5.40",
"monaco-editor": "^0.38.0",
"node-pty": "0.10.1",
"npm": "^9.6.7",
"path-to-regexp": "^6.2.0",
"proper-lockfile": "^4.1.2",
"query-string": "^7.1.3",
"randomcolor": "^0.6.2",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.1.1",
"react-dom": "^17.0.2",
"react-material-ui-carousel": "^2.3.11",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-select": "^5.7.0", "react-select": "^5.7.0",
"react-select-event": "^5.5.1",
"react-table": "^7.8.0",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.8.8",
"rfc6902": "^5.0.1",
"selfsigned": "^2.1.1",
"semver": "^7.3.8",
"stoppable": "^1.1.0",
"tar": "^6.1.13",
"tcp-port-used": "^1.0.2",
"tempy": "1.0.1",
"type-fest": "^2.14.0",
"typed-emitter": "^1.4.0", "typed-emitter": "^1.4.0",
"xterm-addon-fit": "^0.5.0" "typed-regex": "^0.0.8",
"url-parse": "^1.5.10",
"uuid": "^8.3.2",
"win-ca": "^3.5.0",
"winston": "^3.8.2",
"winston-transport-browserconsole": "^1.0.5",
"ws": "^8.12.1",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-link-provider": "^1.3.1"
} }
} }

View File

@ -7,7 +7,7 @@ import EventEmitter from "events";
import type TypedEmitter from "typed-emitter"; import type TypedEmitter from "typed-emitter";
import { observable, makeObservable } from "mobx"; import { observable, makeObservable } from "mobx";
import { once } from "lodash"; import { once } from "lodash";
import type { Disposer } from "@k8slens/utilities"; import type { Disposer, StrictReactNode } from "@k8slens/utilities";
import { iter } from "@k8slens/utilities"; import { iter } from "@k8slens/utilities";
import type { CategoryColumnRegistration, TitleCellProps } from "../../renderer/components/catalog/custom-category-columns"; import type { CategoryColumnRegistration, TitleCellProps } from "../../renderer/components/catalog/custom-category-columns";
@ -201,7 +201,7 @@ export abstract class CatalogCategory extends (EventEmitter as new () => TypedEm
* Defaults to no badge. * Defaults to no badge.
* The badge is displayed next to the Category name in the Catalog Category menu * The badge is displayed next to the Category name in the Catalog Category menu
*/ */
public getBadge(): React.ReactNode { public getBadge(): StrictReactNode {
return null; return null;
} }

View File

@ -1,21 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx";
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
const crdListRouteInjectable = getInjectable({
id: "crd-list-route",
instantiate: () => ({
path: "/crd/definitions",
clusterFrame: true,
isEnabled: computed(() => true),
}),
injectionToken: frontEndRouteInjectionToken,
});
export default crdListRouteInjectable;

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { shouldShowResourceInjectionToken } from "../../../../../features/cluster/showing-kube-resources/common/allowed-resources-injection-token";
import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
const customResourceDefinitionsRouteInjectable = getInjectable({
id: "custom-resource-definitions-route",
instantiate: (di) => ({
path: "/crd/definitions",
clusterFrame: true,
isEnabled: di.inject(shouldShowResourceInjectionToken, {
group: "apiextensions.k8s.io",
apiName: "customresourcedefinitions",
}),
}),
injectionToken: frontEndRouteInjectionToken,
});
export default customResourceDefinitionsRouteInjectable;

View File

@ -4,19 +4,19 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx"; import { computed } from "mobx";
import type { Route } from "../../../../front-end-route-injection-token"; import type { Route } from "../../../front-end-route-injection-token";
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token"; import { frontEndRouteInjectionToken } from "../../../front-end-route-injection-token";
export interface CustomResourcesPathParameters { export interface CustomResourcesPathParameters {
group?: string; group: string;
name?: string; name: string;
} }
const customResourcesRouteInjectable = getInjectable({ const customResourcesRouteInjectable = getInjectable({
id: "custom-resources-route", id: "custom-resources-route",
instantiate: (): Route<CustomResourcesPathParameters> => ({ instantiate: (): Route<CustomResourcesPathParameters> => ({
path: "/crd/:group?/:name?", path: "/crd/:group/:name",
clusterFrame: true, clusterFrame: true,
isEnabled: computed(() => true), isEnabled: computed(() => true),
}), }),

View File

@ -3,11 +3,11 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import crdListRouteInjectable from "./crd-list-route.injectable"; import { navigateToRouteInjectionToken } from "../../../navigate-to-route-injection-token";
import { navigateToRouteInjectionToken } from "../../../../navigate-to-route-injection-token"; import crdListRouteInjectable from "./custom-resource-definitions.injectable";
const navigateToCrdListInjectable = getInjectable({ const navigateToCustomResourceDefinitionsInjectable = getInjectable({
id: "navigate-to-crd-list", id: "navigate-to-custom-resource-definitions",
instantiate: (di) => { instantiate: (di) => {
const navigateToRoute = di.inject(navigateToRouteInjectionToken); const navigateToRoute = di.inject(navigateToRouteInjectionToken);
@ -17,4 +17,4 @@ const navigateToCrdListInjectable = getInjectable({
}, },
}); });
export default navigateToCrdListInjectable; export default navigateToCustomResourceDefinitionsInjectable;

View File

@ -3,19 +3,20 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { navigateToRouteInjectionToken } from "../../../navigate-to-route-injection-token";
import type { CustomResourcesPathParameters } from "./custom-resources-route.injectable"; import type { CustomResourcesPathParameters } from "./custom-resources-route.injectable";
import customResourcesRouteInjectable from "./custom-resources-route.injectable"; import customResourcesRouteInjectable from "./custom-resources-route.injectable";
import { navigateToRouteInjectionToken } from "../../../../navigate-to-route-injection-token";
export type NavigateToCustomResources = (parameters: CustomResourcesPathParameters) => void;
const navigateToCustomResourcesInjectable = getInjectable({ const navigateToCustomResourcesInjectable = getInjectable({
id: "navigate-to-custom-resources", id: "navigate-to-custom-resources",
instantiate: (di) => { instantiate: (di): NavigateToCustomResources => {
const navigateToRoute = di.inject(navigateToRouteInjectionToken); const navigateToRoute = di.inject(navigateToRouteInjectionToken);
const route = di.inject(customResourcesRouteInjectable); const route = di.inject(customResourcesRouteInjectable);
return (parameters?: CustomResourcesPathParameters) => return (parameters) => navigateToRoute(route, { parameters });
navigateToRoute(route, { parameters });
}, },
}); });

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
import { shouldShowResourceInjectionToken } from "../../../../../../features/cluster/showing-kube-resources/common/allowed-resources-injection-token";
const ingressClassesRouteInjectable = getInjectable({
id: "ingress-classes-route",
instantiate: (di) => ({
path: "/ingress-classes",
clusterFrame: true,
isEnabled: di.inject(shouldShowResourceInjectionToken, {
apiName: "ingressclasses",
group: "networking.k8s.io",
}),
}),
injectionToken: frontEndRouteInjectionToken,
});
export default ingressClassesRouteInjectable;

View File

@ -1,30 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { frontEndRouteInjectionToken } from "../../../../front-end-route-injection-token";
import {
shouldShowResourceInjectionToken,
} from "../../../../../../features/cluster/showing-kube-resources/common/allowed-resources-injection-token";
const ingressClassesesRouteInjectable = getInjectable({
id: "ingress-classes-route",
instantiate: (di) => {
const isEnabled = di.inject(shouldShowResourceInjectionToken, {
apiName: "ingressclasses",
group: "networking.k8s.io",
});
return {
path: "/ingress-classes",
clusterFrame: true,
isEnabled,
};
},
injectionToken: frontEndRouteInjectionToken,
});
export default ingressClassesesRouteInjectable;

View File

@ -4,14 +4,14 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { navigateToRouteInjectionToken } from "../../../../navigate-to-route-injection-token"; import { navigateToRouteInjectionToken } from "../../../../navigate-to-route-injection-token";
import ingressClassesesRouteInjectable from "./ingress-classeses-route.injectable"; import ingressClassesRouteInjectable from "./ingress-classes-route.injectable";
const navigateToIngressesInjectable = getInjectable({ const navigateToIngressesInjectable = getInjectable({
id: "navigate-to-ingress-classes", id: "navigate-to-ingress-classes",
instantiate: (di) => { instantiate: (di) => {
const navigateToRoute = di.inject(navigateToRouteInjectionToken); const navigateToRoute = di.inject(navigateToRouteInjectionToken);
const route = di.inject(ingressClassesesRouteInjectable); const route = di.inject(ingressClassesRouteInjectable);
return () => navigateToRoute(route); return () => navigateToRoute(route);
}, },

View File

@ -26,12 +26,11 @@ export type ImplInitializableInjectionTokensArgs<T> = {
token: Initializable<T>; token: Initializable<T>;
init: (di: DiContainerForInjection) => T | Promise<T>; init: (di: DiContainerForInjection) => T | Promise<T>;
} & ( } & (
{ | {
phase: InjectionToken<Runnable<void>, void>; phase: InjectionToken<Runnable<void>, void>;
runAfter?: Injectable<Runnable<void>, Runnable<void>, void>[]; runAfter?: Injectable<Runnable<void>, Runnable<void>, void>[];
} }
| | {
{
runAfter: Injectable<Runnable<void>, Runnable<void>, void>; runAfter: Injectable<Runnable<void>, Runnable<void>, void>;
phase?: undefined; phase?: undefined;
} }

View File

@ -11,13 +11,12 @@ import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting";
import storesAndApisCanBeCreatedInjectable from "../../../renderer/stores-apis-can-be-created.injectable"; import storesAndApisCanBeCreatedInjectable from "../../../renderer/stores-apis-can-be-created.injectable";
import directoryForKubeConfigsInjectable from "../../app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; import directoryForKubeConfigsInjectable from "../../app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
import directoryForUserDataInjectable from "../../app-paths/directory-for-user-data/directory-for-user-data.injectable"; import directoryForUserDataInjectable from "../../app-paths/directory-for-user-data/directory-for-user-data.injectable";
import { loggerInjectionToken } from "@k8slens/logger"; import { logErrorInjectionToken, loggerInjectionToken, logInfoInjectionToken, logWarningInjectionToken } from "@k8slens/logger";
import type { ApiManager } from "../api-manager"; import type { ApiManager } from "../api-manager";
import apiManagerInjectable from "../api-manager/manager.injectable"; import apiManagerInjectable from "../api-manager/manager.injectable";
import { KubeApi } from "../kube-api"; import { KubeApi } from "@k8slens/kube-api";
import { KubeObject } from "@k8slens/kube-object"; import { KubeObject } from "@k8slens/kube-object";
import { KubeObjectStore } from "../kube-object.store"; import { KubeObjectStore } from "../kube-object.store";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { KubeApi as ExternalKubeApi } from "../../../extensions/common-api/k8s-api"; import { KubeApi as ExternalKubeApi } from "../../../extensions/common-api/k8s-api";
@ -25,6 +24,7 @@ import { Cluster } from "../../cluster/cluster";
import { runInAction } from "mobx"; import { runInAction } from "mobx";
import { customResourceDefinitionApiInjectionToken } from "../api-manager/crd-api-token"; import { customResourceDefinitionApiInjectionToken } from "../api-manager/crd-api-token";
import assert from "assert"; import assert from "assert";
import { maybeKubeApiInjectable } from "@k8slens/kube-api-specifics";
class TestApi extends KubeApi<KubeObject> { class TestApi extends KubeApi<KubeObject> {
protected checkPreferredVersion() { protected checkPreferredVersion() {
@ -58,10 +58,12 @@ describe("ApiManager", () => {
describe("registerApi", () => { describe("registerApi", () => {
it("re-register store if apiBase changed", () => { it("re-register store if apiBase changed", () => {
const apiBase = "apis/v1/foo"; const apiBase = "api/v1/foo";
const fallbackApiBase = "/apis/extensions/v1beta1/foo"; const fallbackApiBase = "/apis/extensions/v1beta1/foo";
const kubeApi = new TestApi({ const kubeApi = new TestApi({
logger: di.inject(loggerInjectionToken), logError: di.inject(logErrorInjectionToken),
logInfo: di.inject(logInfoInjectionToken),
logWarn: di.inject(logWarningInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable), maybeKubeApi: di.inject(maybeKubeApiInjectable),
}, { }, {
objectConstructor: KubeObject, objectConstructor: KubeObject,
@ -136,7 +138,9 @@ describe("ApiManager", () => {
return Object.assign( return Object.assign(
new KubeApi({ new KubeApi({
logger: di.inject(loggerInjectionToken), logError: di.inject(logErrorInjectionToken),
logInfo: di.inject(logInfoInjectionToken),
logWarn: di.inject(logWarningInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable), maybeKubeApi: di.inject(maybeKubeApiInjectable),
}, { objectConstructor }), }, { objectConstructor }),
{ {

View File

@ -1,52 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting";
import storesAndApisCanBeCreatedInjectable from "../../../renderer/stores-apis-can-be-created.injectable";
import apiKubeInjectable from "../../../renderer/k8s/api-kube.injectable";
import type { DeploymentApi } from "../endpoints/deployment.api";
import deploymentApiInjectable from "../endpoints/deployment.api.injectable";
import type { KubeJsonApi } from "../kube-json-api";
describe("DeploymentApi", () => {
let deploymentApi: DeploymentApi;
let kubeJsonApi: jest.Mocked<KubeJsonApi>;
beforeEach(() => {
const di = getDiForUnitTesting();
di.override(storesAndApisCanBeCreatedInjectable, () => true);
kubeJsonApi = {
getResponse: jest.fn(),
get: jest.fn(),
post: jest.fn(),
put: jest.fn(),
patch: jest.fn(),
del: jest.fn(),
} as never;
di.override(apiKubeInjectable, () => kubeJsonApi);
deploymentApi = di.inject(deploymentApiInjectable);
});
describe("scale", () => {
it("requests Kubernetes API with PATCH verb and correct amount of replicas", async () => {
await deploymentApi.scale({ namespace: "default", name: "deployment-1" }, 5);
expect(kubeJsonApi.patch).toHaveBeenCalledWith("/apis/apps/v1/namespaces/default/deployments/deployment-1/scale", {
data: {
spec: {
replicas: 5,
},
},
},
{
headers: {
"content-type": "application/merge-patch+json",
},
});
});
});
});

View File

@ -1,130 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
jest.mock("../kube-api");
jest.mock("../api-manager", () => ({
apiManager() {
return {
registerStore: jest.fn(),
};
},
}));
import type { IKubeApiParsed } from "../kube-api-parse";
import { parseKubeApi } from "../kube-api-parse";
/**
* [<input-url>, <expected-result>]
*/
type KubeApiParseTestData = [string, IKubeApiParsed];
const tests: KubeApiParseTestData[] = [
["/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/prometheuses.monitoring.coreos.com", {
apiBase: "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions",
apiPrefix: "/apis",
apiGroup: "apiextensions.k8s.io",
apiVersion: "v1beta1",
apiVersionWithGroup: "apiextensions.k8s.io/v1beta1",
namespace: undefined,
resource: "customresourcedefinitions",
name: "prometheuses.monitoring.coreos.com",
}],
["/api/v1/namespaces/kube-system/pods/coredns-6955765f44-v8p27", {
apiBase: "/api/v1/pods",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
namespace: "kube-system",
resource: "pods",
name: "coredns-6955765f44-v8p27",
}],
["/apis/stable.example.com/foo1/crontabs", {
apiBase: "/apis/stable.example.com/foo1/crontabs",
apiPrefix: "/apis",
apiGroup: "stable.example.com",
apiVersion: "foo1",
apiVersionWithGroup: "stable.example.com/foo1",
resource: "crontabs",
name: undefined,
namespace: undefined,
}],
["/apis/cluster.k8s.io/v1alpha1/clusters", {
apiBase: "/apis/cluster.k8s.io/v1alpha1/clusters",
apiPrefix: "/apis",
apiGroup: "cluster.k8s.io",
apiVersion: "v1alpha1",
apiVersionWithGroup: "cluster.k8s.io/v1alpha1",
resource: "clusters",
name: undefined,
namespace: undefined,
}],
["/api/v1/namespaces", {
apiBase: "/api/v1/namespaces",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
resource: "namespaces",
name: undefined,
namespace: undefined,
}],
["/api/v1/secrets", {
apiBase: "/api/v1/secrets",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
resource: "secrets",
name: undefined,
namespace: undefined,
}],
["/api/v1/nodes/minikube", {
apiBase: "/api/v1/nodes",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
resource: "nodes",
name: "minikube",
namespace: undefined,
}],
["/api/foo-bar/nodes/minikube", {
apiBase: "/api/foo-bar/nodes",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "foo-bar",
apiVersionWithGroup: "foo-bar",
resource: "nodes",
name: "minikube",
namespace: undefined,
}],
["/api/v1/namespaces/kube-public", {
apiBase: "/api/v1/namespaces",
apiPrefix: "/api",
apiGroup: "",
apiVersion: "v1",
apiVersionWithGroup: "v1",
resource: "namespaces",
name: "kube-public",
namespace: undefined,
}],
];
const invalidTests = [
undefined,
"",
"ajklsmh",
];
describe("parseApi unit tests", () => {
it.each(tests)("testing %j", (url, expected) => {
expect(parseKubeApi(url)).toStrictEqual(expected);
});
it.each(invalidTests)("testing %j should throw", (url) => {
expect(parseKubeApi(url as never)).toBe(undefined);
});
});

View File

@ -3,8 +3,8 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import type { ApiManager } from "../api-manager"; import type { ApiManager } from "../api-manager";
import type { IngressApi } from "../endpoints"; import type { IngressApi } from "@k8slens/kube-api";
import { HorizontalPodAutoscalerApi } from "../endpoints"; import { HorizontalPodAutoscalerApi } from "@k8slens/kube-api";
import { Ingress } from "@k8slens/kube-object"; import { Ingress } from "@k8slens/kube-object";
import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting"; import { getDiForUnitTesting } from "../../../renderer/getDiForUnitTesting";
import type { Fetch } from "../../fetch/fetch.injectable"; import type { Fetch } from "../../fetch/fetch.injectable";
@ -20,9 +20,8 @@ import hostedClusterInjectable from "../../../renderer/cluster-frame-context/hos
import directoryForKubeConfigsInjectable from "../../app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable"; import directoryForKubeConfigsInjectable from "../../app-paths/directory-for-kube-configs/directory-for-kube-configs.injectable";
import apiManagerInjectable from "../api-manager/manager.injectable"; import apiManagerInjectable from "../api-manager/manager.injectable";
import type { DiContainer } from "@ogre-tools/injectable"; import type { DiContainer } from "@ogre-tools/injectable";
import ingressApiInjectable from "../endpoints/ingress.api.injectable"; import { ingressApiInjectable, maybeKubeApiInjectable } from "@k8slens/kube-api-specifics";
import { loggerInjectionToken } from "@k8slens/logger"; import { logErrorInjectionToken, logInfoInjectionToken, logWarningInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
import { Cluster } from "../../cluster/cluster"; import { Cluster } from "../../cluster/cluster";
describe("KubeApi", () => { describe("KubeApi", () => {
@ -710,7 +709,9 @@ describe("KubeApi", () => {
beforeEach(async () => { beforeEach(async () => {
horizontalPodAutoscalerApi = new HorizontalPodAutoscalerApi({ horizontalPodAutoscalerApi = new HorizontalPodAutoscalerApi({
logger: di.inject(loggerInjectionToken), logError: di.inject(logErrorInjectionToken),
logInfo: di.inject(logInfoInjectionToken),
logWarn: di.inject(logWarningInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable), maybeKubeApi: di.inject(maybeKubeApiInjectable),
}, { }, {
allowedUsableVersions: { allowedUsableVersions: {

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
*/ */
import { noop } from "@k8slens/utilities"; import { noop } from "@k8slens/utilities";
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
import { KubeObject } from "@k8slens/kube-object"; import { KubeObject } from "@k8slens/kube-object";
import type { KubeObjectStoreLoadingParams } from "../kube-object.store"; import type { KubeObjectStoreLoadingParams } from "../kube-object.store";
import { KubeObjectStore } from "../kube-object.store"; import { KubeObjectStore } from "../kube-object.store";

View File

@ -7,9 +7,9 @@ import type { KubeObjectStore } from "../kube-object.store";
import type { IComputedValue } from "mobx"; import type { IComputedValue } from "mobx";
import { autorun, action, observable } from "mobx"; import { autorun, action, observable } from "mobx";
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
import type { KubeObject, ObjectReference } from "@k8slens/kube-object"; import type { KubeObject, ObjectReference } from "@k8slens/kube-object";
import { parseKubeApi, createKubeApiURL } from "../kube-api-parse"; import { parseKubeApi, createKubeApiURL } from "@k8slens/kube-api";
import { getOrInsertWith, iter } from "@k8slens/utilities"; import { getOrInsertWith, iter } from "@k8slens/utilities";
import type { CreateCustomResourceStore } from "./create-custom-resource-store.injectable"; import type { CreateCustomResourceStore } from "./create-custom-resource-store.injectable";

View File

@ -5,7 +5,7 @@
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import EventEmitter from "events"; import EventEmitter from "events";
import type TypedEventEmitter from "typed-emitter"; import type TypedEventEmitter from "typed-emitter";
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
export interface LegacyAutoRegistration { export interface LegacyAutoRegistration {
kubeApi: (api: KubeApi<any, any>) => void; kubeApi: (api: KubeApi<any, any>) => void;

View File

@ -4,7 +4,7 @@
*/ */
import { getInjectionToken } from "@ogre-tools/injectable"; import { getInjectionToken } from "@ogre-tools/injectable";
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
export const customResourceDefinitionApiInjectionToken = getInjectionToken<KubeApi>({ export const customResourceDefinitionApiInjectionToken = getInjectionToken<KubeApi>({
id: "custom-resource-definition-api-token", id: "custom-resource-definition-api-token",

View File

@ -5,7 +5,7 @@
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import clusterFrameContextForNamespacedResourcesInjectable from "../../../renderer/cluster-frame-context/for-namespaced-resources.injectable"; import clusterFrameContextForNamespacedResourcesInjectable from "../../../renderer/cluster-frame-context/for-namespaced-resources.injectable";
import { loggerInjectionToken } from "@k8slens/logger"; import { loggerInjectionToken } from "@k8slens/logger";
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
import type { KubeObject } from "@k8slens/kube-object"; import type { KubeObject } from "@k8slens/kube-object";
import type { KubeObjectStoreDependencies } from "../kube-object.store"; import type { KubeObjectStoreDependencies } from "../kube-object.store";
import { CustomResourceStore } from "./resource.store"; import { CustomResourceStore } from "./resource.store";

View File

@ -3,11 +3,10 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ApiManager } from "./api-manager"; import { ApiManager } from "./api-manager";
import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx"; import { computedInjectManyInjectable } from "@ogre-tools/injectable-extension-for-mobx";
import { kubeObjectStoreInjectionToken } from "./kube-object-store-token"; import { kubeObjectStoreInjectionToken } from "./kube-object-store-token";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token"; import { kubeApiInjectionToken, storesAndApisCanBeCreatedInjectionToken } from "@k8slens/kube-api-specifics";
import { computed } from "mobx"; import { computed } from "mobx";
import { customResourceDefinitionApiInjectionToken } from "./crd-api-token"; import { customResourceDefinitionApiInjectionToken } from "./crd-api-token";
import createCustomResourceStoreInjectable from "./create-custom-resource-store.injectable"; import createCustomResourceStoreInjectable from "./create-custom-resource-store.injectable";

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import type { KubeApi } from "../kube-api"; import type { KubeApi } from "@k8slens/kube-api";
import type { KubeObjectStoreDependencies } from "../kube-object.store"; import type { KubeObjectStoreDependencies } from "../kube-object.store";
import { KubeObjectStore } from "../kube-object.store"; import { KubeObjectStore } from "../kube-object.store";
import type { KubeObject } from "@k8slens/kube-object"; import type { KubeObject } from "@k8slens/kube-object";

View File

@ -3,13 +3,13 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { loggerInjectionToken } from "@k8slens/logger"; import { logErrorInjectionToken, logInfoInjectionToken, logWarningInjectionToken } from "@k8slens/logger";
import { apiKubePrefix } from "../vars"; import { apiKubePrefix } from "../vars";
import isDevelopmentInjectable from "../vars/is-development.injectable"; import isDevelopmentInjectable from "../vars/is-development.injectable";
import apiBaseInjectable from "./api-base.injectable"; import apiBaseInjectable from "./api-base.injectable";
import type { KubeApiConstructor } from "./create-kube-api-for-remote-cluster.injectable"; import type { KubeApiConstructor } from "./create-kube-api-for-remote-cluster.injectable";
import createKubeJsonApiInjectable from "./create-kube-json-api.injectable"; import createKubeJsonApiInjectable from "./create-kube-json-api.injectable";
import { KubeApi } from "./kube-api"; import { KubeApi } from "@k8slens/kube-api";
import type { KubeJsonApiDataFor, KubeObject, KubeObjectConstructor } from "@k8slens/kube-object"; import type { KubeJsonApiDataFor, KubeObject, KubeObjectConstructor } from "@k8slens/kube-object";
export interface CreateKubeApiForLocalClusterConfig { export interface CreateKubeApiForLocalClusterConfig {
@ -37,7 +37,9 @@ const createKubeApiForClusterInjectable = getInjectable({
const apiBase = di.inject(apiBaseInjectable); const apiBase = di.inject(apiBaseInjectable);
const isDevelopment = di.inject(isDevelopmentInjectable); const isDevelopment = di.inject(isDevelopmentInjectable);
const createKubeJsonApi = di.inject(createKubeJsonApiInjectable); const createKubeJsonApi = di.inject(createKubeJsonApiInjectable);
const logger = di.inject(loggerInjectionToken); const logError = di.inject(logErrorInjectionToken);
const logInfo = di.inject(logInfoInjectionToken);
const logWarn = di.inject(logWarningInjectionToken);
return ( return (
cluster: CreateKubeApiForLocalClusterConfig, cluster: CreateKubeApiForLocalClusterConfig,
@ -64,7 +66,9 @@ const createKubeApiForClusterInjectable = getInjectable({
return new KubeApi( return new KubeApi(
{ {
logger, logError,
logInfo,
logWarn,
maybeKubeApi: undefined, maybeKubeApi: undefined,
}, },
{ {

View File

@ -6,11 +6,11 @@ import { getInjectable } from "@ogre-tools/injectable";
import type { AgentOptions } from "https"; import type { AgentOptions } from "https";
import { Agent } from "https"; import { Agent } from "https";
import type { RequestInit } from "@k8slens/node-fetch"; import type { RequestInit } from "@k8slens/node-fetch";
import { loggerInjectionToken } from "@k8slens/logger"; import { logErrorInjectionToken, logInfoInjectionToken, logWarningInjectionToken } from "@k8slens/logger";
import isDevelopmentInjectable from "../vars/is-development.injectable"; import isDevelopmentInjectable from "../vars/is-development.injectable";
import createKubeJsonApiInjectable from "./create-kube-json-api.injectable"; import createKubeJsonApiInjectable from "./create-kube-json-api.injectable";
import type { KubeApiOptions } from "./kube-api"; import type { KubeApiOptions } from "@k8slens/kube-api";
import { KubeApi } from "./kube-api"; import { KubeApi } from "@k8slens/kube-api";
import type { KubeJsonApiDataFor, KubeObject, KubeObjectConstructor } from "@k8slens/kube-object"; import type { KubeJsonApiDataFor, KubeObject, KubeObjectConstructor } from "@k8slens/kube-object";
export interface CreateKubeApiForRemoteClusterConfig { export interface CreateKubeApiForRemoteClusterConfig {
@ -53,7 +53,9 @@ const createKubeApiForRemoteClusterInjectable = getInjectable({
instantiate: (di): CreateKubeApiForRemoteCluster => { instantiate: (di): CreateKubeApiForRemoteCluster => {
const isDevelopment = di.inject(isDevelopmentInjectable); const isDevelopment = di.inject(isDevelopmentInjectable);
const createKubeJsonApi = di.inject(createKubeJsonApiInjectable); const createKubeJsonApi = di.inject(createKubeJsonApiInjectable);
const logger = di.inject(loggerInjectionToken); const logError = di.inject(logErrorInjectionToken);
const logInfo = di.inject(logInfoInjectionToken);
const logWarn = di.inject(logWarningInjectionToken);
return ( return (
config: CreateKubeApiForRemoteClusterConfig, config: CreateKubeApiForRemoteClusterConfig,
@ -110,7 +112,9 @@ const createKubeApiForRemoteClusterInjectable = getInjectable({
return new KubeApi( return new KubeApi(
{ {
logger, logError,
logInfo,
logWarn,
maybeKubeApi: undefined, maybeKubeApi: undefined,
}, },
{ {

View File

@ -3,9 +3,9 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { loggerInjectionToken } from "@k8slens/logger"; import { logErrorInjectionToken, logInfoInjectionToken, logWarningInjectionToken } from "@k8slens/logger";
import type { DerivedKubeApiOptions, KubeApiDependencies } from "./kube-api"; import type { DerivedKubeApiOptions, KubeApiDependencies } from "@k8slens/kube-api";
import maybeKubeApiInjectable from "./maybe-kube-api.injectable"; import { maybeKubeApiInjectable } from "@k8slens/kube-api-specifics";
export interface CreateKubeApi { export interface CreateKubeApi {
<Api>(ctor: new (deps: KubeApiDependencies, opts: DerivedKubeApiOptions) => Api, opts?: DerivedKubeApiOptions): Api; <Api>(ctor: new (deps: KubeApiDependencies, opts: DerivedKubeApiOptions) => Api, opts?: DerivedKubeApiOptions): Api;
@ -15,7 +15,9 @@ const createKubeApiInjectable = getInjectable({
id: "create-kube-api", id: "create-kube-api",
instantiate: (di): CreateKubeApi => { instantiate: (di): CreateKubeApi => {
const deps: KubeApiDependencies = { const deps: KubeApiDependencies = {
logger: di.inject(loggerInjectionToken), logError: di.inject(logErrorInjectionToken),
logInfo: di.inject(logInfoInjectionToken),
logWarn: di.inject(logWarningInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable), maybeKubeApi: di.inject(maybeKubeApiInjectable),
}; };

View File

@ -7,7 +7,7 @@ import { apiKubePrefix } from "../vars";
import isDebuggingInjectable from "../vars/is-debugging.injectable"; import isDebuggingInjectable from "../vars/is-debugging.injectable";
import { apiBaseHostHeaderInjectionToken, apiBaseServerAddressInjectionToken } from "./api-base-configs"; import { apiBaseHostHeaderInjectionToken, apiBaseServerAddressInjectionToken } from "./api-base-configs";
import createKubeJsonApiInjectable from "./create-kube-json-api.injectable"; import createKubeJsonApiInjectable from "./create-kube-json-api.injectable";
import type { KubeJsonApi } from "./kube-json-api"; import type { KubeJsonApi } from "@k8slens/kube-api";
export type CreateKubeJsonApiForCluster = (clusterId: string) => KubeJsonApi; export type CreateKubeJsonApiForCluster = (clusterId: string) => KubeJsonApi;

View File

@ -9,7 +9,7 @@ import lensProxyCertificateInjectable from "../certificate/lens-proxy-certificat
import fetchInjectable from "../fetch/fetch.injectable"; import fetchInjectable from "../fetch/fetch.injectable";
import { loggerInjectionToken } from "@k8slens/logger"; import { loggerInjectionToken } from "@k8slens/logger";
import type { JsonApiConfig, JsonApiDependencies } from "@k8slens/json-api"; import type { JsonApiConfig, JsonApiDependencies } from "@k8slens/json-api";
import { KubeJsonApi } from "./kube-json-api"; import { KubeJsonApi } from "@k8slens/kube-api";
export type CreateKubeJsonApi = (config: JsonApiConfig, reqInit?: RequestInit) => KubeJsonApi; export type CreateKubeJsonApi = (config: JsonApiConfig, reqInit?: RequestInit) => KubeJsonApi;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ClusterRoleBindingApi } from "./cluster-role-binding.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const clusterRoleBindingApiInjectable = getInjectable({
id: "cluster-role-binding-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "clusterRoleBindingApi is only accessible in certain environments");
return new ClusterRoleBindingApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default clusterRoleBindingApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ClusterRoleApi } from "./cluster-role.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const clusterRoleApiInjectable = getInjectable({
id: "cluster-role-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "clusterRoleApi is only available in certain environments");
return new ClusterRoleApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default clusterRoleApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ClusterApi } from "./cluster.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const clusterApiInjectable = getInjectable({
id: "cluster-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "clusterApi is only available in certain environments");
return new ClusterApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default clusterApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ComponentStatusApi } from "./component-status.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
import { loggerInjectionToken } from "@k8slens/logger";
const componentStatusApiInjectable = getInjectable({
id: "component-status-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "componentStatusApi is only available in certain environments");
return new ComponentStatusApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default componentStatusApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { ConfigMapApi } from "./config-map.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const configMapApiInjectable = getInjectable({
id: "config-map-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "configMapApi is only available in certain environments");
return new ConfigMapApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default configMapApiInjectable;

View File

@ -1,29 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { CronJobApi } from "./cron-job.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const cronJobApiInjectable = getInjectable({
id: "cron-job-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "cronJobApi is only available in certain environments");
return new CronJobApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
}, {
checkPreferredVersion: true,
});
},
injectionToken: kubeApiInjectionToken,
});
export default cronJobApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { CustomResourceDefinitionApi } from "./custom-resource-definition.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
import { loggerInjectionToken } from "@k8slens/logger";
const customResourceDefinitionApiInjectable = getInjectable({
id: "custom-resource-definition-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "customResourceDefinitionApi is only available in certain environments");
return new CustomResourceDefinitionApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default customResourceDefinitionApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { DaemonSetApi } from "./daemon-set.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const daemonSetApiInjectable = getInjectable({
id: "daemon-set-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "daemonSetApi is only available in certain environments");
return new DaemonSetApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default daemonSetApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { DeploymentApi } from "./deployment.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const deploymentApiInjectable = getInjectable({
id: "deployment-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "deploymentApi is only available in certain environments");
return new DeploymentApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default deploymentApiInjectable;

View File

@ -1,27 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import assert from "assert";
import { storesAndApisCanBeCreatedInjectionToken } from "../stores-apis-can-be-created.token";
import { EndpointsApi } from "./endpoint.api";
import { kubeApiInjectionToken } from "../kube-api/kube-api-injection-token";
import { loggerInjectionToken } from "@k8slens/logger";
import maybeKubeApiInjectable from "../maybe-kube-api.injectable";
const endpointsApiInjectable = getInjectable({
id: "endpoints-api",
instantiate: (di) => {
assert(di.inject(storesAndApisCanBeCreatedInjectionToken), "endpointsApi is only available in certain environments");
return new EndpointsApi({
logger: di.inject(loggerInjectionToken),
maybeKubeApi: di.inject(maybeKubeApiInjectable),
});
},
injectionToken: kubeApiInjectionToken,
});
export default endpointsApiInjectable;

Some files were not shown because too many files have changed in this diff Show More