1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-20 13:57:23 +03:00
Commit Graph

21 Commits

Author SHA1 Message Date
Roman
ff55719ffa
Upgrade to webpack@5 (#4894) 2022-02-25 10:20:06 -05:00
Jim Ehrismann
733bb543c9
Revert "Upgrade to webpack@5 (#4725)" (#4872) 2022-02-16 09:14:14 -05:00
Roman
d656a9e289
Upgrade to webpack@5 (#4725)
* attempt to upgrade webpack@5 and all relevant packages to latest version -- part 1

Signed-off-by: Roman <ixrock@gmail.com>

* debugging webpack@5 usage -- part 1

Signed-off-by: Roman <ixrock@gmail.com>

* - attempt to use "react-refresh-typescript" with webpack@5 thingy
- extending getTSLoader() to accept more options from ts-loader

Signed-off-by: Roman <ixrock@gmail.com>

* more fixes, updating webpack loaders

Signed-off-by: Roman <ixrock@gmail.com>

* merge-fixes, using internal webpack@5 asset handlers (type: "asset/*")

Signed-off-by: Roman <ixrock@gmail.com>

* fix: raw-loader / <Icon svg="./*">, updated mocked types for importing resources via webpack

Signed-off-by: Roman <ixrock@gmail.com>

* removing webpack-dev-server, clean up

Signed-off-by: Roman <ixrock@gmail.com>

* fix master-merge conflict

Signed-off-by: Roman <ixrock@gmail.com>

* fix/reverted: use sourceMap for styles

Signed-off-by: Roman <ixrock@gmail.com>

* fix lint

Signed-off-by: Roman <ixrock@gmail.com>

* fix: loading svg icons inline as data-url (workaround for "?raw" as it fails in tests and "!!raw-loader!" seems doesn't work at all in webpack@5)

Signed-off-by: Roman <ixrock@gmail.com>

* attempt to use webpack-dev-server via node-api -- part 1

Signed-off-by: Roman <ixrock@gmail.com>

* attempt to use webpack-dev-server via node-api -- part 2

Signed-off-by: Roman <ixrock@gmail.com>

* fix: incorrect parsing svg-icon xml-content by <HotbarEntityIcon/>

Signed-off-by: Roman <ixrock@gmail.com>

* fix: more random fixes related to incorrect parsing svg-icon content, added static Icon.isSvg(content: string)

Signed-off-by: Roman <ixrock@gmail.com>

* attempt to fix: "Uncaught (in promise) DOMException: A network error occurred." when loading cluster frame -- part 1

Signed-off-by: Roman <ixrock@gmail.com>

* fix: loading cluster frame + error in loading terminal default font (which was causing network exception error and hidden cluster-view)
fix: proxying websockets (e.g. terminal)

Signed-off-by: Roman <ixrock@gmail.com>

* fix: wait lensProxy.listen() to obtain lensProxy.port for webpack-dev-server

Signed-off-by: Roman <ixrock@gmail.com>

* fix lint

Signed-off-by: Roman <ixrock@gmail.com>

* fix unit tests

Signed-off-by: Roman <ixrock@gmail.com>

* reverted auto-formatted imports with 2 lines (.idea/webstorm)

Signed-off-by: Roman <ixrock@gmail.com>

* fix: handle warnings in main-process compilation files

Signed-off-by: Roman <ixrock@gmail.com>

* fix: handle warnings in "renderer" compilation

Signed-off-by: Roman <ixrock@gmail.com>

* fix: move app fonts preloading into html/css files, clean up

Signed-off-by: Roman <ixrock@gmail.com>

* update "webpack@5", "typescript@4.5" in bundled extensions / attempt to fix weird errors in build pipeline:

ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/common/catalog/catalog-category-registry.d.ts
6:27-35
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/common/catalog/catalog-category-registry.d.ts(6,28)
      TS1005: ',' expected.

ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/components/select/select.d.ts
8:14-28
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/components/select/select.d.ts(8,15)
      TS1005: ',' expected.

ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/api/catalog-entity-registry.d.ts
8:14-22
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/api/catalog-entity-registry.d.ts(8,15)
      TS1005: ',' expected.

Signed-off-by: Roman <ixrock@gmail.com>

* fix: handle errors in bundled extensions compilation process

Signed-off-by: Roman <ixrock@gmail.com>

* fix: "webpack" not found in production

Signed-off-by: Roman <ixrock@gmail.com>

* fix: removed preloading fonts in template via <link preload> since it's not bundled with HtmlWebpackPlugin() anyway anda all fonts loaded via css @font-face rule

Signed-off-by: Roman <ixrock@gmail.com>

* apply HMR at least for css/styles and use manual page reload on app/scripts change

Signed-off-by: Roman <ixrock@gmail.com>

* use `react-refresh-typescript` and `@pmmmwh/react-refresh-webpack-plugin` to support HMR in most cases

Signed-off-by: Roman <ixrock@gmail.com>

* responding to comments

Signed-off-by: Roman <ixrock@gmail.com>

* revered extension version in package-lock.json (autoupdated on `make dev`)

Signed-off-by: Roman <ixrock@gmail.com>
2022-02-15 17:04:12 +02:00
Janne Savolainen
ac42a6565f
Replace kube object menu registry with reactive solution (#4731)
Co-authored-by: Sebastian Malton <sebastian@malton.name>
2022-01-31 10:16:29 -05:00
Janne Savolainen
589472c2b5
Shorten license header to reduce amount of clutter in top of the files (#4709)
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-01-18 10:18:10 +02:00
Janne Savolainen
9d33fff906
Cascade different refactorings to eliminate global shared state from app paths
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
2022-01-05 13:26:49 +02:00
Sebastian Malton
c6dce043a7
Lint: comma-spacing (error) & comma-dangle (error) (#4200)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-11-02 17:38:20 -04:00
Sebastian Malton
f297407156
Stop using @electron/remote to obtain app.getPath() (#4078)
* Stop using remote to obtain app.getPath()

- Initialize entire map in bootstrap()

- Updated unit tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Resolve PR comments

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix test

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix build

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Ensure that init can only be called once and catch errors

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Replace basically all uses of app.getPath() with AppPaths.get()

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Fix unit tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-10-27 21:07:41 -04:00
Sebastian Malton
4fc340d0c6
Cleanup integration and unit tests (#3531)
- Make mockWindow a function and call it when needed

- Change timeouts so that better error messages happen more often in
  integration tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-08-03 08:51:52 -04:00
Alex Andreev
4fe0a7d73e
Catalog render optimizations (#3422) 2021-07-21 08:51:46 -04:00
Alex Andreev
026cbbac09
Generic TopBar component for Catalog/Cluster views (#2882)
* Rendering close button in cluster view

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Changing Icon hover style

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Moving onClick handler away

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing sidebar compact view

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing 'compact' refs in SidebarItem

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Wrapping Catalog with MainLayout

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Making sidebar resizing indicator visible on hover

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding TopBar to catalog view

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Using TopBar in cluster views

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Cleaning up Sidebar styles

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Using getActiveClusterEntity() for searching

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Fix resizing anchor position

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Align cluster name on left

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing unused files

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing unused css var

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Showing Topbar in ClusterStatus page

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing TopBar from ClusterManager

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2021-06-07 11:46:40 +03:00
Sebastian Malton
5ed4537979
Turn on noUnusedLocals, noImplicitReturns, importsNotUsedAsValues: error, and isolatedModules (#2777) 2021-05-19 12:11:54 -04:00
Jari Kolehmainen
f8b939bf59
Check license header using eslint (#2780)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2021-05-17 09:43:53 -04:00
Sebastian Malton
2e2283bcc9
enfore unix line endings and always ending files with line endings (#1997)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2021-01-21 08:09:41 -05:00
Alex Andreev
5d746cdff5
Dock tabs context menu (#1863)
* Adding context menu to dock tabs

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Allowing to open menu by contextmenu event

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding DockTab tests with fine-tuning jest config

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding disable state to menu items

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Removing empty lines

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Moving jest-canvas-mock to dev dependencies

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2020-12-28 15:18:03 +03:00
Sebastian Malton
7451869c25
add no-unused and react/recommended to eslint (#1523)
* add no-unused-vars and no-unused-imports

* added quotes: double, and remove ignore pattern

* move itif and describeif into utils

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2020-11-27 08:48:38 -05:00
Panu Horsmalahti
0b182ccf6f Add a few missing folders to be linted.
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
2020-11-19 17:05:30 +02:00
chh
484de2ec21
Add +/- buttons in scale deployment popup screen (#1191)
* Add @testing-library/jest-dom and @testing-library/react for writing test cases

* Make eslint check __mocks__/*.ts files

* Mock electron.ipcRenderer.on to prevent errors in React compoment test cases

* Mock <Trans /> from @lingui/macro as a component simplely returns children components

* Use optional chaining operator (?.) to avoid TypeError: Cannot read property 'replicas' of undefined

* Add jest-fetch-mock for mocking global.fetch, activate for all test cases in jest.setup.ts

* Add basic tests for <DeploymentScaleDialog /> to ensure it initialises/renders without errors

* Add +/- button for changing desired replicas, and its test cases

* Adjust the styles of +/- buttons container to make sure it aligns with the slider

* Refactor after rebase from master

* Use var defined in vars.scss

* Add flex align-center to slider-container and remove margin-top: -4px

* Use <Icon /> to replace <i/>

* Add flex gaps to plus-minus-container

Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
2020-11-03 20:30:36 +08:00
Roman
5670312c47
Migrating Vue components to React and stores refactoring (#585)
Signed-off-by: Roman <ixrock@gmail.com>

Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <smalton@mirantis.com>
Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
Co-authored-by: Alex Andreev <alex.andreev.email@gmail.com>
2020-08-20 08:53:07 +03:00
Roman
b7974827d2
Lens restructure (#540)
Signed-off-by: Roman <ixrock@gmail.com>
2020-06-30 14:35:16 +03:00
Jari Kolehmainen
d80e956870
Fix use of bundled kubectl (#241)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2020-04-11 17:48:29 +03:00