mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
Fixes https://github.com/elastic/kibana/issues/149344 This PR migrates all plugins to packages automatically. It does this using `node scripts/lint_packages` to automatically migrate `kibana.json` files to `kibana.jsonc` files. By doing this automatically we can simplify many build and testing procedures to only support packages, and not both "packages" and "synthetic packages" (basically pointers to plugins). The majority of changes are in operations related code, so we'll be having operations review this before marking it ready for review. The vast majority of the code owners are simply pinged because we deleted all `kibana.json` files and replaced them with `kibana.jsonc` files, so we plan on leaving the PR ready-for-review for about 24 hours before merging (after feature freeze), assuming we don't have any blockers (especially from @elastic/kibana-core since there are a few core specific changes, though the majority were handled in #149370). --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.mdx | ||
tsconfig.json |
--- id: kibDevDocsOpsRepoSourceClassifier slug: /kibana-dev-docs/ops/repo-source-classifier title: "@kbn/repo-source-classifier" description: 'The tool which classifies source files into categories' date: 2022-07-25 tags: ['kibana', 'dev', 'contributor', 'operations', 'packages', 'scripts'] --- This package exposes a class which can be used to efficiently classify all of the files in the repository into one of the following groups: - `server package`: plugin code in the root `server/` directory, eventually this will include packages of type `server-plugin` or `server-shared` - `browser package`: plugin code in the root `public/` directory (and a few others in specific plugins), eventually this will include packages of type `browser-plugin` or `browser-shared` - `common packages`: includes any existing package, plugin code in root `common/` directories, (and a few others in specific plugins), Eventually this will include `common-shared` packages - `tests or mocks`: code that is loaded by jest/storybook, and mocks/helpers intended for use by that code. These files usually live along side package code but will have a separate dependency tree and are pieces of code which should never end up in the product. - `static`: static files, currently any .json file or things loaded via `raw-loader` in browser code - `tooling`: scripts, config files for tools like eslint, webpack, etc. - `non-package`: code that lives outside of packages/plugins or doesn't fit into other more specific categories. Once the package project is complete this category should be limited to just `@kbn/pm` This is a map of types to the types they are allowed to import: - `non-package`: `non-package`, `server package`, `browser package`, `common package` or `static` - `server package`: `common package`, `server package`, or `static` - `browser package`: `common package`, `browser package`, or `static` - `common package`: `common package` or`static` - `static`: static files are not allowed to have dependencies - `tests or mocks`: anything - `tooling`: anything The `RepoSourceClassifier` class implements several caches to make these lookups as efficient as possible in ESLint when all imports across the entire repository are validated. This cache lasts for the lifetime of the class and to invalidate the cache the object should just be discarded and a new instance created. A CLI is provided for inspecting the results of the classifier, check out `node scripts/classify_source --help` for more information about usage.