mirror of
https://github.com/lensapp/lens.git
synced 2024-09-11 09:25:26 +03: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
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, labeled, unlabeled, synchronize]
|
||||
branches:
|
||||
- "**"
|
||||
jobs:
|
||||
build:
|
||||
name: Check Docs
|
||||
|
5
nx.json
5
nx.json
@ -17,6 +17,11 @@
|
||||
"^build"
|
||||
]
|
||||
},
|
||||
"build:docs": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
]
|
||||
},
|
||||
"dev": {
|
||||
"dependsOn": [
|
||||
"prepare:dev"
|
||||
|
@ -51,10 +51,16 @@ export abstract class BaseStore<T extends object> {
|
||||
|
||||
readonly displayName = kebabCase(this.params.configName).toUpperCase();
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
protected readonly dependencies: BaseStoreDependencies;
|
||||
|
||||
protected constructor(
|
||||
protected readonly dependencies: BaseStoreDependencies,
|
||||
dependencies: BaseStoreDependencies,
|
||||
protected readonly params: BaseStoreParams<T>,
|
||||
) {
|
||||
this.dependencies = dependencies;
|
||||
makeObservable(this);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import type { CatalogEntityMetadata, CatalogEntitySpec, CatalogEntityStatus } fr
|
||||
import type { CatalogEntityActionContext } from "../catalog/catalog-entity";
|
||||
import { CatalogCategory, CatalogEntity, categoryVersion } from "../catalog/catalog-entity";
|
||||
|
||||
interface GeneralEntitySpec extends CatalogEntitySpec {
|
||||
export interface GeneralEntitySpec extends CatalogEntitySpec {
|
||||
path: string;
|
||||
icon?: {
|
||||
material?: string;
|
||||
|
@ -9,7 +9,9 @@ import { observable, makeObservable } from "mobx";
|
||||
import { once } from "lodash";
|
||||
import type { Disposer } 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>
|
||||
? CatalogEntityData<Metadata, Status, Spec>
|
||||
|
@ -5,23 +5,23 @@
|
||||
|
||||
// Custom event emitter
|
||||
|
||||
interface Options {
|
||||
export interface EventEmitterOptions {
|
||||
once?: boolean; // call once and remove
|
||||
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[]]> {
|
||||
protected listeners: [Callback<D>, Options][] = [];
|
||||
export class EventEmitter<D extends any[]> {
|
||||
protected listeners: [EventEmitterCallback<D>, EventEmitterOptions][] = [];
|
||||
|
||||
addListener(callback: Callback<D>, options: Options = {}) {
|
||||
addListener(callback: EventEmitterCallback<D>, options: EventEmitterOptions = {}) {
|
||||
const fn = options.prepend ? "unshift" : "push";
|
||||
|
||||
this.listeners[fn]([callback, options]);
|
||||
}
|
||||
|
||||
removeListener(callback: Callback<D>) {
|
||||
removeListener(callback: EventEmitterCallback<D>) {
|
||||
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 { 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 type { UserPreferenceExtensionItems } from "./user-preferences";
|
||||
import { Preferences } from "./user-preferences";
|
||||
import { slackUrl, issuesTrackerUrl } from "../../common/vars";
|
||||
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 {
|
||||
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[];
|
||||
}
|
||||
const userStore = asLegacyGlobalForExtensionApi(userStoreInjectable);
|
||||
|
||||
export const App: AppExtensionItems = {
|
||||
Preferences,
|
||||
export const App = {
|
||||
Preferences: {
|
||||
getKubectlPath: () => userStore.kubectlBinariesPath,
|
||||
},
|
||||
getEnabledExtensions: asLegacyGlobalFunctionForExtensionApi(getEnabledExtensionsInjectable),
|
||||
get version() {
|
||||
const di = getLegacyGlobalDiForExtensionApi();
|
||||
@ -64,4 +55,4 @@ export const App: AppExtensionItems = {
|
||||
},
|
||||
slackUrl,
|
||||
issuesTrackerUrl,
|
||||
};
|
||||
} as const;
|
||||
|
@ -3,6 +3,7 @@
|
||||
* 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 { asLegacyGlobalForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||
|
||||
@ -12,6 +13,10 @@ export {
|
||||
WebLink,
|
||||
} from "../../common/catalog-entities";
|
||||
|
||||
export type {
|
||||
KubernetesClusterCategory,
|
||||
};
|
||||
|
||||
export const kubernetesClusterCategory = asLegacyGlobalForExtensionApi(kubernetesClusterCategoryInjectable);
|
||||
|
||||
export type {
|
||||
@ -23,6 +28,7 @@ export type {
|
||||
WebLinkStatusPhase,
|
||||
KubernetesClusterStatusPhase,
|
||||
KubernetesClusterStatus,
|
||||
GeneralEntitySpec,
|
||||
} from "../../common/catalog-entities";
|
||||
|
||||
export * from "../../common/catalog/catalog-entity";
|
||||
|
@ -5,7 +5,14 @@
|
||||
|
||||
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 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);
|
||||
|
@ -13,6 +13,8 @@ import * as Types from "./types";
|
||||
import * as Proxy from "./proxy";
|
||||
import loggerInjectable from "../../common/logger.injectable";
|
||||
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);
|
||||
|
||||
@ -25,4 +27,7 @@ export {
|
||||
Util,
|
||||
logger,
|
||||
Proxy,
|
||||
Logger,
|
||||
LensExtension,
|
||||
LensExtensionManifest,
|
||||
};
|
||||
|
@ -3,4 +3,10 @@
|
||||
* 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 { Singleton } from "../../common/utils";
|
||||
import { prevDefault, stopPropagation } from "../../renderer/utils/prevDefault";
|
||||
import type { IClassName } from "../../renderer/utils/cssNames";
|
||||
import { cssNames } from "../../renderer/utils/cssNames";
|
||||
|
||||
export interface UtilsExtensionItems {
|
||||
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 = {
|
||||
export const Util = {
|
||||
Singleton,
|
||||
prevDefault,
|
||||
stopPropagation,
|
||||
@ -34,4 +23,4 @@ export const Util: UtilsExtensionItems = {
|
||||
|
||||
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 Disposers = Symbol("disposers");
|
||||
|
||||
export class LensExtension<Dependencies extends LensExtensionDependencies = LensExtensionDependencies> {
|
||||
export class LensExtension<
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
Dependencies extends LensExtensionDependencies = LensExtensionDependencies,
|
||||
> {
|
||||
readonly id: LensExtensionId;
|
||||
readonly manifest: LensExtensionManifest;
|
||||
readonly manifestPath: string;
|
||||
@ -50,6 +55,9 @@ export class LensExtension<Dependencies extends LensExtensionDependencies = Lens
|
||||
return this._isEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
[Disposers] = disposer();
|
||||
|
||||
constructor({ id, manifest, manifestPath, isBundled }: InstalledExtension) {
|
||||
@ -72,6 +80,9 @@ export class LensExtension<Dependencies extends LensExtensionDependencies = Lens
|
||||
return this.manifest.description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
readonly [lensExtensionDependencies]!: Dependencies;
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,10 @@ const LensExtensions = {
|
||||
Main: LensExtensionsMainApi,
|
||||
};
|
||||
|
||||
export type {
|
||||
LensExtensionsMainApi,
|
||||
};
|
||||
|
||||
const Pty = {
|
||||
spawn,
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ import * as extensionApi from "./extension-api";
|
||||
import { createApp } from "./create-app";
|
||||
|
||||
// @experimental
|
||||
export {
|
||||
export {
|
||||
createApp,
|
||||
extensionApi,
|
||||
afterApplicationIsLoadedInjectionToken,
|
||||
|
@ -22,6 +22,10 @@ const LensExtensions = {
|
||||
Renderer: LensExtensionsRendererApi,
|
||||
};
|
||||
|
||||
export type {
|
||||
LensExtensionsRendererApi,
|
||||
};
|
||||
|
||||
export {
|
||||
React,
|
||||
ReactDOM,
|
||||
|
@ -17,7 +17,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn run webpack --config webpack/extensions.ts",
|
||||
"build-docs": "yarn run typedoc",
|
||||
"build:docs": "yarn run typedoc",
|
||||
"clean": "rm -rf dist/",
|
||||
"prepare:dev": "yarn run build"
|
||||
},
|
||||
|
@ -3,16 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { extensionApi as main } from "@k8slens/core/main";
|
||||
import { extensionApi as renderer } from "@k8slens/core/renderer";
|
||||
import { extensionApi as common } from "@k8slens/core/common";
|
||||
import { extensionApi as Main } from "@k8slens/core/main";
|
||||
import { extensionApi as Renderer } from "@k8slens/core/renderer";
|
||||
import { extensionApi as Common } from "@k8slens/core/common";
|
||||
|
||||
const Main = { ... main } as typeof main;
|
||||
const Renderer = { ...renderer } as typeof renderer;
|
||||
const Common = { ... common } as typeof common;
|
||||
|
||||
export {
|
||||
Main,
|
||||
Renderer,
|
||||
Common,
|
||||
};
|
||||
export { Main, Renderer, Common };
|
||||
|
@ -4,11 +4,9 @@
|
||||
"out": "../../docs/extensions/api",
|
||||
"excludePrivate": true,
|
||||
"entryPointStrategy": "expand",
|
||||
"excludeExternals": true,
|
||||
"entryPoints": [
|
||||
"src/extension-api.ts",
|
||||
"../core/src/common/library.ts",
|
||||
"../core/src/main/library.ts",
|
||||
"../core/src/renderer/library.ts"
|
||||
],
|
||||
"hideBreadcrumbs": true,
|
||||
"disableSources": true,
|
||||
|
Loading…
Reference in New Issue
Block a user