mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix building docs and verify:docs workflow (#7013)
* Fix building docs and verify:docs workflow Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix commands Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
2afc62c296
commit
20c0fd912f
3
.github/workflows/check-docs.yml
vendored
3
.github/workflows/check-docs.yml
vendored
@ -1,7 +1,8 @@
|
|||||||
name: Check Documentation
|
name: Check Documentation
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, labeled, unlabeled, synchronize]
|
branches:
|
||||||
|
- "**"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Check Docs
|
name: Check Docs
|
||||||
|
|||||||
5
nx.json
5
nx.json
@ -17,6 +17,11 @@
|
|||||||
"^build"
|
"^build"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"build:docs": {
|
||||||
|
"dependsOn": [
|
||||||
|
"^build"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"prepare:dev"
|
"prepare:dev"
|
||||||
|
|||||||
@ -51,10 +51,16 @@ export abstract class BaseStore<T extends object> {
|
|||||||
|
|
||||||
readonly displayName = kebabCase(this.params.configName).toUpperCase();
|
readonly displayName = kebabCase(this.params.configName).toUpperCase();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
protected readonly dependencies: BaseStoreDependencies;
|
||||||
|
|
||||||
protected constructor(
|
protected constructor(
|
||||||
protected readonly dependencies: BaseStoreDependencies,
|
dependencies: BaseStoreDependencies,
|
||||||
protected readonly params: BaseStoreParams<T>,
|
protected readonly params: BaseStoreParams<T>,
|
||||||
) {
|
) {
|
||||||
|
this.dependencies = dependencies;
|
||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import type { CatalogEntityMetadata, CatalogEntitySpec, CatalogEntityStatus } fr
|
|||||||
import type { CatalogEntityActionContext } from "../catalog/catalog-entity";
|
import type { CatalogEntityActionContext } from "../catalog/catalog-entity";
|
||||||
import { CatalogCategory, CatalogEntity, categoryVersion } from "../catalog/catalog-entity";
|
import { CatalogCategory, CatalogEntity, categoryVersion } from "../catalog/catalog-entity";
|
||||||
|
|
||||||
interface GeneralEntitySpec extends CatalogEntitySpec {
|
export interface GeneralEntitySpec extends CatalogEntitySpec {
|
||||||
path: string;
|
path: string;
|
||||||
icon?: {
|
icon?: {
|
||||||
material?: string;
|
material?: string;
|
||||||
|
|||||||
@ -9,7 +9,9 @@ import { observable, makeObservable } from "mobx";
|
|||||||
import { once } from "lodash";
|
import { once } from "lodash";
|
||||||
import type { Disposer } from "../utils";
|
import type { Disposer } from "../utils";
|
||||||
import { iter } from "../utils";
|
import { iter } from "../utils";
|
||||||
import type { CategoryColumnRegistration } from "../../renderer/components/+catalog/custom-category-columns";
|
import type { CategoryColumnRegistration, TitleCellProps } from "../../renderer/components/+catalog/custom-category-columns";
|
||||||
|
|
||||||
|
export type { CategoryColumnRegistration, TitleCellProps };
|
||||||
|
|
||||||
export type CatalogEntityDataFor<Entity> = Entity extends CatalogEntity<infer Metadata, infer Status, infer Spec>
|
export type CatalogEntityDataFor<Entity> = Entity extends CatalogEntity<infer Metadata, infer Status, infer Spec>
|
||||||
? CatalogEntityData<Metadata, Status, Spec>
|
? CatalogEntityData<Metadata, Status, Spec>
|
||||||
|
|||||||
@ -5,23 +5,23 @@
|
|||||||
|
|
||||||
// Custom event emitter
|
// Custom event emitter
|
||||||
|
|
||||||
interface Options {
|
export interface EventEmitterOptions {
|
||||||
once?: boolean; // call once and remove
|
once?: boolean; // call once and remove
|
||||||
prepend?: boolean; // put listener to the beginning
|
prepend?: boolean; // put listener to the beginning
|
||||||
}
|
}
|
||||||
|
|
||||||
type Callback<D extends [...any[]]> = (...data: D) => void | boolean;
|
export type EventEmitterCallback<D extends any[]> = (...data: D) => void | boolean;
|
||||||
|
|
||||||
export class EventEmitter<D extends [...any[]]> {
|
export class EventEmitter<D extends any[]> {
|
||||||
protected listeners: [Callback<D>, Options][] = [];
|
protected listeners: [EventEmitterCallback<D>, EventEmitterOptions][] = [];
|
||||||
|
|
||||||
addListener(callback: Callback<D>, options: Options = {}) {
|
addListener(callback: EventEmitterCallback<D>, options: EventEmitterOptions = {}) {
|
||||||
const fn = options.prepend ? "unshift" : "push";
|
const fn = options.prepend ? "unshift" : "push";
|
||||||
|
|
||||||
this.listeners[fn]([callback, options]);
|
this.listeners[fn]([callback, options]);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeListener(callback: Callback<D>) {
|
removeListener(callback: EventEmitterCallback<D>) {
|
||||||
this.listeners = this.listeners.filter(([cb]) => cb !== callback);
|
this.listeners = this.listeners.filter(([cb]) => cb !== callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,26 +11,17 @@ import isWindowsInjectable from "../../common/vars/is-windows.injectable";
|
|||||||
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||||
import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||||
import getEnabledExtensionsInjectable from "./get-enabled-extensions/get-enabled-extensions.injectable";
|
import getEnabledExtensionsInjectable from "./get-enabled-extensions/get-enabled-extensions.injectable";
|
||||||
import type { UserPreferenceExtensionItems } from "./user-preferences";
|
|
||||||
import { Preferences } from "./user-preferences";
|
|
||||||
import { slackUrl, issuesTrackerUrl } from "../../common/vars";
|
import { slackUrl, issuesTrackerUrl } from "../../common/vars";
|
||||||
import { buildVersionInjectionToken } from "../../common/vars/build-semantic-version.injectable";
|
import { buildVersionInjectionToken } from "../../common/vars/build-semantic-version.injectable";
|
||||||
|
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||||
|
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||||
|
|
||||||
export interface AppExtensionItems {
|
const userStore = asLegacyGlobalForExtensionApi(userStoreInjectable);
|
||||||
readonly Preferences: UserPreferenceExtensionItems;
|
|
||||||
readonly version: string;
|
|
||||||
readonly appName: string;
|
|
||||||
readonly slackUrl: string;
|
|
||||||
readonly issuesTrackerUrl: string;
|
|
||||||
readonly isSnap: boolean;
|
|
||||||
readonly isWindows: boolean;
|
|
||||||
readonly isMac: boolean;
|
|
||||||
readonly isLinux: boolean;
|
|
||||||
getEnabledExtensions: () => string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const App: AppExtensionItems = {
|
export const App = {
|
||||||
Preferences,
|
Preferences: {
|
||||||
|
getKubectlPath: () => userStore.kubectlBinariesPath,
|
||||||
|
},
|
||||||
getEnabledExtensions: asLegacyGlobalFunctionForExtensionApi(getEnabledExtensionsInjectable),
|
getEnabledExtensions: asLegacyGlobalFunctionForExtensionApi(getEnabledExtensionsInjectable),
|
||||||
get version() {
|
get version() {
|
||||||
const di = getLegacyGlobalDiForExtensionApi();
|
const di = getLegacyGlobalDiForExtensionApi();
|
||||||
@ -64,4 +55,4 @@ export const App: AppExtensionItems = {
|
|||||||
},
|
},
|
||||||
slackUrl,
|
slackUrl,
|
||||||
issuesTrackerUrl,
|
issuesTrackerUrl,
|
||||||
};
|
} as const;
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { KubernetesClusterCategory } from "../../common/catalog-entities/kubernetes-cluster";
|
||||||
import kubernetesClusterCategoryInjectable from "../../common/catalog/categories/kubernetes-cluster.injectable";
|
import kubernetesClusterCategoryInjectable from "../../common/catalog/categories/kubernetes-cluster.injectable";
|
||||||
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||||
|
|
||||||
@ -12,6 +13,10 @@ export {
|
|||||||
WebLink,
|
WebLink,
|
||||||
} from "../../common/catalog-entities";
|
} from "../../common/catalog-entities";
|
||||||
|
|
||||||
|
export type {
|
||||||
|
KubernetesClusterCategory,
|
||||||
|
};
|
||||||
|
|
||||||
export const kubernetesClusterCategory = asLegacyGlobalForExtensionApi(kubernetesClusterCategoryInjectable);
|
export const kubernetesClusterCategory = asLegacyGlobalForExtensionApi(kubernetesClusterCategoryInjectable);
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
@ -23,6 +28,7 @@ export type {
|
|||||||
WebLinkStatusPhase,
|
WebLinkStatusPhase,
|
||||||
KubernetesClusterStatusPhase,
|
KubernetesClusterStatusPhase,
|
||||||
KubernetesClusterStatus,
|
KubernetesClusterStatus,
|
||||||
|
GeneralEntitySpec,
|
||||||
} from "../../common/catalog-entities";
|
} from "../../common/catalog-entities";
|
||||||
|
|
||||||
export * from "../../common/catalog/catalog-entity";
|
export * from "../../common/catalog/catalog-entity";
|
||||||
|
|||||||
@ -5,7 +5,14 @@
|
|||||||
|
|
||||||
import appEventBusInjectable from "../../common/app-event-bus/app-event-bus.injectable";
|
import appEventBusInjectable from "../../common/app-event-bus/app-event-bus.injectable";
|
||||||
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||||
|
import type { AppEvent } from "../../common/app-event-bus/event-bus";
|
||||||
|
import type { EventEmitter, EventEmitterCallback, EventEmitterOptions } from "../../common/event-emitter";
|
||||||
|
|
||||||
export type { AppEvent } from "../../common/app-event-bus/event-bus";
|
export type {
|
||||||
|
AppEvent,
|
||||||
|
EventEmitter,
|
||||||
|
EventEmitterCallback,
|
||||||
|
EventEmitterOptions,
|
||||||
|
};
|
||||||
|
|
||||||
export const appEventBus = asLegacyGlobalForExtensionApi(appEventBusInjectable);
|
export const appEventBus = asLegacyGlobalForExtensionApi(appEventBusInjectable);
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import * as Types from "./types";
|
|||||||
import * as Proxy from "./proxy";
|
import * as Proxy from "./proxy";
|
||||||
import loggerInjectable from "../../common/logger.injectable";
|
import loggerInjectable from "../../common/logger.injectable";
|
||||||
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||||
|
import type { Logger } from "../../common/logger";
|
||||||
|
import type { LensExtension, LensExtensionManifest } from "../lens-extension";
|
||||||
|
|
||||||
const logger = asLegacyGlobalForExtensionApi(loggerInjectable);
|
const logger = asLegacyGlobalForExtensionApi(loggerInjectable);
|
||||||
|
|
||||||
@ -25,4 +27,7 @@ export {
|
|||||||
Util,
|
Util,
|
||||||
logger,
|
logger,
|
||||||
Proxy,
|
Proxy,
|
||||||
|
Logger,
|
||||||
|
LensExtension,
|
||||||
|
LensExtensionManifest,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,4 +3,10 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { ExtensionStore } from "../extension-store";
|
import type { BaseStoreParams } from "../../common/base-store/base-store";
|
||||||
|
import { ExtensionStore } from "../extension-store";
|
||||||
|
|
||||||
|
export {
|
||||||
|
BaseStoreParams,
|
||||||
|
ExtensionStore,
|
||||||
|
};
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
|
||||||
import { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
|
||||||
export interface UserPreferenceExtensionItems {
|
|
||||||
/**
|
|
||||||
* Get the configured kubectl binaries path.
|
|
||||||
*/
|
|
||||||
getKubectlPath: () => string | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const userStore = asLegacyGlobalForExtensionApi(userStoreInjectable);
|
|
||||||
|
|
||||||
export const Preferences: UserPreferenceExtensionItems = {
|
|
||||||
getKubectlPath: () => userStore.kubectlBinariesPath,
|
|
||||||
};
|
|
||||||
@ -9,20 +9,9 @@ import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-
|
|||||||
import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
import { getLegacyGlobalDiForExtensionApi } from "../as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||||
import { Singleton } from "../../common/utils";
|
import { Singleton } from "../../common/utils";
|
||||||
import { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
|
import { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
|
||||||
import type { IClassName } from "../../renderer/utils/cssNames";
|
|
||||||
import { cssNames } from "../../renderer/utils/cssNames";
|
import { cssNames } from "../../renderer/utils/cssNames";
|
||||||
|
|
||||||
export interface UtilsExtensionItems {
|
export const Util = {
|
||||||
Singleton: typeof Singleton;
|
|
||||||
prevDefault: <E extends React.SyntheticEvent | Event, R>(callback: (evt: E) => R) => (evt: E) => R;
|
|
||||||
stopPropagation: (evt: Event | React.SyntheticEvent) => void;
|
|
||||||
cssNames: (...classNames: IClassName[]) => string;
|
|
||||||
openExternal: (url: string) => Promise<void>;
|
|
||||||
openBrowser: (url: string) => Promise<void>;
|
|
||||||
getAppVersion: () => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Util: UtilsExtensionItems = {
|
|
||||||
Singleton,
|
Singleton,
|
||||||
prevDefault,
|
prevDefault,
|
||||||
stopPropagation,
|
stopPropagation,
|
||||||
@ -34,4 +23,4 @@ export const Util: UtilsExtensionItems = {
|
|||||||
|
|
||||||
return di.inject(buildVersionInjectable).get();
|
return di.inject(buildVersionInjectable).get();
|
||||||
},
|
},
|
||||||
};
|
} as const;
|
||||||
|
|||||||
@ -32,7 +32,12 @@ export interface LensExtensionManifest extends PackageJson {
|
|||||||
export const lensExtensionDependencies = Symbol("lens-extension-dependencies");
|
export const lensExtensionDependencies = Symbol("lens-extension-dependencies");
|
||||||
export const Disposers = Symbol("disposers");
|
export const Disposers = Symbol("disposers");
|
||||||
|
|
||||||
export class LensExtension<Dependencies extends LensExtensionDependencies = LensExtensionDependencies> {
|
export class LensExtension<
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
Dependencies extends LensExtensionDependencies = LensExtensionDependencies,
|
||||||
|
> {
|
||||||
readonly id: LensExtensionId;
|
readonly id: LensExtensionId;
|
||||||
readonly manifest: LensExtensionManifest;
|
readonly manifest: LensExtensionManifest;
|
||||||
readonly manifestPath: string;
|
readonly manifestPath: string;
|
||||||
@ -50,6 +55,9 @@ export class LensExtension<Dependencies extends LensExtensionDependencies = Lens
|
|||||||
return this._isEnabled;
|
return this._isEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
[Disposers] = disposer();
|
[Disposers] = disposer();
|
||||||
|
|
||||||
constructor({ id, manifest, manifestPath, isBundled }: InstalledExtension) {
|
constructor({ id, manifest, manifestPath, isBundled }: InstalledExtension) {
|
||||||
@ -72,6 +80,9 @@ export class LensExtension<Dependencies extends LensExtensionDependencies = Lens
|
|||||||
return this.manifest.description;
|
return this.manifest.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
readonly [lensExtensionDependencies]!: Dependencies;
|
readonly [lensExtensionDependencies]!: Dependencies;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -19,6 +19,10 @@ const LensExtensions = {
|
|||||||
Main: LensExtensionsMainApi,
|
Main: LensExtensionsMainApi,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type {
|
||||||
|
LensExtensionsMainApi,
|
||||||
|
};
|
||||||
|
|
||||||
const Pty = {
|
const Pty = {
|
||||||
spawn,
|
spawn,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import * as extensionApi from "./extension-api";
|
|||||||
import { createApp } from "./create-app";
|
import { createApp } from "./create-app";
|
||||||
|
|
||||||
// @experimental
|
// @experimental
|
||||||
export {
|
export {
|
||||||
createApp,
|
createApp,
|
||||||
extensionApi,
|
extensionApi,
|
||||||
afterApplicationIsLoadedInjectionToken,
|
afterApplicationIsLoadedInjectionToken,
|
||||||
|
|||||||
@ -22,6 +22,10 @@ const LensExtensions = {
|
|||||||
Renderer: LensExtensionsRendererApi,
|
Renderer: LensExtensionsRendererApi,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type {
|
||||||
|
LensExtensionsRendererApi,
|
||||||
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
React,
|
React,
|
||||||
ReactDOM,
|
ReactDOM,
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn run webpack --config webpack/extensions.ts",
|
"build": "yarn run webpack --config webpack/extensions.ts",
|
||||||
"build-docs": "yarn run typedoc",
|
"build:docs": "yarn run typedoc",
|
||||||
"clean": "rm -rf dist/",
|
"clean": "rm -rf dist/",
|
||||||
"prepare:dev": "yarn run build"
|
"prepare:dev": "yarn run build"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,16 +3,8 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { extensionApi as main } from "@k8slens/core/main";
|
import { extensionApi as Main } from "@k8slens/core/main";
|
||||||
import { extensionApi as renderer } from "@k8slens/core/renderer";
|
import { extensionApi as Renderer } from "@k8slens/core/renderer";
|
||||||
import { extensionApi as common } from "@k8slens/core/common";
|
import { extensionApi as Common } from "@k8slens/core/common";
|
||||||
|
|
||||||
const Main = { ... main } as typeof main;
|
export { Main, Renderer, Common };
|
||||||
const Renderer = { ...renderer } as typeof renderer;
|
|
||||||
const Common = { ... common } as typeof common;
|
|
||||||
|
|
||||||
export {
|
|
||||||
Main,
|
|
||||||
Renderer,
|
|
||||||
Common,
|
|
||||||
};
|
|
||||||
|
|||||||
@ -4,11 +4,9 @@
|
|||||||
"out": "../../docs/extensions/api",
|
"out": "../../docs/extensions/api",
|
||||||
"excludePrivate": true,
|
"excludePrivate": true,
|
||||||
"entryPointStrategy": "expand",
|
"entryPointStrategy": "expand",
|
||||||
|
"excludeExternals": true,
|
||||||
"entryPoints": [
|
"entryPoints": [
|
||||||
"src/extension-api.ts",
|
"src/extension-api.ts",
|
||||||
"../core/src/common/library.ts",
|
|
||||||
"../core/src/main/library.ts",
|
|
||||||
"../core/src/renderer/library.ts"
|
|
||||||
],
|
],
|
||||||
"hideBreadcrumbs": true,
|
"hideBreadcrumbs": true,
|
||||||
"disableSources": true,
|
"disableSources": true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user