kibana/packages/kbn-manifest
Gerard Soldevila 58c8aff91c
[8.x] Sustainable Kibana Architecture: Categorise straightforward packages (#199630) (#201340)
# Backport

This will backport the following commits from `main` to `8.x`:
- [Sustainable Kibana Architecture: Categorise `straightforward`
packages (#199630)](https://github.com/elastic/kibana/pull/199630)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-11-22T09:33:25Z","message":"Sustainable
Kibana Architecture: Categorise `straightforward` packages
(#199630)\n\n## Summary\r\n\r\nThis PR is part of the Kibana Sustainable
Architecture effort.\r\n\r\nThe goal is to start categorising Kibana
packages into _generic\r\nplatform_ (`group: \"platform\"`) vs
_solution-specific_.\r\n\r\n```\r\ngroup?: 'search' | 'security' |
'observability' | 'platform'\r\nvisibility?: 'private' |
'shared'\r\n```\r\nUncategorised modules are considered to be `group:
'common', visibility:\r\n'shared'` by default.\r\n\r\nWe want to prevent
code from solution A to depend on code from solution\r\nB.\r\nThus, the
rules are pretty simple:\r\n\r\n* Modules can only depend on:\r\n *
Modules in the same group\r\n * OR modules with 'shared' visibility\r\n*
Modules in `'observability', 'security', 'search'` groups
are\r\nmandatorily `visibility: \"private\"`.\r\n\r\nLong term, the goal
is to re-organise packages into dedicated
folders,\r\ne.g.:\r\n\r\n```\r\nx-pack/platform/plugins/private\r\nx-pack/observability/packages\r\n```\r\n\r\nFor
this first wave, we have categorised packages that
seem\r\n\"straightforward\":\r\n* Any packages that have:\r\n * at least
one dependant module\r\n * all dependants belong to the same group\r\n*
Categorise all Core packages:\r\n * `@kbn/core-...-internal` =>
_platform/private_\r\n * everything else => _platform/shared_\r\n*
Categorise as _platform/shared_ those packages that:\r\n * Have at least
one dependant in the _platform_ group.\r\n * Don't have any `devOnly:
true` dependants.\r\n\r\n### What we ask from you, as CODEOWNERS of the
_package manifests_, is\r\nthat you confirm that the categorisation is
correct:\r\n\r\n* `group: \"platform\", visibility: \"private\"` if it's
a package that\r\nshould only be used from platform code, not from any
solution code. It\r\nwill be loaded systematically in all serverless
flavors, but solution\r\nplugins and packages won't be able to `import`
from it.\r\n* `group: \"platform\", visibility: \"shared\"` if it's a
package that can\r\nbe consumed by both platform and solutions code. It
will be loaded\r\nsystematically in all serverless flavors, and anybody
can import / use\r\ncode from it.\r\n* `group: \"observability\" |
\"security\" | \"search\", visibility:\r\n\"private\"` if it's a package
that is intented to be used exclusively\r\nfrom a given solution. It
won't be accessible nor loaded from other\r\nsolutions nor platform
code.\r\n\r\nPlease refer
to\r\n[#kibana-sustainable-architecture](https://elastic.slack.com/archives/C07TCKTA22E)\r\nfor
any related questions.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b24fdf5d3f6b7454a4edcedb8141b82f571e1d74","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services"],"number":199630,"url":"https://github.com/elastic/kibana/pull/199630","mergeCommit":{"message":"Sustainable
Kibana Architecture: Categorise `straightforward` packages
(#199630)\n\n## Summary\r\n\r\nThis PR is part of the Kibana Sustainable
Architecture effort.\r\n\r\nThe goal is to start categorising Kibana
packages into _generic\r\nplatform_ (`group: \"platform\"`) vs
_solution-specific_.\r\n\r\n```\r\ngroup?: 'search' | 'security' |
'observability' | 'platform'\r\nvisibility?: 'private' |
'shared'\r\n```\r\nUncategorised modules are considered to be `group:
'common', visibility:\r\n'shared'` by default.\r\n\r\nWe want to prevent
code from solution A to depend on code from solution\r\nB.\r\nThus, the
rules are pretty simple:\r\n\r\n* Modules can only depend on:\r\n *
Modules in the same group\r\n * OR modules with 'shared' visibility\r\n*
Modules in `'observability', 'security', 'search'` groups
are\r\nmandatorily `visibility: \"private\"`.\r\n\r\nLong term, the goal
is to re-organise packages into dedicated
folders,\r\ne.g.:\r\n\r\n```\r\nx-pack/platform/plugins/private\r\nx-pack/observability/packages\r\n```\r\n\r\nFor
this first wave, we have categorised packages that
seem\r\n\"straightforward\":\r\n* Any packages that have:\r\n * at least
one dependant module\r\n * all dependants belong to the same group\r\n*
Categorise all Core packages:\r\n * `@kbn/core-...-internal` =>
_platform/private_\r\n * everything else => _platform/shared_\r\n*
Categorise as _platform/shared_ those packages that:\r\n * Have at least
one dependant in the _platform_ group.\r\n * Don't have any `devOnly:
true` dependants.\r\n\r\n### What we ask from you, as CODEOWNERS of the
_package manifests_, is\r\nthat you confirm that the categorisation is
correct:\r\n\r\n* `group: \"platform\", visibility: \"private\"` if it's
a package that\r\nshould only be used from platform code, not from any
solution code. It\r\nwill be loaded systematically in all serverless
flavors, but solution\r\nplugins and packages won't be able to `import`
from it.\r\n* `group: \"platform\", visibility: \"shared\"` if it's a
package that can\r\nbe consumed by both platform and solutions code. It
will be loaded\r\nsystematically in all serverless flavors, and anybody
can import / use\r\ncode from it.\r\n* `group: \"observability\" |
\"security\" | \"search\", visibility:\r\n\"private\"` if it's a package
that is intented to be used exclusively\r\nfrom a given solution. It
won't be accessible nor loaded from other\r\nsolutions nor platform
code.\r\n\r\nPlease refer
to\r\n[#kibana-sustainable-architecture](https://elastic.slack.com/archives/C07TCKTA22E)\r\nfor
any related questions.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b24fdf5d3f6b7454a4edcedb8141b82f571e1d74"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199630","number":199630,"mergeCommit":{"message":"Sustainable
Kibana Architecture: Categorise `straightforward` packages
(#199630)\n\n## Summary\r\n\r\nThis PR is part of the Kibana Sustainable
Architecture effort.\r\n\r\nThe goal is to start categorising Kibana
packages into _generic\r\nplatform_ (`group: \"platform\"`) vs
_solution-specific_.\r\n\r\n```\r\ngroup?: 'search' | 'security' |
'observability' | 'platform'\r\nvisibility?: 'private' |
'shared'\r\n```\r\nUncategorised modules are considered to be `group:
'common', visibility:\r\n'shared'` by default.\r\n\r\nWe want to prevent
code from solution A to depend on code from solution\r\nB.\r\nThus, the
rules are pretty simple:\r\n\r\n* Modules can only depend on:\r\n *
Modules in the same group\r\n * OR modules with 'shared' visibility\r\n*
Modules in `'observability', 'security', 'search'` groups
are\r\nmandatorily `visibility: \"private\"`.\r\n\r\nLong term, the goal
is to re-organise packages into dedicated
folders,\r\ne.g.:\r\n\r\n```\r\nx-pack/platform/plugins/private\r\nx-pack/observability/packages\r\n```\r\n\r\nFor
this first wave, we have categorised packages that
seem\r\n\"straightforward\":\r\n* Any packages that have:\r\n * at least
one dependant module\r\n * all dependants belong to the same group\r\n*
Categorise all Core packages:\r\n * `@kbn/core-...-internal` =>
_platform/private_\r\n * everything else => _platform/shared_\r\n*
Categorise as _platform/shared_ those packages that:\r\n * Have at least
one dependant in the _platform_ group.\r\n * Don't have any `devOnly:
true` dependants.\r\n\r\n### What we ask from you, as CODEOWNERS of the
_package manifests_, is\r\nthat you confirm that the categorisation is
correct:\r\n\r\n* `group: \"platform\", visibility: \"private\"` if it's
a package that\r\nshould only be used from platform code, not from any
solution code. It\r\nwill be loaded systematically in all serverless
flavors, but solution\r\nplugins and packages won't be able to `import`
from it.\r\n* `group: \"platform\", visibility: \"shared\"` if it's a
package that can\r\nbe consumed by both platform and solutions code. It
will be loaded\r\nsystematically in all serverless flavors, and anybody
can import / use\r\ncode from it.\r\n* `group: \"observability\" |
\"security\" | \"search\", visibility:\r\n\"private\"` if it's a package
that is intented to be used exclusively\r\nfrom a given solution. It
won't be accessible nor loaded from other\r\nsolutions nor platform
code.\r\n\r\nPlease refer
to\r\n[#kibana-sustainable-architecture](https://elastic.slack.com/archives/C07TCKTA22E)\r\nfor
any related questions.\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"b24fdf5d3f6b7454a4edcedb8141b82f571e1d74"}}]}]
BACKPORT-->
2024-11-22 09:47:23 -06:00
..
index.ts [8.x] Kibana Sustainable Architecture: Expose StatusResponse in core-status-common (#200524) (#200685) 2024-11-19 14:23:36 +01:00
jest.config.js [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00
kibana.jsonc [8.x] Sustainable Kibana Architecture: Categorise straightforward packages (#199630) (#201340) 2024-11-22 09:47:23 -06:00
manifest.ts [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00
package.json [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00
README.md [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00
tsconfig.json [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00

@kbn/manifest

This package contains a CLI to list kibana.jsonc manifests and also to mass update their properties.

Usage

To list all kibana.jsonc manifests, run the following command from the root of the Kibana repo:

node scripts/manifest --list all

To print a manifest by packageId or by pluginId, run the following command from the root of the Kibana repo:

node scripts/manifest --package @kbn/package_name
node scripts/manifest --plugin pluginId

To update properties in one or more manifest files, run the following command from the root of the Kibana repo:

node scripts/manifest \
--package @kbn/package_1 \
--package @kbn/package_2 \
# ...
--package @kbn/package_N \
--set path.to.property1=value \
--set property2=value