Skip to content

Commit

Permalink
Merge branch 'main' into remove-gif
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjtechwriter authored Jan 18, 2024
2 parents acd8a4b + 7aff1f7 commit f473f8d
Show file tree
Hide file tree
Showing 256 changed files with 8,999 additions and 6,267 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,15 @@ packages/kbn-peggy @elastic/kibana-operations
packages/kbn-peggy-loader @elastic/kibana-operations
packages/kbn-performance-testing-dataset-extractor @elastic/kibana-performance-testing
packages/kbn-picomatcher @elastic/kibana-operations
packages/kbn-plugin-check @elastic/appex-sharedux
packages/kbn-plugin-generator @elastic/kibana-operations
packages/kbn-plugin-helpers @elastic/kibana-operations
examples/portable_dashboards_example @elastic/kibana-presentation
examples/preboot_example @elastic/kibana-security @elastic/kibana-core
packages/presentation/presentation_containers @elastic/kibana-presentation
packages/presentation/presentation_library @elastic/kibana-presentation
src/plugins/presentation_panel @elastic/kibana-presentation
packages/presentation/presentation_publishing @elastic/kibana-presentation
src/plugins/presentation_util @elastic/kibana-presentation
x-pack/plugins/profiling_data_access @elastic/obs-ux-infra_services-team
x-pack/plugins/profiling @elastic/obs-ux-infra_services-team
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"discover": ["src/plugins/discover", "packages/kbn-discover-utils"],
"savedSearch": "src/plugins/saved_search",
"embeddableApi": "src/plugins/embeddable",
"presentationPanel": "src/plugins/presentation_panel",
"embeddableExamples": "examples/embeddable_examples",
"esQuery": "packages/kbn-es-query/src",
"esUi": "src/plugins/es_ui_shared",
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ Content is fetched from the remote (https://feeds.elastic.co) once a day, with p
|Helps to globally configure the no data page components
|{kib-repo}blob/{branch}/src/plugins/presentation_panel/README.md[presentationPanel]
|The Presentation Panel is the point of contact between any React component and any registered UI actions. Components provided to the Presentation Panel should use an imperative handle to expose methods and state.
|{kib-repo}blob/{branch}/src/plugins/presentation_util/README.mdx[presentationUtil]
|The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas).
Expand Down
2 changes: 1 addition & 1 deletion fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"name": "endpoint",
"version": "8.11.1"
"version": "8.12.0"
},
{
"name": "fleet_server",
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,13 @@
"@kbn/paertial-results-example-plugin": "link:examples/partial_results_example",
"@kbn/painless-lab-plugin": "link:x-pack/plugins/painless_lab",
"@kbn/panel-loader": "link:packages/kbn-panel-loader",
"@kbn/plugin-check": "link:packages/kbn-plugin-check",
"@kbn/portable-dashboards-example": "link:examples/portable_dashboards_example",
"@kbn/preboot-example-plugin": "link:examples/preboot_example",
"@kbn/presentation-containers": "link:packages/presentation/presentation_containers",
"@kbn/presentation-library": "link:packages/presentation/presentation_library",
"@kbn/presentation-panel-plugin": "link:src/plugins/presentation_panel",
"@kbn/presentation-publishing": "link:packages/presentation/presentation_publishing",
"@kbn/presentation-util-plugin": "link:src/plugins/presentation_util",
"@kbn/profiling-data-access-plugin": "link:x-pack/plugins/profiling_data_access",
"@kbn/profiling-plugin": "link:x-pack/plugins/profiling",
Expand Down Expand Up @@ -1655,7 +1660,7 @@
"terser-webpack-plugin": "^4.2.3",
"tough-cookie": "^4.1.3",
"tree-kill": "^1.2.2",
"ts-morph": "^13.0.2",
"ts-morph": "^15.1.0",
"tsd": "^0.20.0",
"typescript": "4.7.4",
"url-loader": "^2.2.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-docs-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
*/

export { runBuildApiDocsCli } from './src';

export { findPlugins, findTeamPlugins } from './src/find_plugins';
28 changes: 27 additions & 1 deletion packages/kbn-docs-utils/src/find_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function toApiScope(pkg: Package): ApiScope {
}

function toPluginOrPackage(pkg: Package): PluginOrPackage {
return {
const result = {
id: pkg.isPlugin() ? pkg.manifest.plugin.id : pkg.manifest.id,
directory: Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir),
manifestPath: Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir, 'kibana.jsonc'),
Expand All @@ -50,6 +50,20 @@ function toPluginOrPackage(pkg: Package): PluginOrPackage {
},
scope: toApiScope(pkg),
};

if (pkg.isPlugin()) {
return {
...result,
manifest: {
...result.manifest,
requiredPlugins: pkg.manifest.plugin.requiredPlugins || [],
optionalPlugins: pkg.manifest.plugin.optionalPlugins || [],
requiredBundles: pkg.manifest.plugin.requiredBundles || [],
},
};
}

return result;
}

export function findPlugins(pluginOrPackageFilter?: string[]): PluginOrPackage[] {
Expand Down Expand Up @@ -78,6 +92,18 @@ export function findPlugins(pluginOrPackageFilter?: string[]): PluginOrPackage[]
}
}

export function findTeamPlugins(team: string): PluginOrPackage[] {
const packages = getPackages(REPO_ROOT);
const plugins = packages.filter(
getPluginPackagesFilter({
examples: false,
testPlugins: false,
})
);

return [...plugins.filter((p) => p.manifest.owner.includes(team)).map(toPluginOrPackage)];
}

/**
* Helper to find packages.
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-docs-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export interface PluginOrPackage {
description?: string;
owner: { name: string; githubTeam?: string };
serviceFolders: readonly string[];
requiredBundles?: readonly string[];
requiredPlugins?: readonly string[];
optionalPlugins?: readonly string[];
};
isPlugin: boolean;
directory: string;
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pageLoadAssetSize:
observabilityShared: 52256
osquery: 107090
painlessLab: 179748
presentationPanel: 55463
presentationUtil: 58834
profiling: 36694
remoteClusters: 51327
Expand Down
13 changes: 12 additions & 1 deletion packages/kbn-panel-loader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@

import React from 'react';
import { EuiLoadingChart, EuiPanel } from '@elastic/eui';
import { css } from '@emotion/react';

export const PanelLoader = (props: { showShadow?: boolean; dataTestSubj?: string }) => {
return (
<EuiPanel
css={css`
z-index: auto;
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
min-height: $euiSizeL + 2px;
position: relative;
justify-content: center;
align-items: center;
`}
role="figure"
paddingSize="none"
hasShadow={props.showShadow ?? false}
className={'embPanel embPanel--loading embPanel-isLoading'}
data-test-subj={props.dataTestSubj}
>
<EuiLoadingChart size="l" mono />
Expand Down
5 changes: 5 additions & 0 deletions packages/kbn-plugin-check/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"import/no-extraneous-dependencies": "off"
}
}
17 changes: 17 additions & 0 deletions packages/kbn-plugin-check/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# @kbn/plugin-check

This package contains a CLI to detect inconsistencies between the manifest and Typescript types of a Kibana plugin. Future work will include automatically fixing these inconsistencies.

## Usage

To check a single plugin, run the following command from the root of the Kibana repo:

```sh
node scripts/plugin_check --plugin pluginName
```

To check all plugins owned by a team, run the following:

```sh
node scripts/plugin_check --team @elastic/team_name
```
34 changes: 34 additions & 0 deletions packages/kbn-plugin-check/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

/** Type types of plugin classes within a single plugin. */
export const PLUGIN_LAYERS = ['server', 'client'] as const;

/** The lifecycles a plugin class implements. */
export const PLUGIN_LIFECYCLES = ['setup', 'start'] as const;

/** An enum representing the dependency requirements for a plugin. */
export const PLUGIN_REQUIREMENTS = ['required', 'optional'] as const;

/** An enum representing the manifest requirements for a plugin. */
export const MANIFEST_REQUIREMENTS = ['required', 'optional', 'bundle'] as const;

/** The state of a particular dependency as it relates to the plugin manifest. */
export const MANIFEST_STATES = ['required', 'optional', 'bundle', 'missing'] as const;

/**
* The state of a particular dependency as it relates to a plugin class. Includes states where the
* plugin is missing properties to determine that state.
*/
export const PLUGIN_STATES = ['required', 'optional', 'missing', 'no class', 'unknown'] as const;

/** The state of the dependency for the entire plugin. */
export const DEPENDENCY_STATES = ['required', 'optional', 'mismatch'] as const;

/** An enum representing how the dependency status was derived from the plugin class. */
export const SOURCE_OF_TYPE = ['implements', 'method', 'none'] as const;
Loading

0 comments on commit f473f8d

Please sign in to comment.