diff --git a/.eslintrc.js b/.eslintrc.js index 43adca25e5..516029cdd4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,11 +4,9 @@ module.exports = { files: [ "src/renderer/**/*.js", "build/**/*.js", - "src/renderer/**/*.vue" ], extends: [ 'eslint:recommended', - 'plugin:vue/recommended' ], env: { node: true @@ -20,9 +18,6 @@ module.exports = { rules: { "indent": ["error", 2], "no-unused-vars": "off", - "vue/order-in-components": "off", - "vue/attributes-order": "off", - "vue/max-attributes-per-line": "off" } }, { diff --git a/.gitignore b/.gitignore index 2381ff83b1..53701a44d2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ node_modules/ yarn-error.log coverage/ tmp/ -static/build/client/ +static/build/** binaries/client/ binaries/server/ locales/**/**.js diff --git a/.yarnrc b/.yarnrc index 4be7962079..5119ded102 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://atom.io/download/electron" -target "6.1.12" +target "9.1.0" runtime "electron" diff --git a/README.md b/README.md index 020b11ef96..fa8c476799 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,17 @@ brew cask install lens Allows faster separately re-run some of involved processes: -1. `yarn dev:main` compiles electron's main process and watch files -1. `yarn dev:renderer:vue` compiles electron's renderer vue-part -1. `yarn dev:renderer:react` compiles electron's renderer react-part +1. `yarn dev:main` compiles electron's main process part and start watching files +1. `yarn dev:renderer` compiles electron's renderer part and start watching files 1. `yarn dev-run` runs app in dev-mode and restarts when electron's main process file has changed -Alternatively to compile both render parts in single command use `yarn dev:renderer` +## Developer's ~~RTFM~~ recommended list: + +- [TypeScript](https://www.typescriptlang.org/docs/home.html) (front-end/back-end) +- [ReactJS](https://reactjs.org/docs/getting-started.html) (front-end, ui) +- [MobX](https://mobx.js.org/) (app-state-management, back-end/front-end) +- [ElectronJS](https://www.electronjs.org/docs) (chrome/node) +- [NodeJS](https://nodejs.org/dist/latest-v12.x/docs/api/) (api docs) ## Contributing diff --git a/__mocks__/electron.js b/__mocks__/electron.ts similarity index 79% rename from __mocks__/electron.js rename to __mocks__/electron.ts index 8e744a11a8..889a09c914 100644 --- a/__mocks__/electron.js +++ b/__mocks__/electron.ts @@ -3,8 +3,10 @@ module.exports = { match: jest.fn(), app: { getVersion: jest.fn().mockReturnValue("3.0.0"), - getPath: jest.fn().mockReturnValue("tmp"), getLocale: jest.fn().mockRejectedValue("en"), + getPath: jest.fn((name: string) => { + return "tmp" + }), }, remote: { app: { diff --git a/__mocks__/styleMock.ts b/__mocks__/styleMock.ts new file mode 100644 index 0000000000..a099545376 --- /dev/null +++ b/__mocks__/styleMock.ts @@ -0,0 +1 @@ +module.exports = {}; \ No newline at end of file diff --git a/build/download_helm.ts b/build/download_helm.ts index 2f81b14583..9dddf7fcdc 100644 --- a/build/download_helm.ts +++ b/build/download_helm.ts @@ -1,3 +1,3 @@ -import { helmCli } from "../src/main/helm-cli" +import { helmCli } from "../src/main/helm/helm-cli" helmCli.ensureBinary() diff --git a/build/download_kubectl.ts b/build/download_kubectl.ts index 708c1c843c..a697552aa8 100644 --- a/build/download_kubectl.ts +++ b/build/download_kubectl.ts @@ -79,7 +79,9 @@ class KubectlDownloader { return new Promise((resolve, reject) => { file.on("close", () => { console.log("kubectl binary download closed") - fs.chmod(this.path, 0o755, () => {}) + fs.chmod(this.path, 0o755, (err) => { + if (err) reject(err); + }) resolve() }) stream.pipe(file) diff --git a/integration/helpers/utils.ts b/integration/helpers/utils.ts index 3e3fc60add..72d6e3d732 100644 --- a/integration/helpers/utils.ts +++ b/integration/helpers/utils.ts @@ -3,13 +3,13 @@ import { Application } from "spectron"; let appPath = "" switch(process.platform) { case "win32": - appPath = "./dist/win-unpacked/LensDev.exe" + appPath = "./dist/win-unpacked/Lens.exe" break case "linux": appPath = "./dist/linux-unpacked/kontena-lens" break case "darwin": - appPath = "./dist/mac/LensDev.app/Contents/MacOS/LensDev" + appPath = "./dist/mac/Lens.app/Contents/MacOS/Lens" break } @@ -20,6 +20,10 @@ export function setup(): Application { path: appPath, startTimeout: 30000, waitTimeout: 30000, + chromeDriverArgs: ['remote-debugging-port=9222'], + env: { + CICD: "true" + } }) } diff --git a/integration/specs/app_spec.ts b/integration/specs/app_spec.ts index 79f867b53a..f3cb922740 100644 --- a/integration/specs/app_spec.ts +++ b/integration/specs/app_spec.ts @@ -1,7 +1,6 @@ import { Application } from "spectron" import * as util from "../helpers/utils" import { spawnSync } from "child_process" -import { stat } from "fs" jest.setTimeout(20000) @@ -11,19 +10,21 @@ describe("app start", () => { let app: Application const clickWhatsNew = async (app: Application) => { await app.client.waitUntilTextExists("h1", "What's new") - await app.client.click("button.btn-primary") + await app.client.click("button.primary") await app.client.waitUntilTextExists("h1", "Welcome") } const addMinikubeCluster = async (app: Application) => { - await app.client.click("a#add-cluster") - await app.client.waitUntilTextExists("legend", "Choose config:") - await app.client.selectByVisibleText("select#kubecontext-select", "minikube (new)") - await app.client.click("button.btn-primary") + await app.client.click("div.add-cluster") + await app.client.waitUntilTextExists("p", "Choose config") + await app.client.click("div#kubecontext-select") + await app.client.waitUntilTextExists("div", "minikube") + await app.client.click("div.minikube") + await app.client.click("button.primary") } const waitForMinikubeDashboard = async (app: Application) => { - await app.client.waitUntilTextExists("pre.auth-output", "Authentication proxy started") + await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started") let windowCount = await app.client.getWindowCount() // wait for webview to appear on window count while (windowCount == 1) { diff --git a/locales/en/messages.po b/locales/en/messages.po index ae725e7dc7..b713158bfb 100644 --- a/locales/en/messages.po +++ b/locales/en/messages.po @@ -13,30 +13,54 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" +#: src/renderer/components/+workspaces/clusters-menu.tsx:38 +#~ msgid "'Disconnect'" +#~ msgstr "'Disconnect'" + +#: src/renderer/components/+workspaces/clusters-menu.tsx:31 +#~ msgid "'Settings'" +#~ msgstr "'Settings'" + #: src/renderer/components/+config-autoscalers/hpa-details.tsx:28 msgid "(as a percentage of request)" msgstr "(as a percentage of request)" +#: src/renderer/components/+workspaces/workspaces.tsx:108 +msgid "(current)" +msgstr "(current)" + #: src/renderer/components/+network-policies/network-policy-details.tsx:88 msgid "(empty) (Allowing the specific traffic to all pods in this namespace)" msgstr "(empty) (Allowing the specific traffic to all pods in this namespace)" +#: src/renderer/components/+add-cluster/add-cluster.tsx:105 +#~ msgid "(new)" +#~ msgstr "(new)" + #: src/renderer/components/item-object-list/item-list-layout.tsx:224 msgid "<0>Filtered0>: {itemsCount} / {allItemsCount}" msgstr "<0>Filtered0>: {itemsCount} / {allItemsCount}" #: src/renderer/browser-check.tsx:11 -msgid "<0>Your browser does not support all Lens features. 0> Please consider using another browser." -msgstr "<0>Your browser does not support all Lens features. 0> Please consider using another browser." +#~ msgid "<0>Your browser does not support all Lens features. 0> Please consider using another browser." +#~ msgstr "<0>Your browser does not support all Lens features. 0> Please consider using another browser." #: src/renderer/components/dock/create-resource.tsx:56 msgid "<0>{0}0> successfully created" msgstr "<0>{0}0> successfully created" +#: src/renderer/components/+add-cluster/add-cluster.tsx:176 +#~ msgid "A HTTP proxy server URL (format: http://
: