mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix crashes with usages of @k8slens/core/common
- Only observable with extensions Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
5002b450fd
commit
7c18c2a23b
@ -20,7 +20,6 @@
|
||||
"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": {
|
||||
@ -30,9 +29,6 @@
|
||||
],
|
||||
"renderer": [
|
||||
"./static/build/library/src/renderer/library.d.ts"
|
||||
],
|
||||
"common": [
|
||||
"./static/build/library/src/common/library.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
// @experimental
|
||||
export { applicationInformationToken } from "./vars/application-information-token";
|
||||
export type { ApplicationInformation } from "./vars/application-information-token";
|
||||
export { bundledExtensionInjectionToken } from "../extensions/extension-discovery/bundled-extension-token";
|
||||
|
||||
export * as extensionApi from "../extensions/common-api";
|
||||
@ -9,6 +9,11 @@ export { beforeApplicationIsLoadingInjectionToken } from "./start-main-applicati
|
||||
export { beforeElectronIsReadyInjectionToken } from "./start-main-application/runnable-tokens/before-electron-is-ready-injection-token";
|
||||
export { onLoadOfApplicationInjectionToken } from "./start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
||||
export { createApp } from "./create-app";
|
||||
export { applicationInformationToken } from "../common/vars/application-information-token";
|
||||
export type { ApplicationInformation } from "../common/vars/application-information-token";
|
||||
export { bundledExtensionInjectionToken } from "../extensions/extension-discovery/bundled-extension-token";
|
||||
|
||||
export * as Mobx from "mobx";
|
||||
export * as extensionApi from "../extensions/main-api";
|
||||
export * as Pty from "node-pty";
|
||||
export * as extensionApi from "../extensions/main-api";
|
||||
export * as commonExtensionApi from "../extensions/common-api";
|
||||
|
||||
@ -7,10 +7,16 @@ import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
|
||||
// @experimental
|
||||
export { createApp } from "./create-app";
|
||||
export { applicationInformationToken } from "../common/vars/application-information-token";
|
||||
export type { ApplicationInformation } from "../common/vars/application-information-token";
|
||||
export { bundledExtensionInjectionToken } from "../extensions/extension-discovery/bundled-extension-token";
|
||||
|
||||
export { React, ReactDOM };
|
||||
export * as Mobx from "mobx";
|
||||
export * as MobxReact from "mobx-react";
|
||||
export * as ReactRouter from "react-router";
|
||||
export * as ReactRouterDom from "react-router-dom";
|
||||
export * as extensionApi from "../extensions/renderer-api";
|
||||
export { createApp } from "./create-app";
|
||||
export * as commonExtensionApi from "../extensions/common-api";
|
||||
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type webpack from "webpack";
|
||||
import path from "path";
|
||||
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
|
||||
import webpackLensMain from "./main";
|
||||
import { buildDir } from "./vars";
|
||||
|
||||
const webpackLensCommon = (): webpack.Configuration => {
|
||||
const mainConfig = webpackLensMain();
|
||||
|
||||
return {
|
||||
...mainConfig,
|
||||
name: "lens-app-common",
|
||||
entry: {
|
||||
common: path.resolve(__dirname, "..", "src", "common", "library.ts"),
|
||||
},
|
||||
output: {
|
||||
publicPath: "",
|
||||
library: {
|
||||
type: "commonjs2",
|
||||
},
|
||||
path: path.resolve(buildDir, "library"),
|
||||
},
|
||||
optimization: {
|
||||
minimize: false,
|
||||
},
|
||||
plugins: [
|
||||
new ForkTsCheckerPlugin({}),
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
export default webpackLensCommon;
|
||||
@ -3,14 +3,12 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import webpackLensCommon from "./common";
|
||||
import webpackLensMain from "./main";
|
||||
import { webpackLensMain } from "./main";
|
||||
import { webpackLensRenderer } from "./renderer";
|
||||
|
||||
const config = [
|
||||
webpackLensMain(),
|
||||
webpackLensRenderer(),
|
||||
webpackLensCommon(),
|
||||
];
|
||||
|
||||
export default config;
|
||||
|
||||
@ -12,8 +12,7 @@ import { DefinePlugin } from "webpack";
|
||||
import { buildDir, isDevelopment } from "./vars";
|
||||
import { platform } from "process";
|
||||
|
||||
const webpackLensMain = (): webpack.Configuration => {
|
||||
return {
|
||||
export const webpackLensMain = (): webpack.Configuration => ({
|
||||
name: "lens-app-main",
|
||||
context: __dirname,
|
||||
target: "electron-main",
|
||||
@ -81,7 +80,4 @@ const webpackLensMain = (): webpack.Configuration => {
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
export default webpackLensMain;
|
||||
});
|
||||
|
||||
@ -3,6 +3,5 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
export { extensionApi as Main } from "@k8slens/core/main";
|
||||
export { extensionApi as Main, commonExtensionApi as Common } from "@k8slens/core/main";
|
||||
export { extensionApi as Renderer } from "@k8slens/core/renderer";
|
||||
export { extensionApi as Common } from "@k8slens/core/common";
|
||||
|
||||
@ -35,7 +35,6 @@ export default function generateExtensionTypes(): webpack.Configuration {
|
||||
],
|
||||
stats: "errors-warnings",
|
||||
externals: [
|
||||
"@k8slens/core/common",
|
||||
"@k8slens/core/main",
|
||||
"@k8slens/core/renderer",
|
||||
],
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { applicationInformationToken, ApplicationInformation } from "@k8slens/core/common";
|
||||
import { applicationInformationToken, ApplicationInformation } from "@k8slens/core/main";
|
||||
import packageJson from "../../package.json";
|
||||
|
||||
const applicationInformationInjectable = getInjectable({
|
||||
@ -1,8 +1,7 @@
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
||||
import { runInAction } from "mobx";
|
||||
import { createApp, extensionApi as Main } from "@k8slens/core/main";
|
||||
import { extensionApi as Common } from "@k8slens/core/common";
|
||||
import { createApp, extensionApi as Main, commonExtensionApi as Common } from "@k8slens/core/main";
|
||||
|
||||
const di = createContainer("main");
|
||||
const app = createApp({
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { applicationInformationToken, ApplicationInformation } from "@k8slens/core/renderer";
|
||||
import packageJson from "../../package.json";
|
||||
|
||||
const applicationInformationInjectable = getInjectable({
|
||||
id: "application-information",
|
||||
injectionToken: applicationInformationToken,
|
||||
instantiate: () => {
|
||||
const { version, config, productName, build, copyright, description, name } = packageJson;
|
||||
|
||||
return { version, config, productName, build, copyright, description, name } as ApplicationInformation;
|
||||
},
|
||||
causesSideEffects: true,
|
||||
});
|
||||
|
||||
export default applicationInformationInjectable;
|
||||
@ -1,8 +1,7 @@
|
||||
import "@k8slens/core/styles";
|
||||
import { createContainer } from "@ogre-tools/injectable";
|
||||
import { runInAction } from "mobx";
|
||||
import { createApp, extensionApi as Renderer } from "@k8slens/core/renderer";
|
||||
import { extensionApi as Common } from "@k8slens/core/common";
|
||||
import { createApp, extensionApi as Renderer, commonExtensionApi as Common } from "@k8slens/core/renderer";
|
||||
import { autoRegister } from "@ogre-tools/injectable-extension-for-auto-registration";
|
||||
|
||||
const di = createContainer("renderer");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user