diff --git a/.swcrc b/.swcrc new file mode 100644 index 0000000000..742642b7eb --- /dev/null +++ b/.swcrc @@ -0,0 +1,18 @@ +{ + "module": { + "type": "commonjs" + }, + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": true, + "decorators": true, + "dynamicImport": false + }, + "transform": { + "legacyDecorator": true, + "decoratorMetadata": true + }, + "target": "es2019" + } +} diff --git a/LICENSE b/LICENSE index 208e7c2e9c..42319c9dae 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021 OpenLens Authors. +Copyright (c) 2022 OpenLens Authors. Portions of this software are licensed as follows: diff --git a/README.md b/README.md index cb9f44b35d..5e97035d0f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Lens IDE a standalone application for MacOS, Windows and Linux operating systems ## Installation -See [Getting Started](https://docs.k8slens.dev/latest/getting-started/) page. +See [Getting Started](https://docs.k8slens.dev/main/getting-started/install-lens/) page. ## Development diff --git a/package.json b/package.json index 6046fd1ac4..39688c6d1d 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "productName": "OpenLens", "description": "OpenLens - Open Source IDE for Kubernetes", "homepage": "https://github.com/lensapp/lens", - "version": "5.6.0-alpha.0", + "version": "5.6.0-alpha.3", "main": "static/build/main.js", - "copyright": "© 2021 OpenLens Authors", + "copyright": "© 2022 OpenLens Authors", "license": "MIT", "author": { "name": "OpenLens Authors", @@ -49,7 +49,8 @@ "k8sProxyVersion": "0.2.1", "bundledKubectlVersion": "1.23.3", "bundledHelmVersion": "3.7.2", - "sentryDsn": "" + "sentryDsn": "", + "contentSecurityPolicy": "script-src 'unsafe-eval' 'self'; frame-src http://*.localhost:*/; img-src * data:" }, "engines": { "node": ">=16 <17" @@ -58,8 +59,12 @@ "collectCoverage": false, "verbose": true, "transform": { - "^.+\\.tsx?$": "ts-jest" + "^.+\\.(t|j)sx?$": [ + "@swc/jest" + ] }, + "testEnvironment": "jsdom", + "resolver": "/src/jest-28-resolver.js", "moduleNameMapper": { "\\.(css|scss)$": "identity-obj-proxy", "\\.(svg|png|jpg|eot|woff2?|ttf)$": "/__mocks__/assetMock.ts" @@ -75,12 +80,7 @@ "setupFilesAfterEnv": [ "/src/jest-after-env.setup.ts" ], - "globals": { - "ts-jest": { - "isolatedModules": true - } - }, - "globalSetup": "/src/jest.timezone.ts" + "runtime": "@side/jest-runtime" }, "build": { "generateUpdatesFilesForAllChannels": true, @@ -204,16 +204,18 @@ }, "dependencies": { "@astronautlabs/jsonpath": "^1.1.0", - "@hapi/call": "^8.0.1", - "@hapi/subtext": "^7.0.3", + "@hapi/call": "^9.0.0", + "@hapi/subtext": "^7.0.4", "@kubernetes/client-node": "^0.16.3", "@material-ui/styles": "^4.11.5", - "@ogre-tools/injectable": "7.0.0", - "@ogre-tools/injectable-react": "7.0.0", - "@ogre-tools/fp": "7.0.0", - "@ogre-tools/injectable-extension-for-auto-registration": "7.0.0", + "@ogre-tools/fp": "9.0.0", + "@ogre-tools/injectable": "9.0.0", + "@ogre-tools/injectable-extension-for-auto-registration": "9.0.0", + "@ogre-tools/injectable-extension-for-mobx": "9.0.0", + "@ogre-tools/injectable-react": "9.0.0", "@sentry/electron": "^3.0.7", "@sentry/integrations": "^6.19.3", + "@side/jest-runtime": "^1.0.1", "@types/circular-dependency-plugin": "5.0.5", "abort-controller": "^3.0.0", "auto-bind": "^4.0.0", @@ -233,15 +235,15 @@ "handlebars": "^4.7.7", "history": "^4.10.1", "http-proxy": "^1.18.1", - "immer": "^9.0.14", + "immer": "^9.0.15", "joi": "^17.6.0", "js-yaml": "^4.1.0", "jsdom": "^16.7.0", "lodash": "^4.17.15", "mac-ca": "^1.0.6", - "marked": "^4.0.16", + "marked": "^4.0.17", "md5-file": "^5.0.0", - "mobx": "^6.5.0", + "mobx": "^6.6.0", "mobx-observable-history": "^2.0.3", "mobx-react": "^7.5.0", "mobx-utils": "^6.0.4", @@ -279,7 +281,7 @@ "winston": "^3.7.2", "winston-console-format": "^1.0.8", "winston-transport-browserconsole": "^1.0.5", - "ws": "^8.7.0" + "ws": "^8.8.0" }, "devDependencies": { "@async-fn/jest": "1.6.1", @@ -288,6 +290,8 @@ "@material-ui/lab": "^4.0.0-alpha.60", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", "@sentry/types": "^6.19.7", + "@swc/core": "^1.2.197", + "@swc/jest": "^0.2.21", "@testing-library/dom": "^7.31.2", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.1.5", @@ -304,9 +308,11 @@ "@types/fs-extra": "^9.0.13", "@types/glob-to-regexp": "^0.4.1", "@types/gunzip-maybe": "^1.4.0", + "@types/hapi__call": "^9.0.0", + "@types/hapi__subtext": "^7.0.0", "@types/html-webpack-plugin": "^3.2.6", "@types/http-proxy": "^1.17.9", - "@types/jest": "^26.0.24", + "@types/jest": "^28.1.1", "@types/js-yaml": "^4.0.5", "@types/jsdom": "^16.2.14", "@types/lodash": "^4.14.181", @@ -314,8 +320,8 @@ "@types/md5-file": "^4.0.2", "@types/mini-css-extract-plugin": "^2.4.0", "@types/mock-fs": "^4.13.1", - "@types/node": "^16.11.39", - "@types/node-fetch": "^2.6.1", + "@types/node": "^16.11.41", + "@types/node-fetch": "^2.6.2", "@types/npm": "^2.0.32", "@types/proper-lockfile": "^4.1.2", "@types/randomcolor": "^0.5.6", @@ -330,8 +336,8 @@ "@types/readable-stream": "^2.3.13", "@types/request": "^2.48.7", "@types/request-promise-native": "^1.0.18", - "@types/semver": "^7.3.9", - "@types/sharp": "^0.30.2", + "@types/semver": "^7.3.10", + "@types/sharp": "^0.30.4", "@types/spdy": "^3.4.5", "@types/tar": "^4.0.5", "@types/tar-stream": "^2.2.2", @@ -344,28 +350,28 @@ "@types/webpack-dev-server": "^4.7.2", "@types/webpack-env": "^1.17.0", "@types/webpack-node-externals": "^2.5.3", - "@typescript-eslint/eslint-plugin": "^5.27.1", - "@typescript-eslint/parser": "^5.27.0", + "@typescript-eslint/eslint-plugin": "^5.28.0", + "@typescript-eslint/parser": "^5.28.0", "ansi_up": "^5.1.0", "chart.js": "^2.9.4", "circular-dependency-plugin": "^5.2.2", "cli-progress": "^3.11.1", "color": "^3.2.1", "command-line-args": "^5.2.1", - "concurrently": "^7.2.1", + "concurrently": "^7.2.2", "css-loader": "^6.7.1", "deepdash": "^5.3.9", "dompurify": "^2.3.8", "electron": "^15.5.7", "electron-builder": "^23.0.3", "electron-notarize": "^0.3.0", - "esbuild": "^0.14.38", + "esbuild": "^0.14.43", "esbuild-loader": "^2.19.0", - "eslint": "^8.16.0", + "eslint": "^8.18.0", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-react": "^7.30.0", - "eslint-plugin-react-hooks": "^4.5.0", + "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-unused-imports": "^2.0.0", "flex.box": "^3.4.4", "fork-ts-checker-webpack-plugin": "^6.5.2", @@ -374,12 +380,13 @@ "identity-obj-proxy": "^3.0.0", "ignore-loader": "^0.1.2", "include-media": "^1.4.9", - "jest": "26.6.3", + "jest": "^28.1.1", "jest-canvas-mock": "^2.3.1", + "jest-environment-jsdom": "^28.1.1", "jest-fetch-mock": "^3.0.3", - "jest-mock-extended": "^1.0.18", + "jest-mock-extended": "^2.0.6", "make-plural": "^6.2.2", - "mini-css-extract-plugin": "^2.6.0", + "mini-css-extract-plugin": "^2.6.1", "mock-http": "^1.1.0", "node-gyp": "7.1.2", "node-loader": "^2.0.0", @@ -396,24 +403,23 @@ "react-select-event": "^5.5.0", "react-table": "^7.8.0", "react-window": "^1.8.7", - "sass": "^1.52.2", + "sass": "^1.52.3", "sass-loader": "^12.6.0", "sharp": "^0.30.6", "style-loader": "^3.3.1", - "tailwindcss": "^3.0.23", + "tailwindcss": "^3.1.4", "tar-stream": "^2.2.0", - "ts-jest": "26.5.6", "ts-loader": "^9.2.8", - "ts-node": "^10.7.0", - "type-fest": "^2.13.0", + "ts-node": "^10.8.1", + "type-fest": "^2.13.1", "typed-emitter": "^1.4.0", "typedoc": "0.22.17", "typedoc-plugin-markdown": "^3.11.12", - "typescript": "^4.5.5", + "typescript": "^4.7.4", "typescript-plugin-css-modules": "^3.4.0", "webpack": "^5.73.0", "webpack-cli": "^4.9.2", - "webpack-dev-server": "^4.9.1", + "webpack-dev-server": "^4.9.2", "webpack-node-externals": "^3.0.0", "xterm": "^4.18.0", "xterm-addon-fit": "^0.5.0" diff --git a/scripts/clear-release-pr.mjs b/scripts/create-release-pr.mjs similarity index 93% rename from scripts/clear-release-pr.mjs rename to scripts/create-release-pr.mjs index 4b55384e61..54b6ed17c5 100755 --- a/scripts/clear-release-pr.mjs +++ b/scripts/create-release-pr.mjs @@ -133,7 +133,8 @@ const relaventPrsQuery = await Promise.all( ); const relaventPrs = relaventPrsQuery .filter(query => query.stdout) - .map(query => query.pr); + .map(query => query.pr) + .filter(pr => pr.labels.every(label => label.name !== "skip-changelog")); const enhancementPrLabelName = "enhancement"; const bugfixPrLabelName = "bug"; @@ -152,11 +153,15 @@ const prBodyLines = [ "", ]; +function getPrEntry(pr) { + return `- ${pr.title} (**[#${pr.number}](https://github.com/lensapp/lens/pull/${pr.number})**) https://github.com/${pr.author.login}`; +} + if (enhancementPrs.length > 0) { prBodyLines.push( "## 🚀 Features", "", - ...enhancementPrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`), + ...enhancementPrs.map(getPrEntry), "", ); } @@ -165,7 +170,7 @@ if (bugfixPrs.length > 0) { prBodyLines.push( "## 🐛 Bug Fixes", "", - ...bugfixPrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`), + ...bugfixPrs.map(getPrEntry), "", ); } @@ -174,7 +179,7 @@ if (maintenencePrs.length > 0) { prBodyLines.push( "## 🧰 Maintenance", "", - ...maintenencePrs.map(pr => `- ${pr.title} (**#${pr.number}**) https://github.com/${pr.author.login}`), + ...maintenencePrs.map(getPrEntry), "", ); } diff --git a/src/behaviours/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap b/src/behaviours/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap index 80b0028469..5a952f701b 100644 --- a/src/behaviours/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap +++ b/src/behaviours/__snapshots__/extension-special-characters-in-page-registrations.test.tsx.snap @@ -2,6 +2,16 @@ exports[`extension special characters in page registrations renders 1`] = `
+
+
+
+
@@ -10,6 +20,16 @@ exports[`extension special characters in page registrations renders 1`] = ` exports[`extension special characters in page registrations when navigating to route with ID having special characters renders 1`] = `
+
+
+
+
Some page
diff --git a/src/behaviours/__snapshots__/navigate-to-extension-page.test.tsx.snap b/src/behaviours/__snapshots__/navigate-to-extension-page.test.tsx.snap index c96763fe6e..f73444ff0e 100644 --- a/src/behaviours/__snapshots__/navigate-to-extension-page.test.tsx.snap +++ b/src/behaviours/__snapshots__/navigate-to-extension-page.test.tsx.snap @@ -2,6 +2,16 @@ exports[`navigate to extension page renders 1`] = `
+
+
+
+
@@ -10,6 +20,16 @@ exports[`navigate to extension page renders 1`] = ` exports[`navigate to extension page when extension navigates to child route renders 1`] = `
+
+
+
+
Child page
@@ -21,6 +41,16 @@ exports[`navigate to extension page when extension navigates to child route rend exports[`navigate to extension page when extension navigates to route with parameters renders 1`] = `
+
+
+
+