Skip to content

Commit

Permalink
rename @elastic/* packages to @kbn/* (elastic#138957)
Browse files Browse the repository at this point in the history
* rename @elastic/* packages to @kbn/*

* update yarn.lock

* [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest'

* update lint task

* review feedback

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
Spencer and kibanamachine authored Aug 18, 2022
1 parent ad135e9 commit 9003353
Show file tree
Hide file tree
Showing 274 changed files with 280 additions and 271 deletions.
58 changes: 29 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const ELASTIC_LICENSE_HEADER = `
const SAFER_LODASH_SET_HEADER = `
/*
* Elasticsearch B.V licenses this file to you under the MIT License.
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
* See \`packages/kbn-safer-lodash-set/LICENSE\` for more information.
*/
`;

Expand All @@ -81,7 +81,7 @@ const SAFER_LODASH_SET_LODASH_HEADER = `
* This file is forked from the lodash project (https://lodash.com/),
* and may include modifications made by Elasticsearch B.V.
* Elasticsearch B.V. licenses this file to you under the MIT License.
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
* See \`packages/kbn-safer-lodash-set/LICENSE\` for more information.
*/
`;

Expand All @@ -90,7 +90,7 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = `
* This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped),
* and may include modifications made by Elasticsearch B.V.
* Elasticsearch B.V. licenses this file to you under the MIT License.
* See \`packages/elastic-safer-lodash-set/LICENSE\` for more information.
* See \`packages/kbn-safer-lodash-set/LICENSE\` for more information.
*/
`;

Expand Down Expand Up @@ -186,44 +186,44 @@ const RESTRICTED_IMPORTS = [
{
name: 'lodash',
importNames: ['set', 'setWith'],
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash.set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash.setwith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/setWith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/fp',
importNames: ['set', 'setWith', 'assoc', 'assocPath'],
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/fp/set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/fp/setWith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/fp/assoc',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/fp/assocPath',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash',
Expand Down Expand Up @@ -409,7 +409,7 @@ module.exports = {
* safer-lodash-set package requires special license headers
*/
{
files: ['packages/elastic-safer-lodash-set/**/*.{js,mjs,ts,tsx}'],
files: ['packages/kbn-safer-lodash-set/**/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand Down Expand Up @@ -438,7 +438,7 @@ module.exports = {
},

{
files: ['packages/elastic-safer-lodash-set/test/*.{js,mjs,ts,tsx}'],
files: ['packages/kbn-safer-lodash-set/test/*.{js,mjs,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand Down Expand Up @@ -466,7 +466,7 @@ module.exports = {
},
},
{
files: ['packages/elastic-safer-lodash-set/**/*.d.ts'],
files: ['packages/kbn-safer-lodash-set/**/*.d.ts'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
Expand Down Expand Up @@ -734,7 +734,7 @@ module.exports = {
* Harden specific rules
*/
{
files: ['test/harden/*.js', 'packages/elastic-safer-lodash-set/test/*.js'],
files: ['test/harden/*.js', 'packages/kbn-safer-lodash-set/test/*.js'],
rules: {
'mocha/handle-done-callback': 'off',
},
Expand All @@ -754,11 +754,11 @@ module.exports = {
paths: [
{
name: 'lodash.set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash.setwith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash.template',
Expand All @@ -767,11 +767,11 @@ module.exports = {
},
{
name: 'lodash/set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/setWith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
name: 'lodash/template',
Expand All @@ -786,12 +786,12 @@ module.exports = {
{
object: 'lodash',
property: 'set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: '_',
property: 'set',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: 'lodash',
Expand All @@ -808,32 +808,32 @@ module.exports = {
{
object: 'lodash',
property: 'setWith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: '_',
property: 'setWith',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: 'lodash',
property: 'assoc',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: '_',
property: 'assoc',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: 'lodash',
property: 'assocPath',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
{
object: '_',
property: 'assocPath',
message: 'Please use @elastic/safer-lodash-set instead',
message: 'Please use @kbn/safer-lodash-set instead',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ x-pack/plugins/files @elastic/kibana-app-services
/src/apm.js @elastic/kibana-core @vigneshshanmugam
/packages/kbn-apm-config-loader/ @elastic/kibana-core @vigneshshanmugam
/src/core/types/elasticsearch @elastic/apm-ui
/packages/elastic-apm-synthtrace/ @elastic/apm-ui
/packages/kbn-apm-synthtrace/ @elastic/apm-ui
/packages/kbn-shared-svg @elastic/apm-ui
#CC# /src/plugins/apm_oss/ @elastic/apm-ui
#CC# /x-pack/plugins/observability/ @elastic/apm-ui
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ yarn kbn watch
[discrete]
=== List of Already Migrated Packages to Bazel

- @elastic/eslint-config-kibana
- @elastic/safer-lodash-set
- @kbn/ace
- @kbn/analytics
- @kbn/apm-config-loader
Expand All @@ -57,6 +55,7 @@ yarn kbn watch
- @kbn/docs-utils
- @kbn/es
- @kbn/es-archiver
- @kbn/eslint-config-kibana
- @kbn/eslint-plugin-eslint
- @kbn/expect
- @kbn/i18n
Expand All @@ -68,6 +67,7 @@ yarn kbn watch
- @kbn/optimizer
- @kbn/plugin-helpers
- @kbn/rule-data-utils
- @kbn/safer-lodash-set
- @kbn/securitysolution-autocomplete
- @kbn/securitysolution-es-utils
- @kbn/securitysolution-hook-utils
Expand Down
4 changes: 2 additions & 2 deletions legacy_rfcs/text/0015_bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ A `BUILD.bazel` file will be added to the root of each package defining a `build

The `@kbn/pm` package was updated in https://github.com/elastic/kibana/pull/89961 to run the new packages build target, invoked by calling `bazel build //packages:build`, before executing the existing legacy package builds.

The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/elastic-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target.
The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/kbn-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target.

Example package BUILD.bazel for `packages/elastic-datemath`:
Example package BUILD.bazel for `packages/kbn-datemath`:

```python
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"@dnd-kit/utilities": "^2.0.0",
"@elastic/apm-rum": "^5.12.0",
"@elastic/apm-rum-react": "^1.4.2",
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
"@elastic/charts": "47.1.1",
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
Expand All @@ -113,7 +112,6 @@
"@elastic/numeral": "^2.5.1",
"@elastic/react-search-ui": "^1.14.0",
"@elastic/request-crypto": "2.0.1",
"@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set",
"@elastic/search-ui-app-search-connector": "^1.14.0",
"@emotion/cache": "^11.9.3",
"@emotion/css": "^11.9.0",
Expand All @@ -139,6 +137,7 @@
"@kbn/analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server",
"@kbn/analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory",
"@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader",
"@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace",
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils",
"@kbn/chart-icons": "link:bazel-bin/packages/kbn-chart-icons",
"@kbn/coloring": "link:bazel-bin/packages/kbn-coloring",
Expand Down Expand Up @@ -282,6 +281,7 @@
"@kbn/plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery",
"@kbn/react-field": "link:bazel-bin/packages/kbn-react-field",
"@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils",
"@kbn/safer-lodash-set": "link:bazel-bin/packages/kbn-safer-lodash-set",
"@kbn/securitysolution-autocomplete": "link:bazel-bin/packages/kbn-securitysolution-autocomplete",
"@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils",
"@kbn/securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils",
Expand Down Expand Up @@ -725,7 +725,6 @@
"@types/deep-freeze-strict": "^1.1.0",
"@types/delete-empty": "^2.0.0",
"@types/ejs": "^3.0.6",
"@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types",
"@types/enzyme": "^3.10.8",
"@types/eslint": "^7.28.0",
"@types/express": "^4.17.13",
Expand Down Expand Up @@ -775,6 +774,7 @@
"@types/kbn__analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types",
"@types/kbn__analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types",
"@types/kbn__apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types",
"@types/kbn__apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types",
"@types/kbn__apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module_types",
"@types/kbn__axe-config": "link:bazel-bin/packages/kbn-axe-config/npm_module_types",
"@types/kbn__bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages/npm_module_types",
Expand Down
8 changes: 4 additions & 4 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ filegroup(
"//packages/core/ui-settings/core-ui-settings-browser-mocks:build",
"//packages/core/ui-settings/core-ui-settings-browser:build",
"//packages/core/ui-settings/core-ui-settings-common:build",
"//packages/elastic-apm-synthtrace:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/home/sample_data_card:build",
"//packages/home/sample_data_tab:build",
"//packages/home/sample_data_types:build",
Expand All @@ -127,6 +125,7 @@ filegroup(
"//packages/kbn-ambient-ui-types:build",
"//packages/kbn-analytics:build",
"//packages/kbn-apm-config-loader:build",
"//packages/kbn-apm-synthtrace:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-axe-config:build",
"//packages/kbn-babel-plugin-synthetic-packages:build",
Expand Down Expand Up @@ -193,6 +192,7 @@ filegroup(
"//packages/kbn-repo-source-classifier-cli:build",
"//packages/kbn-repo-source-classifier:build",
"//packages/kbn-rule-data-utils:build",
"//packages/kbn-safer-lodash-set:build",
"//packages/kbn-securitysolution-autocomplete:build",
"//packages/kbn-securitysolution-es-utils:build",
"//packages/kbn-securitysolution-hook-utils:build",
Expand Down Expand Up @@ -382,14 +382,13 @@ filegroup(
"//packages/core/ui-settings/core-ui-settings-browser-mocks:build_types",
"//packages/core/ui-settings/core-ui-settings-browser:build_types",
"//packages/core/ui-settings/core-ui-settings-common:build_types",
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/home/sample_data_card:build_types",
"//packages/home/sample_data_tab:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
"//packages/kbn-apm-config-loader:build_types",
"//packages/kbn-apm-synthtrace:build_types",
"//packages/kbn-apm-utils:build_types",
"//packages/kbn-axe-config:build_types",
"//packages/kbn-bazel-packages:build_types",
Expand Down Expand Up @@ -449,6 +448,7 @@ filegroup(
"//packages/kbn-repo-source-classifier-cli:build_types",
"//packages/kbn-repo-source-classifier:build_types",
"//packages/kbn-rule-data-utils:build_types",
"//packages/kbn-safer-lodash-set:build_types",
"//packages/kbn-securitysolution-autocomplete:build_types",
"//packages/kbn-securitysolution-es-utils:build_types",
"//packages/kbn-securitysolution-hook-utils:build_types",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/config/core-config-server-internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NPM_MODULE_EXTRA_FILES = [
]

RUNTIME_DEPS = [
"//packages/elastic-safer-lodash-set",
"//packages/kbn-safer-lodash-set",
"//packages/kbn-config",
"//packages/core/base/core-base-server-internal",
"//packages/kbn-config-mocks",
Expand All @@ -36,7 +36,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"@npm//@types/node",
"@npm//@types/jest",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-safer-lodash-set:npm_module_types",
"//packages/kbn-config:npm_module_types",
"//packages/kbn-config-mocks:npm_module_types",
"//packages/core/base/core-base-server-internal:npm_module_types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUNTIME_DEPS = [
"@npm//lodash",
"@npm//moment-timezone",
"@npm//elastic-apm-node",
"//packages/elastic-safer-lodash-set",
"//packages/kbn-safer-lodash-set",
"//packages/kbn-config-schema",
"//packages/kbn-std",
]
Expand All @@ -41,7 +41,7 @@ TYPES_DEPS = [
"@npm//rxjs",
"@npm//@types/moment-timezone",
"@npm//elastic-apm-node",
"//packages/elastic-safer-lodash-set:npm_module_types",
"//packages/kbn-safer-lodash-set:npm_module_types",
"//packages/kbn-logging:npm_module_types",
"//packages/kbn-config-schema:npm_module_types",
"//packages/core/base/core-base-server-internal:npm_module_types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { schema } from '@kbn/config-schema';
import { LogRecord } from '@kbn/logging';
import { set } from '@elastic/safer-lodash-set';
import { set } from '@kbn/safer-lodash-set';
import { has, unset } from 'lodash';
import { assertNever } from '@kbn/std';
import type { MetaRewritePolicyConfig } from '@kbn/core-logging-server';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { has } from 'lodash';
import { set } from '@elastic/safer-lodash-set';
import { set } from '@kbn/safer-lodash-set';
import { LogMeta } from '@kbn/logging';
import { GlobalContext } from './types';

Expand Down
Loading

0 comments on commit 9003353

Please sign in to comment.