Allow to import app as a library (#6722)

* unify build fs layout

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* use currentApp path for static files

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* lint fix

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* allow to import open-lens

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* allow to customize both main & renderer

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix compile-library script

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* remove bundled extensions

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* similar interface for both main & renderer

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* use startApp on both sides

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix startApp import

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix startApp import

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* Fix injection cycle (somehow)

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

* use cwd in download_binaries

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* introduce applicationInformationToken

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* register applicationInformationInjectable in main & renderer

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* allow to define bundled extensions via appStart

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* compile node-fetch automatically via prepare

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* define peerDependencies

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* webpack fixes

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* rename application-information-token.injectable.ts -> application-information-token.ts

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* monaco-editor as externals

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* refactor application-information

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* introduce bundledExtensionInjectionToken

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* mark library exports as experimental

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* move extension npm package files & add release automation

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* add missing build files to package

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix bad merge conflict resolve

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix package.json name

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* allow to set mode via startApp

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* revert unnecessary changes

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* webpack: fix extensionOutDir

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* remove unnecessary peerDependencies

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* introduce nodeEnvInjectionToken

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* remove NODE_ENV from environmentVariablesInjectable

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix jest modulePathIgnorePatterns

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix duplicate injectable registration

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix build executableName

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Jari KolehmainenandSebastian Malton authored and GitHub committed 2022-12-23 13:33:35 +02:00
1 parent ba908c860d
commit 97551bb7f0
57 files changed
+712 -263

No files matched your search

+70 -11
View File
@@ -1,16 +1,51 @@
{
"name": "open-lens",
"name": "@k8slens/open-lens",
"productName": "OpenLens",
"description": "OpenLens - Open Source IDE for Kubernetes",
"homepage": "https://github.com/lensapp/lens",
"version": "6.4.0-alpha.0",
"repository": {
"type": "git",
"url": "git+https://github.com/lensapp/lens.git"
},
"keywords": [],
"bugs": {
"url": "https://github.com/lensapp/lens/issues"
},
"main": "static/build/main.js",
"exports": {
"./main": "./static/build/library/main.js",
"./renderer": "./static/build/library/renderer.js",
"./common": "./static/build/library/common.js",
"./styles": "./static/build/library/renderer.css"
},
"typesVersions": {
"*": {
"main": [
"./src/main/library.ts"
],
"renderer": [
"./src/renderer/library.ts"
],
"common": [
"./src/common/library.ts"
]
}
},
"files": [
"build/download_binaries.ts",
"build/*.plist",
"build/installer.nsh",
"build/notarize.js",
"src/**/*",
"static/build/library/**/*",
"templates/**/*",
"types/*",
"tsconfig.json"
],
"copyright": "© 2022 OpenLens Authors",
"license": "MIT",
"author": {
"name": "OpenLens Authors",
"email": "info@k8slens.dev"
},
"author": "OpenLens Authors <info@k8slens.dev>",
"scripts": {
"adr:create": "echo \"What is the title?\"; read title; adr new \"$title\"",
"adr:change-status": "echo \"Decision number?:\"; read decision; adr status $decision",
@@ -22,13 +57,14 @@
"dev-run": "nodemon --watch ./static/build/main.js --exec \"electron --remote-debugging-port=9223 --inspect .\"",
"dev:main": "yarn run compile:main --watch --progress",
"dev:renderer": "yarn run ts-node webpack/dev-server.ts",
"compile-library": "env NODE_ENV=production yarn run webpack --config webpack/library-bundle.ts",
"compile": "env NODE_ENV=production concurrently yarn:compile:*",
"compile:main": "yarn run webpack --config webpack/main.ts",
"compile:renderer": "yarn run webpack --config webpack/renderer.ts",
"compile:extension-types": "yarn run webpack --config webpack/extensions.ts",
"compile:node-fetch": "yarn run webpack --config ./webpack/node-fetch.ts",
"postinstall": "yarn run compile:node-fetch",
"npm:fix-package-version": "yarn run ts-node build/set_npm_version.ts",
"prepare": "yarn run compile:node-fetch",
"npm:fix-extensions-package-version": "yarn run ts-node build/set_extensions_npm_version.ts",
"build:linux": "yarn run compile && electron-builder --linux --dir",
"build:mac": "yarn run compile && electron-builder --mac --dir",
"build:win": "yarn run compile && electron-builder --win --dir",
@@ -79,7 +115,7 @@
},
"modulePathIgnorePatterns": [
"<rootDir>/dist",
"<rootDir>/src/extensions/npm"
"<rootDir>/packages"
],
"setupFiles": [
"<rootDir>/src/jest.setup.ts",
@@ -106,6 +142,7 @@
"LICENSE"
],
"linux": {
"executableName": "open-lens",
"category": "Network",
"artifactName": "${productName}-${version}.${arch}.${ext}",
"target": [
@@ -134,6 +171,7 @@
]
},
"mac": {
"executableName": "OpenLens",
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "build/entitlements.mac.plist",
@@ -154,6 +192,7 @@
]
},
"win": {
"executableName": "OpenLens.exe",
"target": [
"nsis"
],
@@ -204,7 +243,6 @@
"@sentry/electron": "^3.0.8",
"@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",
"await-lock": "^2.2.2",
@@ -238,8 +276,6 @@
"mock-fs": "^5.2.0",
"moment": "^2.29.4",
"moment-timezone": "^0.5.40",
"monaco-editor": "^0.29.1",
"monaco-editor-webpack-plugin": "^5.0.0",
"node-fetch": "^3.3.0",
"node-pty": "0.10.1",
"npm": "^8.19.3",
@@ -375,6 +411,8 @@
"memorystream": "^0.3.1",
"mini-css-extract-plugin": "^2.7.2",
"mock-http": "^1.1.0",
"monaco-editor": "^0.29.1",
"monaco-editor-webpack-plugin": "^5.0.0",
"node-gyp": "^8.3.0",
"node-loader": "^2.0.0",
"nodemon": "^2.0.20",
@@ -411,5 +449,26 @@
"webpack-node-externals": "^3.0.0",
"xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0"
},
"peerDependencies": {
"@types/byline": "^4.2.33",
"@types/chart.js": "^2.9.36",
"@types/color": "^3.0.3",
"@types/crypto-js": "^3.1.47",
"@types/lodash": "^4.14.191",
"@types/proper-lockfile": "^4.1.2",
"@types/react-dom": "^17.0.16",
"@types/react-router-dom": "^5.3.3",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/request-promise-native": "^1.0.18",
"@types/tar": "^6.1.3",
"@types/tcp-port-used": "^1.0.1",
"@types/url-parse": "^1.4.8",
"@types/uuid": "^8.3.4",
"monaco-editor": "^0.29.1",
"react-select": "^5.7.0",
"typed-emitter": "^1.4.0",
"xterm-addon-fit": "^0.5.0"
}
}