mirror of
https://github.com/elastic/kibana.git
synced 2025-04-22 08:49:27 -04:00
## Summary This PR aims at relocating some of the Kibana modules (plugins and packages) into a new folder structure, according to the _Sustainable Kibana Architecture_ initiative. > [!IMPORTANT] > * We kindly ask you to: > * Manually fix the errors in the error section below (if there are any). > * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the source code (Babel and Eslint config files), and update them appropriately. > * Manually review `.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that any CI pipeline customizations continue to be correctly applied after the changed path names > * Review all of the updated files, specially the `.ts` and `.js` files listed in the sections below, as some of them contain relative paths that have been updated. > * Think of potential impact of the move, including tooling and configuration files that can be pointing to the relocated modules. E.g.: > * customised eslint rules > * docs pointing to source code > [!NOTE] > * This PR has been auto-generated. > * Any manual contributions will be lost if the 'relocate' script is re-run. > * Try to obtain the missing reviews / approvals before applying manual fixes, and/or keep your changes in a .patch / git stash. > * Please use [#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E) Slack channel for feedback. Are you trying to rebase this PR to solve merge conflicts? Please follow the steps describe [here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E). #### 3 packages(s) are going to be relocated: | Id | Target folder | | -- | ------------- | | `@kbn/code-editor` | `src/platform/packages/shared/shared-ux/code_editor/impl` | | `@kbn/code-editor-mock` | `src/platform/packages/shared/shared-ux/code_editor/mocks` | | `@kbn/monaco` | `src/platform/packages/shared/kbn-monaco` | <details > <summary>Updated relative paths</summary> ``` src/platform/packages/shared/kbn-monaco/jest.config.js:12 src/platform/packages/shared/kbn-monaco/tsconfig.json:2 src/platform/packages/shared/kbn-monaco/tsconfig.type_check.json:2 src/platform/packages/shared/shared-ux/code_editor/impl/jest.config.js:12 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.json:16 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.json:2 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:18 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:2 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:25 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:28 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:31 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:34 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:37 src/platform/packages/shared/shared-ux/code_editor/impl/tsconfig.type_check.json:40 src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.json:16 src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.json:2 src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:18 src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:2 src/platform/packages/shared/shared-ux/code_editor/mocks/tsconfig.type_check.json:25 ``` </details> |
||
---|---|---|
.. | ||
src | ||
README.mdx | ||
tsconfig.json |
--- id: kibDevDocsOpsKbnPm slug: /kibana-dev-docs/ops/kbn-pm title: "@kbn/pm" description: 'The tool which bootstraps the repo and helps work with packages' date: 2022-07-14 tags: ['kibana', 'dev', 'contributor', 'operations', 'packages', 'scripts'] --- `@kbn/pm` is the tool that we use to bootstrap the Kibana repository, build packages with Bazel, and run scripts in packages. ## commands ### `yarn kbn bootstrap` Use this command to install dependencies, build packages, and prepare the repo for local development. ### `yarn kbn watch` Use this command to build all packages and make sure that they are rebuilt as you make changes. ### and more! There are several commands supported by `@kbn/pm`, but rather than documenting them here they are documented in the help text. Please run `yarn kbn --help` locally to see the most up-to-date info. ## Why isn't this TypeScript? Since this tool is required for bootstrapping the repository it needs to work without any dependencies installed and without a build toolchain. We accomplish this by writing the tool in vanilla JS (shocker!) and using TypeScript to validate the code which is typed via heavy use of JSDoc comments. In order to use import/export syntax and enhance the developer experience a little we use the `.mjs` file extension. In some cases we actually do use TypeScript files, just for defining complicated types. These files are then imported only in special TS-compatible JSDoc comments, so Node.js will never try to import them but they can be used to define types which are too complicated to define inline or in a JSDoc comment. There are cases where `@kbn/pm` relies on code from packages, mostly to prevent reimplementing common functionality. This can only be done in one of two ways: 1. With a dynamic `await import(...)` statement that is always run after boostrap is complete, or is wrapped in a try/catch in case bootstrap didn't complete successfully. 2. By pulling in the source code of the un-built package. Option 1 is used in several places, with contingencies in place in case bootstrap failed. Option 2 is used for two pieces of code which are needed in order to run bootstrap: 1. `@kbn/plugin-discovery` as we need to populate the `@kbn/package-map` to run Bazel 2. `@kbn/bazel-runner` as we want to have the logic for running bazel in a single location Because we load these two packages from source, without being built, before bootstrap is ever run, they can not depend on other packages and must be written in Vanilla JS as well.