diff --git a/.azure-pipelines-k8s-matrix.yml b/.azure-pipelines-k8s-matrix.yml
new file mode 100644
index 0000000000..77129460a3
--- /dev/null
+++ b/.azure-pipelines-k8s-matrix.yml
@@ -0,0 +1,57 @@
+variables:
+ YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
+ node_version: 12.x
+pr:
+ branches:
+ include:
+ - master
+ - releases/*
+ paths:
+ exclude:
+ - .github/*
+ - docs/*
+ - mkdocs/*
+trigger: none
+jobs:
+ - job: Linux
+ pool:
+ vmImage: ubuntu-16.04
+ strategy:
+ matrix:
+ kube_1.16:
+ kubernetes_version: v1.16.15
+ kube_1.17:
+ kubernetes_version: v1.17.15
+ kube_1.18:
+ kubernetes_version: v1.18.13
+ kube_1.19:
+ kubernetes_version: v1.19.5
+ kube_1.20:
+ kubernetes_version: v1.20.0
+ steps:
+ - task: NodeTool@0
+ inputs:
+ versionSpec: $(node_version)
+ displayName: Install Node.js
+ - task: Cache@2
+ inputs:
+ key: 'yarn | "$(Agent.OS)" | yarn.lock'
+ restoreKeys: |
+ yarn | "$(Agent.OS)"
+ path: $(YARN_CACHE_FOLDER)
+ displayName: Cache Yarn packages
+ - bash: |
+ sudo apt-get update
+ sudo apt-get install libgconf-2-4 conntrack -y
+ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
+ sudo install minikube-linux-amd64 /usr/local/bin/minikube
+ sudo minikube start --driver=none --kubernetes-version $(kubernetes_version)
+ # Although the kube and minikube config files are in placed $HOME they are owned by root
+ sudo chown -R $USER $HOME/.kube $HOME/.minikube
+ displayName: Install integration test dependencies
+ - script: make node_modules
+ displayName: Install dependencies
+ - script: make -j2 build
+ displayName: Run build
+ - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' yarn integration
+ displayName: Run integration tests for Kubernetes $(kubernetes_version)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 009418b1c0..6bb07489ec 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -1,9 +1,15 @@
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
- AZURE_CACHE_FOLDER: $(Pipeline.Workspace)/.azure-cache
pr:
- - master
- - releases/*
+ branches:
+ include:
+ - master
+ - releases/*
+ paths:
+ exclude:
+ - .github/*
+ - docs/*
+ - mkdocs/*
trigger:
branches:
include:
@@ -11,6 +17,11 @@ trigger:
tags:
include:
- "*"
+ paths:
+ exclude:
+ - .github/*
+ - docs/*
+ - mkdocs/*
jobs:
- job: Windows
pool:
@@ -29,15 +40,27 @@ jobs:
inputs:
versionSpec: $(node_version)
displayName: Install Node.js
- - task: CacheBeta@0
+ - task: Cache@2
inputs:
- key: yarn | $(Agent.OS) | yarn.lock
+ key: 'yarn | "$(Agent.OS)"" | yarn.lock'
+ restoreKeys: |
+ yarn | "$(Agent.OS)"
path: $(YARN_CACHE_FOLDER)
- cacheHitVar: CACHE_RESTORED
displayName: Cache Yarn packages
- - script: make install-deps
+ - script: make node_modules
displayName: Install dependencies
- - script: make integration-win
+ - script: make build-npm
+ displayName: Generate npm package
+ - script: make -j2 build-extensions
+ displayName: Build bundled extensions
+ - script: make test
+ displayName: Run tests
+ - script: make test-extensions
+ displayName: Run In-tree Extension tests
+ - bash: |
+ rm -rf extensions/telemetry
+ make integration-win
+ git checkout extensions/telemetry
displayName: Run integration tests
- script: make build
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
@@ -61,23 +84,30 @@ jobs:
inputs:
versionSpec: $(node_version)
displayName: Install Node.js
- - task: CacheBeta@0
+ - task: Cache@2
inputs:
- key: cache | $(Agent.OS) | yarn.lock
- path: $(AZURE_CACHE_FOLDER)
- cacheHitVar: CACHE_RESTORED
+ key: 'yarn | "$(Agent.OS)" | yarn.lock'
+ restoreKeys: |
+ yarn | "$(Agent.OS)"
+ path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- - bash: |
- mkdir -p "$YARN_CACHE_FOLDER"
- tar -xzf "$AZURE_CACHE_FOLDER/yarn-cache.tar.gz" -C /
- displayName: "Unpack cache"
- condition: eq(variables.CACHE_RESTORED, 'true')
- - script: make install-deps
+ - script: make node_modules
displayName: Install dependencies
+ - script: make build-npm
+ displayName: Generate npm package
+ - script: make -j2 build-extensions
+ displayName: Build bundled extensions
- script: make test
displayName: Run tests
- - script: make integration-mac
+ - script: make test-extensions
+ displayName: Run In-tree Extension tests
+ - bash: |
+ rm -rf extensions/telemetry
+ make integration-mac
+ git checkout extensions/telemetry
displayName: Run integration tests
+ - script: make test-extensions
+ displayName: Run In-tree Extension tests
- script: make build
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
displayName: Build
@@ -87,10 +117,6 @@ jobs:
CSC_LINK: $(CSC_LINK)
CSC_KEY_PASSWORD: $(CSC_KEY_PASSWORD)
GH_TOKEN: $(GH_TOKEN)
- - bash: |
- mkdir -p "$AZURE_CACHE_FOLDER"
- tar -czf "$AZURE_CACHE_FOLDER/yarn-cache.tar.gz" "$YARN_CACHE_FOLDER"
- displayName: Pack cache
- job: Linux
pool:
vmImage: ubuntu-16.04
@@ -106,23 +132,23 @@ jobs:
inputs:
versionSpec: $(node_version)
displayName: Install Node.js
- - task: CacheBeta@0
+ - task: Cache@2
inputs:
- key: cache | $(Agent.OS) | yarn.lock
- path: $(AZURE_CACHE_FOLDER)
- cacheHitVar: CACHE_RESTORED
+ key: 'yarn | "$(Agent.OS)" | yarn.lock'
+ restoreKeys: |
+ yarn | "$(Agent.OS)"
+ path: $(YARN_CACHE_FOLDER)
displayName: Cache Yarn packages
- - bash: |
- mkdir -p "$YARN_CACHE_FOLDER"
- tar -xzf "$AZURE_CACHE_FOLDER/yarn-cache.tar.gz" -C /
- displayName: "Unpack cache"
- condition: eq(variables.CACHE_RESTORED, 'true')
- - script: make install-deps
+ - script: make node_modules
displayName: Install dependencies
- - script: make lint
- displayName: Lint
+ - script: make build-npm
+ displayName: Generate npm package
+ - script: make -j2 build-extensions
+ displayName: Build bundled extensions
- script: make test
displayName: Run tests
+ - script: make test-extensions
+ displayName: Run In-tree Extension tests
- bash: |
sudo apt-get update
sudo apt-get install libgconf-2-4 conntrack -y
@@ -132,7 +158,10 @@ jobs:
# Although the kube and minikube config files are in placed $HOME they are owned by root
sudo chown -R $USER $HOME/.kube $HOME/.minikube
displayName: Install integration test dependencies
- - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux
+ - bash: |
+ rm -rf extensions/telemetry
+ xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux
+ git checkout extensions/telemetry
displayName: Run integration tests
- bash: |
sudo chown root:root /
@@ -149,7 +178,8 @@ jobs:
condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
env:
GH_TOKEN: $(GH_TOKEN)
- - bash: |
- mkdir -p "$AZURE_CACHE_FOLDER"
- tar -czf "$AZURE_CACHE_FOLDER/yarn-cache.tar.gz" "$YARN_CACHE_FOLDER"
- displayName: Pack cache
+ - script: make publish-npm
+ displayName: Publish npm package
+ condition: "and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))"
+ env:
+ NPM_TOKEN: $(NPM_TOKEN)
diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 1c16b275cb..0000000000
--- a/.babelrc
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "presets": [
- "@babel/preset-env",
- "@babel/preset-react",
- "@lingui/babel-preset-react"
- ],
- "plugins": [
- "macros",
- "@babel/plugin-syntax-dynamic-import",
- "@babel/plugin-transform-runtime"
- ]
-}
diff --git a/.eslintrc.js b/.eslintrc.js
index 516029cdd4..3fd52c2465 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,67 +1,140 @@
-module.exports = {
+const packageJson = require("./package.json");
+
+module.exports = {
+ ignorePatterns: [
+ "**/node_modules/**/*",
+ "**/dist/**/*",
+ "**/static/**/*",
+ ],
+ settings: {
+ react: {
+ version: packageJson.devDependencies.react || "detect",
+ }
+ },
overrides: [
{
files: [
- "src/renderer/**/*.js",
- "build/**/*.js",
+ "**/*.js"
],
extends: [
- 'eslint:recommended',
+ "eslint:recommended",
],
env: {
node: true
},
- parserOptions: {
+ parserOptions: {
ecmaVersion: 2018,
- sourceType: 'module',
+ sourceType: "module",
},
+ plugins: [
+ "unused-imports"
+ ],
rules: {
- "indent": ["error", 2],
+ "indent": ["error", 2, {
+ "SwitchCase": 1,
+ }],
"no-unused-vars": "off",
+ "unused-imports/no-unused-imports": "error",
+ "unused-imports/no-unused-vars": [
+ "warn", {
+ "vars": "all",
+ "args": "after-used",
+ "ignoreRestSiblings": true,
+ }
+ ],
+ "quotes": ["error", "double", {
+ "avoidEscape": true,
+ "allowTemplateLiterals": true,
+ }],
+ "semi": ["error", "always"],
+ "object-shorthand": "error",
+ "prefer-template": "error",
+ "template-curly-spacing": "error",
+ "padding-line-between-statements": [
+ "error",
+ { "blankLine": "always", "prev": "*", "next": "return" },
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
+ { "blankLine": "always", "prev": "*", "next": "function" },
+ { "blankLine": "always", "prev": "*", "next": "class" },
+ { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
+ { "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
+ ]
}
},
{
files: [
- "build/*.ts",
- "src/**/*.ts",
- "integration/**/*.ts"
+ "**/*.ts",
],
parser: "@typescript-eslint/parser",
- extends: [
- 'plugin:@typescript-eslint/recommended',
+ extends: [
+ "plugin:@typescript-eslint/recommended",
],
- parserOptions: {
+ plugins: [
+ "unused-imports"
+ ],
+ parserOptions: {
ecmaVersion: 2018,
- sourceType: 'module',
+ sourceType: "module",
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-interface": "off",
- "indent": ["error", 2]
+ "@typescript-eslint/no-unused-vars": "off",
+ "unused-imports/no-unused-imports-ts": "error",
+ "unused-imports/no-unused-vars-ts": [
+ "warn", {
+ "vars": "all",
+ "args": "after-used",
+ "ignoreRestSiblings": true,
+ }
+ ],
+ "indent": ["error", 2, {
+ "SwitchCase": 1,
+ }],
+ "quotes": ["error", "double", {
+ "avoidEscape": true,
+ "allowTemplateLiterals": true,
+ }],
+ "semi": "off",
+ "@typescript-eslint/semi": ["error"],
+ "object-shorthand": "error",
+ "prefer-template": "error",
+ "template-curly-spacing": "error",
+ "padding-line-between-statements": [
+ "error",
+ { "blankLine": "always", "prev": "*", "next": "return" },
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
+ { "blankLine": "always", "prev": "*", "next": "function" },
+ { "blankLine": "always", "prev": "*", "next": "class" },
+ { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
+ { "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
+ ]
},
},
{
files: [
- "src/renderer/**/*.tsx",
+ "**/*.tsx",
],
parser: "@typescript-eslint/parser",
- extends: [
- 'plugin:@typescript-eslint/recommended',
+ plugins: [
+ "unused-imports"
],
- parserOptions: {
+ extends: [
+ "plugin:@typescript-eslint/recommended",
+ "plugin:react/recommended",
+ ],
+ parserOptions: {
ecmaVersion: 2018,
- sourceType: 'module',
+ sourceType: "module",
jsx: true,
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-interface": "off",
@@ -70,7 +143,37 @@ module.exports = {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-empty-function": "off",
- "indent": ["error", 2]
+ "react/display-name": "off",
+ "@typescript-eslint/no-unused-vars": "off",
+ "unused-imports/no-unused-imports-ts": "error",
+ "unused-imports/no-unused-vars-ts": [
+ "warn", {
+ "vars": "all",
+ "args": "after-used",
+ "ignoreRestSiblings": true,
+ }
+ ],
+ "indent": ["error", 2, {
+ "SwitchCase": 1,
+ }],
+ "quotes": ["error", "double", {
+ "avoidEscape": true,
+ "allowTemplateLiterals": true,
+ }],
+ "semi": "off",
+ "@typescript-eslint/semi": ["error"],
+ "object-shorthand": "error",
+ "prefer-template": "error",
+ "template-curly-spacing": "error",
+ "padding-line-between-statements": [
+ "error",
+ { "blankLine": "always", "prev": "*", "next": "return" },
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
+ { "blankLine": "always", "prev": "*", "next": "function" },
+ { "blankLine": "always", "prev": "*", "next": "class" },
+ { "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
+ { "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]},
+ ]
},
}
]
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index e25375fca9..dab52add93 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
-labels: ''
+labels: 'bug'
assignees: ''
---
@@ -26,8 +26,8 @@ If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Lens Version:
- OS: [e.g. OSX]
-- Installation method (e.g. snap or AppImage in Linux):
-
+- Installation method (e.g. snap or AppImage in Linux):
+
**Logs:**
When you run the application executable from command line you will see some logging output. Please paste them here:
```
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000000..9770f52991
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,9 @@
+# Please see the documentation for all configuration options:
+# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+ - package-ecosystem: "npm" # See documentation for possible values
+ directory: "/" # Location of package manifests
+ schedule:
+ interval: "daily"
diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml
new file mode 100644
index 0000000000..eafc6befc0
--- /dev/null
+++ b/.github/workflows/check-docs.yml
@@ -0,0 +1,30 @@
+name: Check Documentation
+on:
+ - pull_request
+jobs:
+ build:
+ name: Check Docs
+ runs-on: ubuntu-latest
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'area/documentation') }}
+ strategy:
+ matrix:
+ node-version: [12.x]
+ steps:
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Using Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Generate Extensions API Reference using typedocs
+ run: |
+ yarn install
+ yarn typedocs-extensions-api
+
+ - name: Verify that the markdown is valid
+ run: |
+ yarn run verify-docs
diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
new file mode 100644
index 0000000000..e847eab0f5
--- /dev/null
+++ b/.github/workflows/linter.yml
@@ -0,0 +1,26 @@
+name: Lint Repo
+on:
+ - pull_request
+jobs:
+ build:
+ name: Lint
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [12.x]
+ steps:
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Using Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Install deps
+ run: yarn install
+
+ - name: Lint
+ run: yarn run lint
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000000..afbcc74367
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,94 @@
+name: Publish docs via GitHub Pages
+on:
+ push:
+ branches:
+ - master
+ release:
+ types:
+ - published
+jobs:
+ verify-docs:
+ name: Verify docs
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [12.x]
+ steps:
+ - name: Set up Python 3.7
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Using Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Generate Extensions API Reference using typedocs
+ run: |
+ yarn install
+ yarn typedocs-extensions-api
+
+ - name: Verify that the markdown is valid
+ run: |
+ yarn run verify-docs
+
+ build:
+ name: Deploy docs
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [12.x]
+ needs: verify-docs
+ steps:
+ - name: Set up Python 3.7
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install git+https://${{ secrets.GH_TOKEN }}@github.com/lensapp/mkdocs-material-insiders.git
+ pip install mike
+
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: git config
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+
+ - name: Using Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Generate Extensions API Reference using typedocs
+ run: |
+ yarn install
+ yarn typedocs-extensions-api
+
+ - name: mkdocs deploy master
+ if: contains(github.ref, 'refs/heads/master')
+ run: |
+ mike deploy --push master
+
+ - name: Get the release version
+ if: contains(github.ref, 'refs/tags/v') && !github.event.release.prerelease
+ id: get_version
+ run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
+
+ - name: mkdocs deploy new release
+ if: contains(github.ref, 'refs/tags/v') && !github.event.release.prerelease
+ run: |
+ mike deploy --push --update-aliases ${{ steps.get_version.outputs.VERSION }} latest
+ mike set-default --push ${{ steps.get_version.outputs.VERSION }}
diff --git a/.github/workflows/mkdocs-delete-version.yml b/.github/workflows/mkdocs-delete-version.yml
new file mode 100644
index 0000000000..0183910d8d
--- /dev/null
+++ b/.github/workflows/mkdocs-delete-version.yml
@@ -0,0 +1,38 @@
+name: Delete Documentation Version
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version string to be deleted (e.g."v0.0.1")'
+ required: true
+jobs:
+ build:
+ name: Delete docs Version
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Python 3.7
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install git+https://${{ secrets.GH_TOKEN }}@github.com/lensapp/mkdocs-material-insiders.git
+ pip install mike
+
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: git config
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+
+
+ - name: mkdocs delete version
+ run: |
+ mike delete --push ${{ github.event.inputs.version }}
+
\ No newline at end of file
diff --git a/.github/workflows/mkdocs-set-default-version.yml b/.github/workflows/mkdocs-set-default-version.yml
new file mode 100644
index 0000000000..694a7af726
--- /dev/null
+++ b/.github/workflows/mkdocs-set-default-version.yml
@@ -0,0 +1,38 @@
+name: Update Default Documentation Version
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: 'Version string to be default (e.g."v0.0.1")'
+ required: true
+jobs:
+ build:
+ name: Update default docs Version
+ runs-on: ubuntu-latest
+ steps:
+ - name: Set up Python 3.7
+ uses: actions/setup-python@v2
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install git+https://${{ secrets.GH_TOKEN }}@github.com/lensapp/mkdocs-material-insiders.git
+ pip install mike
+
+ - name: Checkout Release from lens
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: git config
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+
+
+ - name: mkdocs update default version
+ run: |
+ mike set-default --push ${{ github.event.inputs.version }}
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index d6efc880e7..88d48ab5ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,20 @@
dist/
-out/
node_modules/
.DS_Store
yarn-error.log
coverage/
tmp/
-static/build/**
-binaries/client/
-binaries/server/
locales/**/**.js
lens.log
+static/build
+static/types
+binaries/client/
+binaries/server/
+src/extensions/*/*.js
+src/extensions/*/*.d.ts
+types/extension-api.d.ts
+types/extension-renderer-api.d.ts
+extensions/*/dist
+docs/extensions/api
+site/
+.vscode/
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000000..6eaa07c2fd
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,132 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+info@k8slens.dev.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
+at [https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..1c745f852d
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+# Contributing to Lens
+
+See [Contributing to Lens](https://docs.k8slens.dev/latest/contributing/) documentation.
diff --git a/LICENSE b/LICENSE
index 841736290b..b7a6d74205 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,8 +1,13 @@
-MIT License
-
Copyright (c) 2020 Mirantis, Inc.
-All rights reserved.
+Portions of this software are licensed as follows:
+
+* All content residing under the "docs/" directory of this repository, if that
+directory exists, is licensed under "Creative Commons: CC BY-SA 4.0 license".
+* All third party components incorporated into the Lens Software are licensed
+under the original license provided by the owner of the applicable component.
+* Content outside of the above mentioned directories or restrictions above is
+available under the "MIT" license as defined below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Makefile b/Makefile
index e492aa012c..362ef3b830 100644
--- a/Makefile
+++ b/Makefile
@@ -1,65 +1,122 @@
+EXTENSIONS_DIR = ./extensions
+extensions = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir})
+extension_node_modules = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/node_modules)
+extension_dists = $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), ${dir}/dist)
+
ifeq ($(OS),Windows_NT)
DETECTED_OS := Windows
else
DETECTED_OS := $(shell uname)
endif
-.PHONY: init dev build test clean
-
-init: install-deps download-bins compile-dev
- echo "Init done"
-
-download-bins:
+binaries/client:
yarn download-bins
-install-deps:
+node_modules:
yarn install --frozen-lockfile
+ yarn check --verify-tree --integrity
+static/build/LensDev.html:
+ yarn compile:renderer
+
+.PHONY: compile-dev
compile-dev:
yarn compile:main --cache
yarn compile:renderer --cache
-dev:
-ifeq ("$(wildcard static/build/main.js)","")
- make init
-endif
+.PHONY: dev
+dev: node_modules binaries/client build-extensions static/build/LensDev.html
yarn dev
+.PHONY: lint
lint:
yarn lint
-test: download-bins
+.PHONY: test
+test: binaries/client
yarn test
-integration-linux:
+.PHONY: integration-linux
+integration-linux: build-extension-types build-extensions
yarn build:linux
yarn integration
-integration-mac:
+.PHONY: integration-mac
+integration-mac: build-extension-types build-extensions
yarn build:mac
yarn integration
-integration-win:
+.PHONY: integration-win
+integration-win: build-extension-types build-extensions
yarn build:win
yarn integration
+.PHONY: test-app
test-app:
yarn test
-build: install-deps download-bins
+.PHONY: build
+build: node_modules binaries/client build-extensions
ifeq "$(DETECTED_OS)" "Windows"
yarn dist:win
else
yarn dist
endif
-clean:
-ifeq "$(DETECTED_OS)" "Windows"
- if exist binaries\client del /s /q binaries\client\*.*
- if exist dist del /s /q dist\*.*
- if exist static\build del /s /q static\build\*.*
-else
- rm -rf binaries/client/*
+$(extension_node_modules):
+ cd $(@:/node_modules=) && npm install --no-audit --no-fund
+
+$(extension_dists): src/extensions/npm/extensions/dist
+ cd $(@:/dist=) && npm run build
+
+.PHONY: build-extensions
+build-extensions: $(extension_node_modules) $(extension_dists)
+
+.PHONY: test-extensions
+test-extensions: $(extension_node_modules)
+ $(foreach dir, $(extensions), (cd $(dir) && npm run test || exit $?);)
+
+.PHONY: copy-extension-themes
+copy-extension-themes:
+ mkdir -p src/extensions/npm/extensions/dist/src/renderer/themes/
+ cp $(wildcard src/renderer/themes/*.json) src/extensions/npm/extensions/dist/src/renderer/themes/
+
+src/extensions/npm/extensions/__mocks__:
+ cp -r __mocks__ src/extensions/npm/extensions/
+
+src/extensions/npm/extensions/dist:
+ yarn compile:extension-types
+
+.PHONY: build-npm
+build-npm: build-extension-types copy-extension-themes src/extensions/npm/extensions/__mocks__
+ yarn npm:fix-package-version
+
+.PHONY: build-extension-types
+build-extension-types: src/extensions/npm/extensions/dist
+
+.PHONY: publish-npm
+publish-npm: build-npm
+ npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
+ cd src/extensions/npm/extensions && npm publish --access=public
+
+.PHONY: docs
+docs:
+ yarn mkdocs-serve-local
+
+.PHONY: clean-extensions
+clean-extensions:
+ $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/dist)
+ $(foreach dir, $(wildcard $(EXTENSIONS_DIR)/*), rm -rf $(dir)/node_modules)
+
+.PHONY: clean-npm
+clean-npm:
+ rm -rf src/extensions/npm/extensions/dist
+ rm -rf src/extensions/npm/extensions/__mocks__
+ rm -rf src/extensions/npm/extensions/node_modules
+
+.PHONY: clean
+clean: clean-npm clean-extensions
+ rm -rf binaries/client
rm -rf dist/*
rm -rf static/build/*
-endif
\ No newline at end of file
+ rm -rf node_modules/
diff --git a/README.md b/README.md
index 149706c99f..dc018b3ac2 100644
--- a/README.md
+++ b/README.md
@@ -1,57 +1,40 @@
# Lens | The Kubernetes IDE
[](https://dev.azure.com/lensapp/lensapp/_build/latest?definitionId=1&branchName=master)
-[](https://github.com/lensapp/lens/releases)
+[](https://github.com/lensapp/lens/releases?label=Downloads)
[](https://join.slack.com/t/k8slens/shared_invite/enQtOTc5NjAyNjYyOTk4LWU1NDQ0ZGFkOWJkNTRhYTc2YjVmZDdkM2FkNGM5MjhiYTRhMDU2NDQ1MzIyMDA4ZGZlNmExOTc0N2JmY2M3ZGI)
-Lens is the only IDE you’ll ever need to take control of your Kubernetes clusters. It is a standalone application for MacOS, Windows and Linux operating systems. It is open source and free.
+Lens provides the full situational awareness for everything that runs in Kubernetes. It's lowering the barrier of entry for people just getting started and radically improving productivity for people with more experience.
-[](https://youtu.be/04v2ODsmtIs)
+The Lens open source project is backed by a number of Kubernetes and cloud native ecosystem pioneers. It's a standalone application for MacOS, Windows and Linux operating systems. Lens is 100% open source and free of charge for any purpose.
+
+[](https://www.youtube.com/watch?v=eeDwdVXattc)
## What makes Lens special?
* Amazing usability and end-user experience
-* Multi cluster management: support for hundreds of clusters
+* Unified, secure, multi-cluster management on any platform: support for hundreds of clusters
* Standalone application: no need to install anything in-cluster
+* Lens installs anywhere, elimanting the need to wrangle credentials
* Real-time cluster state visualization
* Resource utilization charts and trends with history powered by built-in Prometheus
-* Terminal access to nodes and containers
+* Smart terminal access to nodes and containers
+* Clusters can be local (e.g. minikube) or external (e.g. EKS, GKE, AKS)
* Performance optimized to handle massive clusters (tested with a cluster running 25k pods)
-* Full support for Kubernetes RBAC
+* RBAC security is preserved, as Lens uses the standard Kubernetes API
+* Lens Extensions are used to add custom visualizations and functionality to accelerate development workflows for all the technologies and services that integrate with Kubernetes
+* Port forwarding
+* Helm package deployment: Browse and deploy Helm charts with one click-Install
+* Extensions via Lens Extensions API
## Installation
-Download a pre-built package from the [releases](https://github.com/lensapp/lens/releases) page. Lens can be also installed via [snapcraft](https://snapcraft.io/kontena-lens) (Linux only).
-
-Alternatively on Mac:
-```
-brew cask install lens
-```
+See [Getting Started](https://docs.k8slens.dev/latest/getting-started/) page.
## Development
-> Prerequisites: Nodejs v12, make, yarn
-
-* `make init` - initial compilation, installing deps, etc.
-* `make dev` - builds and starts the app
-* `make test` - run tests
-
-## Development (advanced)
-
-Allows for faster separate re-runs of some of the more involved processes:
-
-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
-
-## 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)
+See [Development](https://docs.k8slens.dev/latest/contributing/development/) page.
## Contributing
-Bug reports and pull requests are welcome on GitHub at https://github.com/lensapp/lens.
\ No newline at end of file
+See [Contributing](https://docs.k8slens.dev/latest/contributing/) page.
diff --git a/__mocks__/@linguiMacro.ts b/__mocks__/@linguiMacro.ts
new file mode 100644
index 0000000000..a1154b42dd
--- /dev/null
+++ b/__mocks__/@linguiMacro.ts
@@ -0,0 +1,4 @@
+module.exports = {
+ Trans: ({ children }: { children: React.ReactNode }) => children,
+ t: (message: string) => message
+};
diff --git a/__mocks__/electron.ts b/__mocks__/electron.ts
index 889a09c914..1b531fb8d7 100644
--- a/__mocks__/electron.ts
+++ b/__mocks__/electron.ts
@@ -4,14 +4,15 @@ module.exports = {
app: {
getVersion: jest.fn().mockReturnValue("3.0.0"),
getLocale: jest.fn().mockRejectedValue("en"),
- getPath: jest.fn((name: string) => {
- return "tmp"
- }),
+ getPath: jest.fn(() => "tmp"),
},
remote: {
app: {
getPath: jest.fn()
}
},
- dialog: jest.fn()
+ dialog: jest.fn(),
+ ipcRenderer: {
+ on: jest.fn()
+ }
};
diff --git a/__mocks__/imageMock.ts b/__mocks__/imageMock.ts
new file mode 100644
index 0000000000..a099545376
--- /dev/null
+++ b/__mocks__/imageMock.ts
@@ -0,0 +1 @@
+module.exports = {};
\ No newline at end of file
diff --git a/build/build_tray_icon.ts b/build/build_tray_icon.ts
new file mode 100644
index 0000000000..3aded6fdf5
--- /dev/null
+++ b/build/build_tray_icon.ts
@@ -0,0 +1,53 @@
+// Generate tray icons from SVG to PNG + different sizes and colors (B&W)
+// Command: `yarn build:tray-icons`
+import path from "path";
+import sharp from "sharp";
+import jsdom from "jsdom";
+import fs from "fs-extra";
+
+export async function generateTrayIcon(
+ {
+ outputFilename = "tray_icon", // e.g. output tray_icon_dark@2x.png
+ svgIconPath = path.resolve(__dirname, "../src/renderer/components/icon/logo-lens.svg"),
+ outputFolder = path.resolve(__dirname, "./tray"),
+ dpiSuffix = "2x",
+ pixelSize = 32,
+ shouldUseDarkColors = false, // managed by electron.nativeTheme.shouldUseDarkColors
+ } = {}) {
+ outputFilename += shouldUseDarkColors ? "_dark" : "";
+ dpiSuffix = dpiSuffix !== "1x" ? `@${dpiSuffix}` : "";
+ const pngIconDestPath = path.resolve(outputFolder, `${outputFilename}${dpiSuffix}.png`);
+
+ try {
+ // Modify .SVG colors
+ const trayIconColor = shouldUseDarkColors ? "white" : "black";
+ const svgDom = await jsdom.JSDOM.fromFile(svgIconPath);
+ const svgRoot = svgDom.window.document.body.getElementsByTagName("svg")[0];
+
+ svgRoot.innerHTML += ``;
+ const svgIconBuffer = Buffer.from(svgRoot.outerHTML);
+ // Resize and convert to .PNG
+ const pngIconBuffer: Buffer = await sharp(svgIconBuffer)
+ .resize({ width: pixelSize, height: pixelSize })
+ .png()
+ .toBuffer();
+
+ // Save icon
+ await fs.writeFile(pngIconDestPath, pngIconBuffer);
+ console.info(`[DONE]: Tray icon saved at "${pngIconDestPath}"`);
+ } catch (err) {
+ console.error(`[ERROR]: ${err}`);
+ }
+}
+
+// Run
+const iconSizes: Record = {
+ "1x": 16,
+ "2x": 32,
+ "3x": 48,
+};
+
+Object.entries(iconSizes).forEach(([dpiSuffix, pixelSize]) => {
+ generateTrayIcon({ dpiSuffix, pixelSize, shouldUseDarkColors: false });
+ generateTrayIcon({ dpiSuffix, pixelSize, shouldUseDarkColors: true });
+});
diff --git a/build/download_helm.ts b/build/download_helm.ts
index 9dddf7fcdc..7a3dc62a72 100644
--- a/build/download_helm.ts
+++ b/build/download_helm.ts
@@ -1,3 +1,3 @@
-import { helmCli } from "../src/main/helm/helm-cli"
+import { helmCli } from "../src/main/helm/helm-cli";
-helmCli.ensureBinary()
+helmCli.ensureBinary();
diff --git a/build/download_kubectl.ts b/build/download_kubectl.ts
index a697552aa8..f046b23e30 100644
--- a/build/download_kubectl.ts
+++ b/build/download_kubectl.ts
@@ -1,20 +1,21 @@
-import packageInfo from "../package.json"
-import fs from "fs"
-import request from "request"
-import md5File from "md5-file"
-import requestPromise from "request-promise-native"
-import { ensureDir, pathExists } from "fs-extra"
-import path from "path"
+import packageInfo from "../package.json";
+import fs from "fs";
+import request from "request";
+import md5File from "md5-file";
+import requestPromise from "request-promise-native";
+import { ensureDir, pathExists } from "fs-extra";
+import path from "path";
class KubectlDownloader {
- public kubectlVersion: string
- protected url: string
+ public kubectlVersion: string;
+ protected url: string;
protected path: string;
- protected dirname: string
+ protected dirname: string;
constructor(clusterVersion: string, platform: string, arch: string, target: string) {
this.kubectlVersion = clusterVersion;
- const binaryName = platform === "windows" ? "kubectl.exe" : "kubectl"
+ const binaryName = platform === "windows" ? "kubectl.exe" : "kubectl";
+
this.url = `https://storage.googleapis.com/kubernetes-release/release/v${this.kubectlVersion}/bin/${platform}/${arch}/${binaryName}`;
this.dirname = path.dirname(target);
this.path = target;
@@ -25,83 +26,94 @@ class KubectlDownloader {
method: "HEAD",
uri: this.url,
resolveWithFullResponse: true
- }).catch((error) => { console.log(error) })
+ }).catch((error) => { console.log(error); });
if (response.headers["etag"]) {
- return response.headers["etag"].replace(/"/g, "")
+ return response.headers["etag"].replace(/"/g, "");
}
- return ""
+
+ return "";
}
public async checkBinary() {
- const exists = await pathExists(this.path)
+ const exists = await pathExists(this.path);
+
if (exists) {
- const hash = md5File.sync(this.path)
- const etag = await this.urlEtag()
+ const hash = md5File.sync(this.path);
+ const etag = await this.urlEtag();
+
if(hash == etag) {
- console.log("Kubectl md5sum matches the remote etag")
- return true
+ console.log("Kubectl md5sum matches the remote etag");
+
+ return true;
}
- console.log("Kubectl md5sum " + hash + " does not match the remote etag " + etag + ", unlinking and downloading again")
- await fs.promises.unlink(this.path)
+ console.log(`Kubectl md5sum ${hash} does not match the remote etag ${etag}, unlinking and downloading again`);
+ await fs.promises.unlink(this.path);
}
- return false
+ return false;
}
public async downloadKubectl() {
const exists = await this.checkBinary();
- if(exists) {
- console.log("Already exists and is valid")
- return
- }
- await ensureDir(path.dirname(this.path), 0o755)
- const file = fs.createWriteStream(this.path)
- console.log(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`)
+ if(exists) {
+ console.log("Already exists and is valid");
+
+ return;
+ }
+ await ensureDir(path.dirname(this.path), 0o755);
+
+ const file = fs.createWriteStream(this.path);
+
+ console.log(`Downloading kubectl ${this.kubectlVersion} from ${this.url} to ${this.path}`);
const requestOpts: request.UriOptions & request.CoreOptions = {
uri: this.url,
gzip: true
- }
- const stream = request(requestOpts)
+ };
+ const stream = request(requestOpts);
stream.on("complete", () => {
- console.log("kubectl binary download finished")
- file.end(() => {})
- })
+ console.log("kubectl binary download finished");
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
+ file.end(() => {});
+ });
stream.on("error", (error) => {
- console.log(error)
- fs.unlink(this.path, () => {})
- throw(error)
- })
+ console.log(error);
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
+ fs.unlink(this.path, () => {});
+ throw(error);
+ });
+
return new Promise((resolve, reject) => {
file.on("close", () => {
- console.log("kubectl binary download closed")
+ console.log("kubectl binary download closed");
fs.chmod(this.path, 0o755, (err) => {
if (err) reject(err);
- })
- resolve()
- })
- stream.pipe(file)
- })
+ });
+ resolve();
+ });
+ stream.pipe(file);
+ });
}
}
const downloadVersion = packageInfo.config.bundledKubectlVersion;
-const baseDir = path.join(process.env.INIT_CWD, 'binaries', 'client')
+const baseDir = path.join(process.env.INIT_CWD, "binaries", "client");
const downloads = [
- { platform: 'linux', arch: 'amd64', target: path.join(baseDir, 'linux', 'x64', 'kubectl') },
- { platform: 'darwin', arch: 'amd64', target: path.join(baseDir, 'darwin', 'x64', 'kubectl') },
- { platform: 'windows', arch: 'amd64', target: path.join(baseDir, 'windows', 'x64', 'kubectl.exe') },
- { platform: 'windows', arch: '386', target: path.join(baseDir, 'windows', 'ia32', 'kubectl.exe') }
-]
+ { platform: "linux", arch: "amd64", target: path.join(baseDir, "linux", "x64", "kubectl") },
+ { platform: "darwin", arch: "amd64", target: path.join(baseDir, "darwin", "x64", "kubectl") },
+ { platform: "windows", arch: "amd64", target: path.join(baseDir, "windows", "x64", "kubectl.exe") },
+ { platform: "windows", arch: "386", target: path.join(baseDir, "windows", "ia32", "kubectl.exe") }
+];
downloads.forEach((dlOpts) => {
- console.log(dlOpts)
+ console.log(dlOpts);
const downloader = new KubectlDownloader(downloadVersion, dlOpts.platform, dlOpts.arch, dlOpts.target);
- console.log("Downloading: " + JSON.stringify(dlOpts));
- downloader.downloadKubectl().then(() => downloader.checkBinary().then(() => console.log("Download complete")))
-})
+
+ console.log(`Downloading: ${JSON.stringify(dlOpts)}`);
+ downloader.downloadKubectl().then(() => downloader.checkBinary().then(() => console.log("Download complete")));
+});
diff --git a/build/notarize.js b/build/notarize.js
index 3d97b152c5..ef4144993c 100644
--- a/build/notarize.js
+++ b/build/notarize.js
@@ -1,10 +1,12 @@
-const { notarize } = require('electron-notarize')
+const { notarize } = require("electron-notarize");
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
- if (electronPlatformName !== 'darwin') {
+
+ if (electronPlatformName !== "darwin") {
return;
}
+
if (!process.env.APPLEID || !process.env.APPLEIDPASS) {
return;
}
@@ -12,7 +14,7 @@ exports.default = async function notarizing(context) {
const appName = context.packager.appInfo.productFilename;
return await notarize({
- appBundleId: 'io.kontena.lens-app',
+ appBundleId: "io.kontena.lens-app",
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASS,
diff --git a/build/set_npm_version.ts b/build/set_npm_version.ts
new file mode 100644
index 0000000000..9b433349fb
--- /dev/null
+++ b/build/set_npm_version.ts
@@ -0,0 +1,9 @@
+import * as fs from "fs";
+import * as path from "path";
+import packageInfo from "../src/extensions/npm/extensions/package.json";
+import appInfo from "../package.json";
+
+const packagePath = path.join(__dirname, "../src/extensions/npm/extensions/package.json");
+
+packageInfo.version = appInfo.version;
+fs.writeFileSync(packagePath, `${JSON.stringify(packageInfo, null, 2)}\n`);
diff --git a/build/tray/trayIconTemplate.png b/build/tray/trayIconTemplate.png
new file mode 100644
index 0000000000..568d13e00b
Binary files /dev/null and b/build/tray/trayIconTemplate.png differ
diff --git a/build/tray/trayIconTemplate@2x.png b/build/tray/trayIconTemplate@2x.png
new file mode 100644
index 0000000000..3f28605dbf
Binary files /dev/null and b/build/tray/trayIconTemplate@2x.png differ
diff --git a/build/tray/trayIconTemplate@3x.png b/build/tray/trayIconTemplate@3x.png
new file mode 100644
index 0000000000..5e682a5d82
Binary files /dev/null and b/build/tray/trayIconTemplate@3x.png differ
diff --git a/docs/CNAME b/docs/CNAME
new file mode 100644
index 0000000000..12bc650410
--- /dev/null
+++ b/docs/CNAME
@@ -0,0 +1 @@
+docs.k8slens.dev
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000000..1a13ddb6a9
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,21 @@
+# Overview
+
+Lens is the most powerful Kubernetes IDE on the market. It is a standalone application, and it is available on macOS, Windows, and Linux. Some of the benefits of using Lens include:
+
+* Confidence that your clusters are properly setup and configured.
+* Increased visibility, real time statistics, log streams, and hands-on troubleshooting capabilities.
+* The ability to work with your clusters quickly and easily, radically improving productivity and the speed of business.
+
+Watch this introductory video to see Lens in action:
+
+[](https://www.youtube.com/watch?v=eeDwdVXattc)
+
+**Note:** Use CTRL+click (on Windows and Linux) or CMD+click (on MacOS) to open the above in a new tab
+
+## Downloading Lens
+
+[Download Lens](https://github.com/lensapp/lens/releases) for macOS, Windows, or Linux.
+
+## Quick Start
+
+Get up and running quickly by learning to [add clusters](clusters/adding-clusters.md).
diff --git a/docs/clusters/adding-clusters.md b/docs/clusters/adding-clusters.md
new file mode 100644
index 0000000000..d153d8c9bf
--- /dev/null
+++ b/docs/clusters/adding-clusters.md
@@ -0,0 +1,22 @@
+# Adding Clusters
+
+Add clusters by clicking the **Add Cluster** button in the left-side menu.
+
+1. Click the **Add Cluster** button (indicated with a '+' icon).
+2. Enter the path to your kubeconfig file. You'll need to have a kubeconfig file for the cluster you want to add. You can either browse for the path from the file system or or enter it directly.
+
+Selected [cluster contexts](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) are added as a separate item in the left-side cluster menu to allow you to operate easily on multiple clusters and/or contexts.
+
+**NOTE**: Any cluster that you added manually will not be merged into your kubeconfig file.
+
+
+
+For more information on kubeconfig see [Kubernetes docs](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/).
+
+To see your currently-enabled config with `kubectl`, enter `kubectl config view --minify --raw` in your terminal.
+
+When connecting to a cluster, make sure you have a valid and working kubeconfig for the cluster. Following lists known "gotchas" in some authentication types used in kubeconfig with Lens app.
+
+## Exec auth plugins
+
+When using [exec auth](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#configuration) plugins make sure the paths that are used to call any binaries are full paths as Lens app might not be able to call binaries with relative paths. Make also sure that you pass all needed information either as arguments or env variables in the config, Lens app might not have all login shell env variables set automatically.
diff --git a/docs/clusters/images/add-cluster.png b/docs/clusters/images/add-cluster.png
new file mode 100644
index 0000000000..fa7b632026
Binary files /dev/null and b/docs/clusters/images/add-cluster.png differ
diff --git a/docs/clusters/images/cluster-context-menu.png b/docs/clusters/images/cluster-context-menu.png
new file mode 100644
index 0000000000..d733840df3
Binary files /dev/null and b/docs/clusters/images/cluster-context-menu.png differ
diff --git a/docs/clusters/images/cluster-settings-features.png b/docs/clusters/images/cluster-settings-features.png
new file mode 100644
index 0000000000..3a8066309d
Binary files /dev/null and b/docs/clusters/images/cluster-settings-features.png differ
diff --git a/docs/clusters/images/cluster-settings-general.png b/docs/clusters/images/cluster-settings-general.png
new file mode 100644
index 0000000000..d7de0a1a35
Binary files /dev/null and b/docs/clusters/images/cluster-settings-general.png differ
diff --git a/docs/clusters/images/cluster-settings-removal.png b/docs/clusters/images/cluster-settings-removal.png
new file mode 100644
index 0000000000..badcbcc6e0
Binary files /dev/null and b/docs/clusters/images/cluster-settings-removal.png differ
diff --git a/docs/clusters/images/cluster-settings-status.png b/docs/clusters/images/cluster-settings-status.png
new file mode 100644
index 0000000000..af8e939e35
Binary files /dev/null and b/docs/clusters/images/cluster-settings-status.png differ
diff --git a/docs/clusters/images/cluster-settings.png b/docs/clusters/images/cluster-settings.png
new file mode 100644
index 0000000000..27a4a72ff9
Binary files /dev/null and b/docs/clusters/images/cluster-settings.png differ
diff --git a/docs/clusters/images/remove-cluster.png b/docs/clusters/images/remove-cluster.png
new file mode 100644
index 0000000000..bcaa69c44a
Binary files /dev/null and b/docs/clusters/images/remove-cluster.png differ
diff --git a/docs/clusters/removing-clusters.md b/docs/clusters/removing-clusters.md
new file mode 100644
index 0000000000..3ec0d3a1cd
--- /dev/null
+++ b/docs/clusters/removing-clusters.md
@@ -0,0 +1,12 @@
+# Removing Clusters
+
+Remove Lens clusters using the context menu that appears when you right-click the cluster in the left-side menu that you want to remove.
+
+To remove a cluster from your cluster list:
+
+1. Right-click the name of the cluster in the left-side menu that you want to remove.
+2. Click **Remove**.
+
+**NOTE**: This will only remove the cluster from your Lens cluster list. It will not affect your actual Kubernetes cluster or its configuration.
+
+
\ No newline at end of file
diff --git a/docs/clusters/settings.md b/docs/clusters/settings.md
new file mode 100644
index 0000000000..351c0babeb
--- /dev/null
+++ b/docs/clusters/settings.md
@@ -0,0 +1,75 @@
+# Settings
+
+It is easy to configure Lens Clusters to your liking through its various settings.
+
+1. Right-click the name of the cluster in the left-side menu that you want to open the settings for.
+2. Click **Settings**.
+
+
+
+## Status
+
+Overview of the cluster status
+
+### Cluster Status
+
+Cluster status information including the detected distribution, kernel version, API endpoint, and online status
+
+
+
+## General
+
+General cluster settings
+
+### Cluster Name
+
+The cluster name is inheritated by default from the kubeconfig file. Change the cluster name to another value by updating it here. Note that doing so does not update your kubeconfig file.
+
+### Workspace
+
+This is the Lens workspace that the cluster is associated with. Change workspaces by selecting a different workspace from the dropdown menu. Create a new workspace by clicking **workspace** in "Define cluster workspace" above the dropdown menu. This option will take you the workspaces editor. Create a new workspace and then navigate back to cluster settings.
+
+### Cluster Icon
+
+Lens randomly generates an icon to associate with each newly-created cluster. Use this setting to choose your own icon.
+
+### HTTP Proxy
+
+Some users will need to define an HTTP proxy for communicating with the Kubernetes API. Use this setting to do so.
+
+### Prometheus
+
+Lens can be configured to query a Prometheus server installed in the cluster. Select a query format by choosing either to auto-detect or from the following configurations:
+
+* Lens
+* Helm Operator
+* Prometheus Operator
+* Stacklight
+
+To learn more about custom Prometheus configurations, please refer to this [guide](https://github.com/lensapp/lens/blob/master/troubleshooting/custom-prometheus.md).
+
+### Working Directory
+
+Use this field to set the terminal working directory. The default is `$HOME`.
+
+
+
+## Features
+
+Additional Lens features that can be installed by the user
+
+### Metrics
+
+Enable timeseries data visualization (Prometheus stack) for your cluster. Install this only if you don't have existing Prometheus stack installed.
+
+### User Mode
+
+User Mode feature enables non-admin users to see namespaces they have access to. This is achieved by configuring RBAC rules so that every authenticated user is granted to list namespaces.
+
+
+
+## Removal
+
+Use this setting to remove the current cluster.
+
+
diff --git a/docs/contributing/README.md b/docs/contributing/README.md
new file mode 100644
index 0000000000..6cf7053fb8
--- /dev/null
+++ b/docs/contributing/README.md
@@ -0,0 +1,17 @@
+# Contributing
+
+There are multiple ways you can contribute to Lens. Even if you are not a developer, you can still contribute. We are always looking for assistance with creating or updating documentation, testing the application, reporting, and troubleshooting issues.
+
+Here are some ways you can contribute!
+
+* [Development](./development.md) – Help make Lens better.
+* [Maintaining the Project](./maintainers.md) – Become a community maintainer and help us maintain the project.
+* [Extension Development](../extensions) – Add integrations via Lens Extensions.
+* [Documentation](./documentation.md) – Help improve Lens documentation.
+* [Promotion](./promotion.md) – Show your support, be an ambassador to Lens, write blogs, and make videos!
+
+If you are an influencer, blogger, or journalist, feel free to [spread the word](./promotion.md)!
+
+## Code of Conduct
+
+This project adheres to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct. By participating and contributing to Lens, you are expected to uphold this code. Please report unacceptable behaviour to info@k8slens.dev.
diff --git a/docs/contributing/development.md b/docs/contributing/development.md
new file mode 100644
index 0000000000..89a9b898cd
--- /dev/null
+++ b/docs/contributing/development.md
@@ -0,0 +1,43 @@
+# Development
+
+Thank you for taking the time to make a contribution to Lens. The following document is a set of guidelines and instructions for contributing to Lens.
+
+When contributing to this repository, please consider first discussing the change you wish to make by opening an issue.
+
+## Recommended Reading:
+
+- [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)
+
+## Local Development Environment
+
+> Prerequisites: Nodejs v12, make, yarn
+
+* `make dev` - builds and starts the app
+* `make clean` - cleanup local environment build artifacts
+
+### Developing on Windows
+
+On Windows we only support [Git Bash](https://gitforwindows.org/) (or similar shell) for running commands.
+
+## Github Workflow
+
+We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), so all code changes are tracked via Pull Requests.
+A detailed guide on the recommended workflow can be found below:
+
+* [Github Workflow](./github_workflow.md)
+
+## Code Testing
+
+All submitted PRs go through a set of tests and reviews. You can run most of these tests *before* a PR is submitted.
+In fact, we recommend it, because it will save on many possible review iterations and automated tests.
+The testing guidelines can be found here:
+
+* [Contributor's Guide to Testing](./testing.md)
+
+## License
+
+By contributing, you agree that your contributions will be licensed as described in [LICENSE](https://github.com/lensapp/lens/blob/master/LICENSE).
diff --git a/docs/contributing/documentation.md b/docs/contributing/documentation.md
new file mode 100644
index 0000000000..501c57779f
--- /dev/null
+++ b/docs/contributing/documentation.md
@@ -0,0 +1,33 @@
+# Documentation
+
+We are glad to see you're interested in contributing to the Lens documentation. If this is the first Open Source project you've contributed to, we strongly suggest reading GitHub's excellent guide: [How to Contribute to Open Source](https://opensource.guide/how-to-contribute).
+
+## Finding Documentation Issues to Work On
+
+You can find a list of open documentation-related issues [here](https://github.com/lensapp/lens/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Fdocumentation). When you find something you would like to work on:
+
+1. Express your interest to start working on an issue via comments.
+2. One of the maintainers will assign the issue for you.
+3. You can start working on the issue. When you're done, simply submit a pull request.
+
+## Requirements for Documentation Pull Requests
+
+When you create a new pull request, we expect some requirements to be met.
+
+* Follow this naming convention for Pull Requests:
+ * When adding new documentation, add `New Documentation:` before the title. E.g. `New Documentation: Getting Started`
+ * When fixing documentation, add `Fix Documentation:` before the title. E.g. `Fix Documentation: Getting Started`
+ * When updating documentation, add `Update Documentation:` before the title. E.g. `Update Documentation: Getting Started`
+* If your Pull Request closes an issue, you must write `Closes #ISSUE_NUMBER` where the ISSUE_NUMBER is the number in the end of the link url or the relevent issue. This will link your pull request to the issue, and when it is merged, the issue will close.
+* For each pull request made, we run tests to check if there are any broken links, the markdown formatting is valid, and the linter is passing.
+
+
+## Testing Documentation Site Locally
+
+Run a local instance of `mkdocs` in a docker container for developing the Lens Documentation.
+
+> Prerequisites: docker, yarn
+
+* `make docs` - local build and serve of mkdocs with auto update enabled
+
+Go to [localhost:8000](http://127.0.0.1:8000).
diff --git a/docs/contributing/github_workflow.md b/docs/contributing/github_workflow.md
new file mode 100644
index 0000000000..3509645b47
--- /dev/null
+++ b/docs/contributing/github_workflow.md
@@ -0,0 +1,148 @@
+# Github Workflow
+
+
+- [Fork The Project](#fork-the-project)
+- [Adding the Forked Remote](#adding-the-forked-remote)
+- [Create & Rebase Your Feature Branch](#create--rebase-your-feature-branch)
+- [Commit & Push](#commit--push)
+- [Open a Pull Request](#open-a-pull-request)
+ - [Get a code review](#get-a-code-review)
+ - [Squash commits](#squash-commits)
+ - [Push Your Final Changes](#push-your-final-changes)
+
+
+This guide assumes you have already cloned the upstream repo to your system via git clone.
+
+## Fork The Project
+
+1. Go to [http://github.com/lensapp/lens](http://github.com/lensapp/lens)
+2. On the top, right-hand side, click on "fork" and select your username for the fork destination.
+
+## Adding the Forked Remote
+
+```
+export GITHUB_USER={ your github's username }
+
+cd $WORKDIR/lens
+git remote add $GITHUB_USER git@github.com:${GITHUB_USER}/lens.git
+
+# Prevent push to Upstream
+git remote set-url --push origin no_push
+
+# Set your fork remote as a default push target
+git push --set-upstream $GITHUB_USER master
+```
+
+Your remotes should look something like this:
+
+```
+➜ git remote -v
+origin https://github.com/lensapp/lens (fetch)
+origin no_push (push)
+my_fork git@github.com:{ github_username }/lens.git (fetch)
+my_fork git@github.com:{ github_username }/lens.git (push)
+```
+
+## Create & Rebase Your Feature Branch
+
+Create a feature branch:
+
+```
+git branch -b my_feature_branch
+```
+
+Rebase your branch:
+
+```
+git fetch origin
+
+git rebase origin/master
+Current branch my_feature_branch is up to date.
+```
+
+Please don't use `git pull` instead of the above `fetch / rebase`. `git pull` does a merge, which leaves merge commits. These make the commit history messy and violate the principle that commits ought to be individually understandable and useful.
+
+## Commit & Push
+
+Commit and sign your changes:
+
+```
+git commit -m "my commit title" --signoff
+```
+
+You can go back and edit/build/test some more, then `commit --amend` in a few cycles.
+
+When ready, push your changes to your fork's repository:
+
+```
+git push --set-upstream my_fork my_feature_branch
+```
+
+## Open a Pull Request
+
+See [Github Docs](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).
+
+### Get a code review
+
+Once your pull request has been opened it will be assigned to one or more reviewers, and will go through a series of smoke tests.
+
+Commit changes made in response to review comments should be added to the same branch on your fork.
+
+Very small PRs are easy to review. Very large PRs are very difficult to review.
+
+### Squashing Commits
+Commits on your branch should represent meaningful milestones or units of work.
+Small commits that contain typo fixes, rebases, review feedbacks, etc should be squashed.
+
+To do that, it's best to perform an [interactive rebase](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History):
+
+#### Example
+If you PR has 3 commits, count backwards from your last commit using `HEAD~3`:
+```
+git rebase -i HEAD~3
+```
+Output would be similar to this:
+```
+pick f7f3f6d Changed some code
+pick 310154e fixed some typos
+pick a5f4a0d made some review changes
+
+# Rebase 710f0f8..a5f4a0d onto 710f0f8
+#
+# Commands:
+# p, pick = use commit
+# r, reword = use commit, but edit the commit message
+# e, edit = use commit, but stop for amending
+# s, squash = use commit, but meld into previous commit
+# f, fixup = like "squash", but discard this commit's log message
+# x, exec = run command (the rest of the line) using shell
+# b, break = stop here (continue rebase later with 'git rebase --continue')
+# d, drop = remove commit
+# l, label