Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.7] [packages] migrate all plugins to packages (#148130) #157306

Merged
merged 2 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 9 additions & 8 deletions .buildkite/scripts/build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ export KBN_NP_PLUGINS_BUILT=true

echo "--- Build Kibana Distribution"

BUILD_ARGS=""
is_pr_with_label "ci:build-all-platforms" && BUILD_ARGS="--all-platforms"
is_pr_with_label "ci:build-example-plugins" && BUILD_ARGS="$BUILD_ARGS --example-plugins"
is_pr_with_label "ci:build-docker-cross-compile" && BUILD_ARG="$BUILD_ARGS --docker-cross-compile"
is_pr_with_label "ci:build-os-packages" || BUILD_ARGS="$BUILD_ARGS --skip-os-packages"
is_pr_with_label "ci:build-canvas-shareable-runtime" || BUILD_ARGS="$BUILD_ARGS --skip-canvas-shareable-runtime"
is_pr_with_label "ci:build-docker-contexts" || BUILD_ARGS="$BUILD_ARGS --skip-docker-contexts"
node scripts/build $BUILD_ARGS
BUILD_ARGS=("--with-test-plugins" "--with-example-plugins")
is_pr_with_label "ci:build-all-platforms" && BUILD_ARGS+=("--all-platforms")
is_pr_with_label "ci:build-docker-cross-compile" && BUILD_ARGS+=("--docker-cross-compile")
is_pr_with_label "ci:build-os-packages" || BUILD_ARGS+=("--skip-os-packages")
is_pr_with_label "ci:build-canvas-shareable-runtime" || BUILD_ARGS+=("--skip-canvas-shareable-runtime")
is_pr_with_label "ci:build-docker-contexts" || BUILD_ARGS+=("--skip-docker-contexts")

echo "> node scripts/build" "${BUILD_ARGS[@]}"
node scripts/build "${BUILD_ARGS[@]}"

if is_pr_with_label "ci:build-cloud-image"; then
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/artifacts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -euo pipefail
source .buildkite/scripts/steps/artifacts/env.sh

echo "--- Build Kibana artifacts"
node scripts/build --all-platforms --debug --docker-cross-compile $(echo "$BUILD_ARGS")
node scripts/build --all-platforms --debug --docker-cross-compile "${BUILD_ARGS[@]}"

echo "--- Extract default i18n messages"
mkdir -p target/i18n
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ KIBANA_DOCKER_CONTEXT="${KIBANA_DOCKER_CONTEXT:="default"}"

echo "--- Create contexts"
mkdir -p target
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact $(echo "$BUILD_ARGS")
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact "${BUILD_ARGS[@]}"

echo "--- Setup context"
DOCKER_BUILD_FOLDER=$(mktemp -d)
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/artifacts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ fi

if [[ "$RELEASE_BUILD" == "true" ]]; then
FULL_VERSION="$QUALIFIER_VERSION"
BUILD_ARGS="--release --version-qualifier=$VERSION_QUALIFIER"
BUILD_ARGS=("--release" "--version-qualifier=$VERSION_QUALIFIER")
WORKFLOW="staging"
else
FULL_VERSION="$QUALIFIER_VERSION-SNAPSHOT"
BUILD_ARGS="--version-qualifier=$VERSION_QUALIFIER"
BUILD_ARGS=("--version-qualifier=$VERSION_QUALIFIER")
WORKFLOW="snapshot"
fi

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/bootstrap.sh

.buildkite/scripts/steps/checks/precommit_hook.sh
.buildkite/scripts/steps/checks/packages.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/packages.sh
.buildkite/scripts/steps/checks/bazel_packages.sh
Expand All @@ -18,7 +19,6 @@ export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/steps/checks/i18n.sh
.buildkite/scripts/steps/checks/file_casing.sh
.buildkite/scripts/steps/checks/licenses.sh
.buildkite/scripts/steps/checks/plugins_with_circular_deps.sh
.buildkite/scripts/steps/checks/test_projects.sh
.buildkite/scripts/steps/checks/test_hardening.sh
.buildkite/scripts/steps/checks/ftr_configs.sh
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks/packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

echo --- Lint packages
echo --- Lint Packages
cmd="node scripts/lint_packages"
if is_pr && ! is_auto_commit_disabled; then
cmd="$cmd --fix"
Expand Down
8 changes: 0 additions & 8 deletions .buildkite/scripts/steps/checks/plugins_with_circular_deps.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks/ts_projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

echo --- Lint TS projects
echo --- Lint TS Projects
cmd="node scripts/lint_ts_projects"
if is_pr && ! is_auto_commit_disabled; then
cmd="$cmd --fix"
Expand Down
7 changes: 5 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const VENN_DIAGRAM_HEADER = `

/** Packages which should not be included within production code. */
const DEV_PACKAGE_DIRS = getPackages(REPO_ROOT).flatMap((pkg) =>
pkg.isDevOnly ? pkg.normalizedRepoRelativeDir : []
pkg.isDevOnly() ? pkg.normalizedRepoRelativeDir : []
);

/** Directories (at any depth) which include dev-only code. */
Expand Down Expand Up @@ -1736,7 +1736,10 @@ module.exports = {
* Code inside .buildkite runs separately from everything else in CI, before bootstrap, with ts-node. It needs a few tweaks because of this.
*/
{
files: 'packages/kbn-{package-*,repo-*,dep-*}/**/*',
files: [
'packages/kbn-{package-*,repo-*,dep-*}/**/*',
'packages/kbn-find-used-node-modules/**/*',
],
rules: {
'max-classes-per-file': 'off',
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ webpackstats.json
!/config/serverless.security.yml
!/config/node.options
coverage
!/test/common/fixtures/plugins/coverage
selenium
.babel_register_cache.json
.webpack.babelcache
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/api_welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If that isn't the case, please file an issue, it could be a bug with the system.
We are [aware of some performance issues](https://github.com/elastic/elastic-docs/issues/274) with deeply nested, or large APIs.

In the short term, the best thing you can do is avoid deeply nested API items. Use interfaces rather than inlined objects. Also consider
adding `serviceFolders` in your kibana.json. This will automatically split your docs up based on which APIs are defined within the service folders.
adding `serviceFolders` in your kibana.jsonc. This will automatically split your docs up based on which APIs are defined within the service folders.
They will get built into a doc with an id of
`kib${PluginName}${ServiceName}PluginApi`. The data plugin does this, so you
can [check that out as an example](https://github.com/elastic/kibana/blob/main/src/plugins/data/kibana.json#L13).
Expand Down
1 change: 0 additions & 1 deletion dev_docs/operations/operations_landing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ layout: landing
{ pageId: "kibDevDocsOpsKbnPm" },
{ pageId: "kibDevDocsOpsOptimizer" },
{ pageId: "kibDevDocsOpsBabelPreset" },
{ pageId: "kibDevDocsOpsBabelPluginPackageImports" },
{ pageId: "kibDevDocsOpsUiSharedDepsNpm" },
{ pageId: "kibDevDocsOpsUiSharedDepsSrc" },
{ pageId: "kibDevDocsOpsPluginDiscovery" },
Expand Down
14 changes: 0 additions & 14 deletions examples/bfetch_explorer/kibana.json

This file was deleted.

17 changes: 17 additions & 0 deletions examples/bfetch_explorer/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "plugin",
"id": "@kbn/bfetch-explorer-plugin",
"owner": "@elastic/appex-sharedux",
"plugin": {
"id": "bfetchExplorer",
"server": true,
"browser": true,
"requiredPlugins": [
"bfetch",
"developerExamples"
],
"requiredBundles": [
"kibanaReact"
]
}
}
18 changes: 0 additions & 18 deletions examples/controls_example/kibana.json

This file was deleted.

18 changes: 18 additions & 0 deletions examples/controls_example/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "plugin",
"id": "@kbn/controls-example-plugin",
"owner": "@elastic/kibana-presentation",
"plugin": {
"id": "controlsExample",
"server": false,
"browser": true,
"requiredPlugins": [
"controls",
"data",
"developerExamples",
"embeddable",
"navigation",
"presentationUtil"
]
}
}
20 changes: 0 additions & 20 deletions examples/dashboard_embeddable_examples/kibana.json

This file was deleted.

18 changes: 18 additions & 0 deletions examples/dashboard_embeddable_examples/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "plugin",
"id": "@kbn/dashboard-embeddable-examples-plugin",
"owner": "@elastic/kibana-presentation",
"description": "Example app that shows how to embed a dashboard in an application",
"plugin": {
"id": "dashboardEmbeddableExamples",
"server": false,
"browser": true,
"requiredPlugins": [
"embeddable",
"embeddableExamples",
"dashboard",
"developerExamples",
"kibanaReact"
]
}
}
15 changes: 0 additions & 15 deletions examples/data_view_field_editor_example/kibana.json

This file was deleted.

16 changes: 16 additions & 0 deletions examples/data_view_field_editor_example/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "plugin",
"id": "@kbn/data-view-field-editor-example-plugin",
"owner": "@elastic/kibana-app-services",
"description": "Data view field editor example app",
"plugin": {
"id": "dataViewFieldEditorExample",
"server": false,
"browser": true,
"requiredPlugins": [
"data",
"dataViewFieldEditor",
"developerExamples"
]
}
}
10 changes: 0 additions & 10 deletions examples/developer_examples/kibana.json

This file was deleted.

10 changes: 10 additions & 0 deletions examples/developer_examples/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "plugin",
"id": "@kbn/developer-examples-plugin",
"owner": "@elastic/appex-sharedux",
"plugin": {
"id": "developerExamples",
"server": false,
"browser": true
}
}
16 changes: 0 additions & 16 deletions examples/embeddable_examples/kibana.json

This file was deleted.

26 changes: 26 additions & 0 deletions examples/embeddable_examples/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "plugin",
"id": "@kbn/embeddable-examples-plugin",
"owner": "@elastic/kibana-presentation",
"description": "Example app that shows how to register custom embeddables",
"plugin": {
"id": "embeddableExamples",
"server": true,
"browser": true,
"requiredPlugins": [
"embeddable",
"uiActions",
"savedObjects",
"dashboard",
"kibanaUtils"
],
"requiredBundles": [
"kibanaReact"
],
"extraPublicDirs": [
"public/todo",
"public/hello_world",
"public/todo/todo_ref_embeddable"
]
}
}
23 changes: 0 additions & 23 deletions examples/embeddable_explorer/kibana.json

This file was deleted.

Loading