From afb09ccf8a61d610e8e3d8beb2c80f413f1b33c5 Mon Sep 17 00:00:00 2001 From: Spencer Date: Thu, 22 Dec 2022 18:00:29 -0700 Subject: [PATCH] Transpile packages on demand, validate all TS projects (#146212) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Dearest Reviewers 👋 I've been working on this branch with @mistic and @tylersmalley and we're really confident in these changes. Additionally, this changes code in nearly every package in the repo so we don't plan to wait for reviews to get in before merging this. If you'd like to have a concern addressed, please feel free to leave a review, but assuming that nobody raises a blocker in the next 24 hours we plan to merge this EOD pacific tomorrow, 12/22. We'll be paying close attention to any issues this causes after merging and work on getting those fixed ASAP. 🚀 --- The operations team is not confident that we'll have the time to achieve what we originally set out to accomplish by moving to Bazel with the time and resources we have available. We have also bought ourselves some headroom with improvements to babel-register, optimizer caching, and typescript project structure. In order to make sure we deliver packages as quickly as possible (many teams really want them), with a usable and familiar developer experience, this PR removes Bazel for building packages in favor of using the same JIT transpilation we use for plugins. Additionally, packages now use `kbn_references` (again, just copying the dx from plugins to packages). Because of the complex relationships between packages/plugins and in order to prepare ourselves for automatic dependency detection tools we plan to use in the future, this PR also introduces a "TS Project Linter" which will validate that every tsconfig.json file meets a few requirements: 1. the chain of base config files extended by each config includes `tsconfig.base.json` and not `tsconfig.json` 1. the `include` config is used, and not `files` 2. the `exclude` config includes `target/**/*` 3. the `outDir` compiler option is specified as `target/types` 1. none of these compiler options are specified: `declaration`, `declarationMap`, `emitDeclarationOnly`, `skipLibCheck`, `target`, `paths` 4. all references to other packages/plugins use their pkg id, ie: ```js // valid { "kbn_references": ["@kbn/core"] } // not valid { "kbn_references": [{ "path": "../../../src/core/tsconfig.json" }] } ``` 5. only packages/plugins which are imported somewhere in the ts code are listed in `kbn_references` This linter is not only validating all of the tsconfig.json files, but it also will fix these config files to deal with just about any violation that can be produced. Just run `node scripts/ts_project_linter --fix` locally to apply these fixes, or let CI take care of automatically fixing things and pushing the changes to your PR. > **Example:** [`64e93e5` (#146212)](https://github.com/elastic/kibana/pull/146212/commits/64e93e580679dd55f4fdf19bd01402bc478a1a75) When I merged main into my PR it included a change which removed the `@kbn/core-injected-metadata-browser` package. After resolving the conflicts I missed a few tsconfig files which included references to the now removed package. The TS Project Linter identified that these references were removed from the code and pushed a change to the PR to remove them from the tsconfig.json files. ## No bazel? Does that mean no packages?? Nope! We're still doing packages but we're pretty sure now that we won't be using Bazel to accomplish the 'distributed caching' and 'change-based tasks' portions of the packages project. This PR actually makes packages much easier to work with and will be followed up with the bundling benefits described by the original packages RFC. Then we'll work on documentation and advocacy for using packages for any and all new code. We're pretty confident that implementing distributed caching and change-based tasks will be necessary in the future, but because of recent improvements in the repo we think we can live without them for **at least** a year. ## Wait, there are still BUILD.bazel files in the repo Yes, there are still three webpack bundles which are built by Bazel: the `@kbn/ui-shared-deps-npm` DLL, `@kbn/ui-shared-deps-src` externals, and the `@kbn/monaco` workers. These three webpack bundles are still created during bootstrap and remotely cached using bazel. The next phase of this project is to figure out how to get the package bundling features described in the RFC with the current optimizer, and we expect these bundles to go away then. Until then any package that is used in those three bundles still needs to have a BUILD.bazel file so that they can be referenced by the remaining webpack builds. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .bazelrc.common | 5 +- .../ci-stats/pick_test_group_run_order.ts | 8 +- .buildkite/scripts/steps/checks.sh | 8 +- .../scripts/steps/checks/bazel_packages.sh | 4 - .../scripts/steps/checks/ts_projects.sh | 10 +- .buildkite/tsconfig.json | 8 +- .eslintrc.js | 14 +- .github/CODEOWNERS | 17 +- .gitignore | 7 +- BUILD.bazel | 11 +- NOTICE.txt | 26 + dev_docs/operations/operations_landing.mdx | 2 +- docs/developer/plugin-list.asciidoc | 2 +- examples/bfetch_explorer/tsconfig.json | 14 +- examples/controls_example/tsconfig.json | 22 +- .../tsconfig.json | 17 +- .../tsconfig.json | 17 +- examples/developer_examples/tsconfig.json | 8 +- examples/embeddable_examples/tsconfig.json | 23 +- examples/embeddable_explorer/tsconfig.json | 18 +- examples/expressions_explorer/tsconfig.json | 20 +- examples/field_formats_example/tsconfig.json | 18 +- examples/files_example/tsconfig.json | 18 +- .../guided_onboarding_example/tsconfig.json | 18 +- examples/hello_world/tsconfig.json | 10 +- examples/locator_examples/tsconfig.json | 12 +- examples/locator_explorer/tsconfig.json | 14 +- .../partial_results_example/tsconfig.json | 13 +- examples/preboot_example/tsconfig.json | 13 +- examples/response_stream/tsconfig.json | 16 +- examples/routing_example/tsconfig.json | 12 +- .../screenshot_mode_example/tsconfig.json | 18 +- examples/search_examples/tsconfig.json | 31 +- examples/share_examples/tsconfig.json | 10 +- .../state_containers_examples/tsconfig.json | 20 +- examples/ui_action_examples/tsconfig.json | 11 +- examples/ui_actions_explorer/tsconfig.json | 16 +- examples/user_profile_examples/tsconfig.json | 17 +- kbn_pm/README.mdx | 2 +- kbn_pm/src/cli.mjs | 3 +- .../commands/bootstrap/bootstrap_command.mjs | 77 +- kbn_pm/src/commands/bootstrap/discovery.mjs | 38 + .../bootstrap/regenerate_base_tsconfig.mjs | 38 +- .../bootstrap/regenerate_package_map.mjs | 57 + .../regenerate_synthetic_package_map.mjs | 34 - .../commands/bootstrap/sort_package_json.mjs | 3 +- .../bootstrap/validate_package_json.mjs | 29 + .../src/commands/run_in_packages_command.mjs | 3 +- kbn_pm/src/commands/x_command.mjs | 261 +- kbn_pm/src/lib/bazel.mjs | 14 +- kbn_pm/src/lib/external_packages.js | 58 + kbn_pm/src/lib/find_clean_paths.mjs | 15 +- .../bootstrap => lib}/normalize_path.mjs | 0 .../{commands/bootstrap => lib}/plugins.mjs | 27 - kbn_pm/tsconfig.json | 20 +- package.json | 750 +- packages/BUILD.bazel | 748 - packages/analytics/client/BUILD.bazel | 137 - packages/analytics/client/kibana.jsonc | 4 +- packages/analytics/client/package.json | 7 +- packages/analytics/client/tsconfig.json | 13 +- .../shippers/elastic_v3/browser/BUILD.bazel | 136 - .../shippers/elastic_v3/browser/kibana.jsonc | 4 +- .../shippers/elastic_v3/browser/package.json | 7 +- .../shippers/elastic_v3/browser/tsconfig.json | 14 +- .../shippers/elastic_v3/common/BUILD.bazel | 132 - .../shippers/elastic_v3/common/kibana.jsonc | 4 +- .../shippers/elastic_v3/common/package.json | 7 +- .../shippers/elastic_v3/common/tsconfig.json | 12 +- .../shippers/elastic_v3/server/BUILD.bazel | 131 - .../shippers/elastic_v3/server/kibana.jsonc | 4 +- .../shippers/elastic_v3/server/package.json | 6 +- .../shippers/elastic_v3/server/tsconfig.json | 14 +- .../analytics/shippers/fullstory/BUILD.bazel | 133 - .../analytics/shippers/fullstory/kibana.jsonc | 4 +- .../analytics/shippers/fullstory/package.json | 7 +- .../shippers/fullstory/tsconfig.json | 13 +- .../analytics/shippers/gainsight/BUILD.bazel | 133 - .../analytics/shippers/gainsight/kibana.jsonc | 4 +- .../analytics/shippers/gainsight/package.json | 7 +- .../shippers/gainsight/tsconfig.json | 13 +- .../content_editor/BUILD.bazel | 149 - .../content_editor/kibana.jsonc | 2 - .../content_editor/package.json | 7 +- .../content_editor/tsconfig.json | 18 +- .../content-management/table_list/BUILD.bazel | 164 - .../table_list/kibana.jsonc | 4 +- .../table_list/package.json | 7 +- .../table_list/tsconfig.json | 20 +- .../BUILD.bazel | 126 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 19 +- .../core-analytics-browser-mocks/BUILD.bazel | 112 - .../core-analytics-browser-mocks/kibana.jsonc | 4 +- .../core-analytics-browser-mocks/package.json | 7 +- .../tsconfig.json | 14 +- .../core-analytics-browser/BUILD.bazel | 111 - .../core-analytics-browser/kibana.jsonc | 4 +- .../core-analytics-browser/package.json | 7 +- .../core-analytics-browser/tsconfig.json | 12 +- .../BUILD.bazel | 110 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../src/analytics_service.test.mocks.ts | 1 + .../tsconfig.json | 17 +- .../core-analytics-server-mocks/BUILD.bazel | 106 - .../core-analytics-server-mocks/kibana.jsonc | 4 +- .../core-analytics-server-mocks/package.json | 6 +- .../core-analytics-server-mocks/tsconfig.json | 14 +- .../core-analytics-server/BUILD.bazel | 103 - .../core-analytics-server/kibana.jsonc | 4 +- .../core-analytics-server/package.json | 6 +- .../core-analytics-server/tsconfig.json | 12 +- .../BUILD.bazel | 148 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../src/application_service.tsx | 4 +- .../tsconfig.json | 29 +- .../BUILD.bazel | 121 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 17 +- .../core-application-browser/BUILD.bazel | 120 - .../core-application-browser/kibana.jsonc | 4 +- .../core-application-browser/package.json | 7 +- .../core-application-browser/tsconfig.json | 16 +- .../core-application-common/BUILD.bazel | 115 - .../core-application-common/kibana.jsonc | 4 +- .../core-application-common/package.json | 7 +- .../core-application-common/tsconfig.json | 12 +- .../core-apps-browser-internal/BUILD.bazel | 135 - .../core-apps-browser-internal/kibana.jsonc | 4 +- .../core-apps-browser-internal/package.json | 7 +- .../core-apps-browser-internal/tsconfig.json | 33 +- .../apps/core-apps-browser-mocks/BUILD.bazel | 113 - .../apps/core-apps-browser-mocks/kibana.jsonc | 4 +- .../apps/core-apps-browser-mocks/package.json | 7 +- .../core-apps-browser-mocks/tsconfig.json | 13 +- .../core-apps-server-internal/BUILD.bazel | 141 - .../core-apps-server-internal/kibana.jsonc | 4 +- .../core-apps-server-internal/package.json | 6 +- .../register_bundle_routes.test.mocks.ts | 4 + .../register_bundle_routes.test.ts | 12 +- .../bundle_routes/register_bundle_routes.ts | 10 +- .../core-apps-server-internal/src/core_app.ts | 2 +- .../core-apps-server-internal/tsconfig.json | 31 +- .../core-base-browser-internal/BUILD.bazel | 115 - .../core-base-browser-internal/kibana.jsonc | 4 +- .../core-base-browser-internal/package.json | 7 +- .../core-base-browser-internal/tsconfig.json | 15 +- .../base/core-base-browser-mocks/BUILD.bazel | 112 - .../base/core-base-browser-mocks/kibana.jsonc | 4 +- .../base/core-base-browser-mocks/package.json | 7 +- .../core-base-browser-mocks/tsconfig.json | 13 +- .../core-base-common-internal/BUILD.bazel | 112 - .../core-base-common-internal/kibana.jsonc | 4 +- .../core-base-common-internal/package.json | 7 +- .../core-base-common-internal/tsconfig.json | 9 +- .../core/base/core-base-common/BUILD.bazel | 105 - .../core/base/core-base-common/kibana.jsonc | 4 +- .../core/base/core-base-common/package.json | 6 +- .../core/base/core-base-common/tsconfig.json | 12 +- .../core-base-server-internal/BUILD.bazel | 107 - .../core-base-server-internal/kibana.jsonc | 4 +- .../core-base-server-internal/package.json | 6 +- .../core-base-server-internal/tsconfig.json | 16 +- .../base/core-base-server-mocks/BUILD.bazel | 112 - .../base/core-base-server-mocks/kibana.jsonc | 4 +- .../base/core-base-server-mocks/package.json | 6 +- .../src/core_context.mock.ts | 2 +- .../base/core-base-server-mocks/tsconfig.json | 18 +- .../BUILD.bazel | 119 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 18 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../core-capabilities-common/BUILD.bazel | 110 - .../core-capabilities-common/kibana.jsonc | 4 +- .../core-capabilities-common/package.json | 7 +- .../core-capabilities-common/tsconfig.json | 9 +- .../BUILD.bazel | 120 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 22 +- .../BUILD.bazel | 105 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- .../core-capabilities-server/BUILD.bazel | 105 - .../core-capabilities-server/kibana.jsonc | 4 +- .../core-capabilities-server/package.json | 6 +- .../core-capabilities-server/tsconfig.json | 14 +- .../core-chrome-browser-internal/BUILD.bazel | 142 - .../core-chrome-browser-internal/kibana.jsonc | 4 +- .../core-chrome-browser-internal/package.json | 7 +- .../tsconfig.json | 31 +- .../core-chrome-browser-mocks/BUILD.bazel | 117 - .../core-chrome-browser-mocks/kibana.jsonc | 4 +- .../core-chrome-browser-mocks/package.json | 7 +- .../core-chrome-browser-mocks/tsconfig.json | 15 +- .../chrome/core-chrome-browser/BUILD.bazel | 116 - .../chrome/core-chrome-browser/kibana.jsonc | 4 +- .../chrome/core-chrome-browser/package.json | 7 +- .../chrome/core-chrome-browser/tsconfig.json | 13 +- .../core-config-server-internal/BUILD.bazel | 112 - .../core-config-server-internal/kibana.jsonc | 4 +- .../core-config-server-internal/package.json | 6 +- .../core-config-server-internal/tsconfig.json | 15 +- .../BUILD.bazel | 119 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 17 +- .../BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../core-deprecations-browser/BUILD.bazel | 112 - .../core-deprecations-browser/kibana.jsonc | 4 +- .../core-deprecations-browser/package.json | 7 +- .../core-deprecations-browser/tsconfig.json | 12 +- .../core-deprecations-common/BUILD.bazel | 111 - .../core-deprecations-common/kibana.jsonc | 4 +- .../core-deprecations-common/package.json | 7 +- .../core-deprecations-common/tsconfig.json | 9 +- .../BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 33 +- .../BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../core-deprecations-server/BUILD.bazel | 108 - .../core-deprecations-server/kibana.jsonc | 4 +- .../core-deprecations-server/package.json | 6 +- .../core-deprecations-server/tsconfig.json | 15 +- .../BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 15 +- .../core-doc-links-browser-mocks/BUILD.bazel | 115 - .../core-doc-links-browser-mocks/kibana.jsonc | 4 +- .../core-doc-links-browser-mocks/package.json | 7 +- .../tsconfig.json | 15 +- .../core-doc-links-browser/BUILD.bazel | 111 - .../core-doc-links-browser/kibana.jsonc | 4 +- .../core-doc-links-browser/package.json | 7 +- .../core-doc-links-browser/tsconfig.json | 12 +- .../BUILD.bazel | 107 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- .../core-doc-links-server-mocks/BUILD.bazel | 107 - .../core-doc-links-server-mocks/kibana.jsonc | 4 +- .../core-doc-links-server-mocks/package.json | 6 +- .../core-doc-links-server-mocks/tsconfig.json | 15 +- .../core-doc-links-server/BUILD.bazel | 103 - .../core-doc-links-server/kibana.jsonc | 4 +- .../core-doc-links-server/package.json | 6 +- .../core-doc-links-server/tsconfig.json | 12 +- .../BUILD.bazel | 121 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 21 +- .../BUILD.bazel | 106 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 140 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../src/elasticsearch_service.test.ts | 2 +- .../tsconfig.json | 34 +- .../BUILD.bazel | 109 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 16 +- .../core-elasticsearch-server/BUILD.bazel | 107 - .../core-elasticsearch-server/kibana.jsonc | 4 +- .../core-elasticsearch-server/package.json | 6 +- .../core-elasticsearch-server/tsconfig.json | 14 +- .../BUILD.bazel | 116 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 21 +- .../core-environment-server-mocks/BUILD.bazel | 103 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 117 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 16 +- .../BUILD.bazel | 113 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 112 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- .../core-execution-context-common/BUILD.bazel | 110 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 9 +- .../BUILD.bazel | 113 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 18 +- .../BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../core-execution-context-server/BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 12 +- .../BUILD.bazel | 132 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 21 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../core-fatal-errors-browser/BUILD.bazel | 113 - .../core-fatal-errors-browser/kibana.jsonc | 4 +- .../core-fatal-errors-browser/package.json | 7 +- .../core-fatal-errors-browser/tsconfig.json | 9 +- .../core-http-browser-internal/BUILD.bazel | 125 - .../core-http-browser-internal/kibana.jsonc | 4 +- .../core-http-browser-internal/package.json | 7 +- .../core-http-browser-internal/tsconfig.json | 24 +- .../http/core-http-browser-mocks/BUILD.bazel | 114 - .../http/core-http-browser-mocks/kibana.jsonc | 4 +- .../http/core-http-browser-mocks/package.json | 7 +- .../core-http-browser-mocks/tsconfig.json | 14 +- .../core/http/core-http-browser/BUILD.bazel | 112 - .../core/http/core-http-browser/kibana.jsonc | 4 +- .../core/http/core-http-browser/package.json | 7 +- .../core/http/core-http-browser/tsconfig.json | 13 +- .../core/http/core-http-common/BUILD.bazel | 110 - .../core/http/core-http-common/kibana.jsonc | 4 +- .../core/http/core-http-common/package.json | 7 +- .../core/http/core-http-common/tsconfig.json | 9 +- .../BUILD.bazel | 110 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 16 +- .../BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 23 +- .../BUILD.bazel | 108 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 16 +- .../BUILD.bazel | 113 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 23 +- .../BUILD.bazel | 108 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- .../core-http-resources-server/BUILD.bazel | 105 - .../core-http-resources-server/kibana.jsonc | 4 +- .../core-http-resources-server/package.json | 6 +- .../core-http-resources-server/tsconfig.json | 13 +- .../BUILD.bazel | 119 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 19 +- .../core-http-router-server-mocks/BUILD.bazel | 110 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- .../core-http-server-internal/BUILD.bazel | 153 - .../core-http-server-internal/kibana.jsonc | 4 +- .../core-http-server-internal/package.json | 6 +- .../src/http_service.test.ts | 2 +- .../core-http-server-internal/tsconfig.json | 33 +- .../http/core-http-server-mocks/BUILD.bazel | 123 - .../http/core-http-server-mocks/kibana.jsonc | 4 +- .../http/core-http-server-mocks/package.json | 6 +- .../core-http-server-mocks/src/test_utils.ts | 2 +- .../http/core-http-server-mocks/tsconfig.json | 22 +- .../core/http/core-http-server/BUILD.bazel | 111 - .../core/http/core-http-server/kibana.jsonc | 4 +- .../core/http/core-http-server/package.json | 6 +- .../core/http/core-http-server/tsconfig.json | 15 +- .../core-i18n-browser-internal/BUILD.bazel | 116 - .../core-i18n-browser-internal/kibana.jsonc | 4 +- .../core-i18n-browser-internal/package.json | 7 +- .../core-i18n-browser-internal/tsconfig.json | 14 +- .../i18n/core-i18n-browser-mocks/BUILD.bazel | 115 - .../i18n/core-i18n-browser-mocks/kibana.jsonc | 4 +- .../i18n/core-i18n-browser-mocks/package.json | 7 +- .../core-i18n-browser-mocks/tsconfig.json | 14 +- .../core/i18n/core-i18n-browser/BUILD.bazel | 112 - .../core/i18n/core-i18n-browser/kibana.jsonc | 4 +- .../core/i18n/core-i18n-browser/package.json | 7 +- .../core/i18n/core-i18n-browser/tsconfig.json | 11 +- .../core-i18n-server-internal/BUILD.bazel | 128 - .../core-i18n-server-internal/kibana.jsonc | 4 +- .../core-i18n-server-internal/package.json | 6 +- .../src/get_kibana_translation_files.test.ts | 2 +- .../src/get_kibana_translation_files.ts | 2 +- .../core-i18n-server-internal/tsconfig.json | 23 +- .../i18n/core-i18n-server-mocks/BUILD.bazel | 113 - .../i18n/core-i18n-server-mocks/kibana.jsonc | 4 +- .../i18n/core-i18n-server-mocks/package.json | 7 +- .../i18n/core-i18n-server-mocks/tsconfig.json | 14 +- .../core/i18n/core-i18n-server/BUILD.bazel | 104 - .../core/i18n/core-i18n-server/kibana.jsonc | 4 +- .../core/i18n/core-i18n-server/package.json | 7 +- .../core/i18n/core-i18n-server/tsconfig.json | 9 +- .../BUILD.bazel | 117 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 15 +- .../BUILD.bazel | 111 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 111 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 14 +- .../core-lifecycle-browser-mocks/BUILD.bazel | 138 - .../core-lifecycle-browser-mocks/kibana.jsonc | 4 +- .../core-lifecycle-browser-mocks/package.json | 7 +- .../tsconfig.json | 25 +- .../core-lifecycle-browser/BUILD.bazel | 125 - .../core-lifecycle-browser/kibana.jsonc | 4 +- .../core-lifecycle-browser/package.json | 7 +- .../core-lifecycle-browser/tsconfig.json | 25 +- .../BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 31 +- .../core-lifecycle-server-mocks/BUILD.bazel | 141 - .../core-lifecycle-server-mocks/kibana.jsonc | 4 +- .../core-lifecycle-server-mocks/package.json | 6 +- .../core-lifecycle-server-mocks/tsconfig.json | 33 +- .../core-lifecycle-server/BUILD.bazel | 120 - .../core-lifecycle-server/kibana.jsonc | 4 +- .../core-lifecycle-server/package.json | 6 +- .../core-lifecycle-server/tsconfig.json | 28 +- .../core-logging-browser-internal/BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../core-logging-browser-mocks/BUILD.bazel | 115 - .../core-logging-browser-mocks/kibana.jsonc | 4 +- .../core-logging-browser-mocks/package.json | 7 +- .../core-logging-browser-mocks/tsconfig.json | 13 +- .../core-logging-common-internal/BUILD.bazel | 116 - .../core-logging-common-internal/kibana.jsonc | 4 +- .../core-logging-common-internal/package.json | 7 +- .../src/logger.test.ts | 2 +- .../tsconfig.json | 12 +- .../core-logging-server-internal/BUILD.bazel | 122 - .../core-logging-server-internal/kibana.jsonc | 4 +- .../core-logging-server-internal/package.json | 6 +- .../tsconfig.json | 22 +- .../core-logging-server-mocks/BUILD.bazel | 107 - .../core-logging-server-mocks/kibana.jsonc | 4 +- .../core-logging-server-mocks/package.json | 6 +- .../core-logging-server-mocks/tsconfig.json | 16 +- .../logging/core-logging-server/BUILD.bazel | 106 - .../logging/core-logging-server/kibana.jsonc | 4 +- .../logging/core-logging-server/package.json | 6 +- .../logging/core-logging-server/tsconfig.json | 13 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 16 +- .../BUILD.bazel | 106 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 13 +- .../core-metrics-server-internal/BUILD.bazel | 125 - .../core-metrics-server-internal/kibana.jsonc | 4 +- .../core-metrics-server-internal/package.json | 6 +- .../src/logging/get_ops_metrics_log.test.ts | 8 +- .../src/ops_metrics_collector.test.ts | 8 +- .../tsconfig.json | 26 +- .../core-metrics-server-mocks/BUILD.bazel | 108 - .../core-metrics-server-mocks/kibana.jsonc | 4 +- .../core-metrics-server-mocks/package.json | 6 +- .../core-metrics-server-mocks/tsconfig.json | 15 +- .../metrics/core-metrics-server/BUILD.bazel | 104 - .../metrics/core-metrics-server/kibana.jsonc | 4 +- .../metrics/core-metrics-server/package.json | 6 +- .../metrics/core-metrics-server/tsconfig.json | 12 +- .../BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../core-mount-utils-browser/BUILD.bazel | 112 - .../core-mount-utils-browser/kibana.jsonc | 4 +- .../core-mount-utils-browser/package.json | 7 +- .../core-mount-utils-browser/tsconfig.json | 9 +- .../core-node-server-internal/BUILD.bazel | 112 - .../core-node-server-internal/kibana.jsonc | 4 +- .../core-node-server-internal/package.json | 6 +- .../core-node-server-internal/tsconfig.json | 20 +- .../node/core-node-server-mocks/BUILD.bazel | 103 - .../node/core-node-server-mocks/kibana.jsonc | 4 +- .../node/core-node-server-mocks/package.json | 6 +- .../node/core-node-server-mocks/tsconfig.json | 13 +- .../core/node/core-node-server/BUILD.bazel | 102 - .../core/node/core-node-server/kibana.jsonc | 4 +- .../core/node/core-node-server/package.json | 6 +- .../core/node/core-node-server/tsconfig.json | 9 +- .../BUILD.bazel | 139 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 26 +- .../BUILD.bazel | 107 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../core-notifications-browser/BUILD.bazel | 113 - .../core-notifications-browser/kibana.jsonc | 4 +- .../core-notifications-browser/package.json | 7 +- .../core-notifications-browser/tsconfig.json | 12 +- .../BUILD.bazel | 129 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 23 +- .../core-overlays-browser-mocks/BUILD.bazel | 106 - .../core-overlays-browser-mocks/kibana.jsonc | 4 +- .../core-overlays-browser-mocks/package.json | 6 +- .../core-overlays-browser-mocks/tsconfig.json | 15 +- .../core-overlays-browser/BUILD.bazel | 113 - .../core-overlays-browser/kibana.jsonc | 4 +- .../core-overlays-browser/package.json | 7 +- .../core-overlays-browser/tsconfig.json | 12 +- .../BUILD.bazel | 105 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 12 +- .../core-plugins-browser-internal/BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../src/plugins_service.test.ts | 2 + .../tsconfig.json | 34 +- .../core-plugins-browser-mocks/BUILD.bazel | 114 - .../core-plugins-browser-mocks/kibana.jsonc | 4 +- .../core-plugins-browser-mocks/package.json | 7 +- .../core-plugins-browser-mocks/tsconfig.json | 15 +- .../plugins/core-plugins-browser/BUILD.bazel | 114 - .../plugins/core-plugins-browser/kibana.jsonc | 4 +- .../plugins/core-plugins-browser/package.json | 7 +- .../core-plugins-browser/tsconfig.json | 15 +- .../core-plugins-server-internal/BUILD.bazel | 153 - .../core-plugins-server-internal/kibana.jsonc | 4 +- .../core-plugins-server-internal/package.json | 6 +- .../src/discovery/plugins_discovery.test.ts | 2 +- .../src/legacy_config.test.ts | 2 +- .../src/plugin.test.ts | 2 +- .../src/plugin_context.test.ts | 2 +- .../src/plugins_config.test.ts | 2 +- .../src/plugins_service.test.mocks.ts | 2 +- .../src/plugins_service.test.ts | 2 +- .../src/plugins_system.test.ts | 2 +- ...create_core_context_config_service.mock.ts | 2 +- .../tsconfig.json | 37 +- .../core-plugins-server-mocks/BUILD.bazel | 104 - .../core-plugins-server-mocks/kibana.jsonc | 4 +- .../core-plugins-server-mocks/package.json | 6 +- .../core-plugins-server-mocks/tsconfig.json | 13 +- .../plugins/core-plugins-server/BUILD.bazel | 117 - .../plugins/core-plugins-server/kibana.jsonc | 4 +- .../plugins/core-plugins-server/package.json | 6 +- .../plugins/core-plugins-server/tsconfig.json | 21 +- .../core-preboot-server-internal/BUILD.bazel | 116 - .../core-preboot-server-internal/kibana.jsonc | 4 +- .../core-preboot-server-internal/package.json | 6 +- .../src/preboot_service.test.ts | 2 +- .../tsconfig.json | 18 +- .../core-preboot-server-mocks/BUILD.bazel | 106 - .../core-preboot-server-mocks/kibana.jsonc | 4 +- .../core-preboot-server-mocks/package.json | 6 +- .../core-preboot-server-mocks/tsconfig.json | 14 +- .../preboot/core-preboot-server/BUILD.bazel | 102 - .../preboot/core-preboot-server/kibana.jsonc | 4 +- .../preboot/core-preboot-server/package.json | 6 +- .../preboot/core-preboot-server/tsconfig.json | 9 +- .../BUILD.bazel | 136 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 23 +- .../core-rendering-browser-mocks/BUILD.bazel | 112 - .../core-rendering-browser-mocks/kibana.jsonc | 4 +- .../core-rendering-browser-mocks/package.json | 7 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 125 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../src/bootstrap/bootstrap_renderer.ts | 1 + .../tsconfig.json | 32 +- .../core-rendering-server-mocks/BUILD.bazel | 104 - .../core-rendering-server-mocks/kibana.jsonc | 4 +- .../core-rendering-server-mocks/package.json | 6 +- .../core-rendering-server-mocks/tsconfig.json | 13 +- .../core-root-browser-internal/BUILD.bazel | 172 - .../core-root-browser-internal/kibana.jsonc | 4 +- .../core-root-browser-internal/package.json | 7 +- .../core-root-browser-internal/tsconfig.json | 60 +- .../core-root-server-internal/BUILD.bazel | 167 - .../core-root-server-internal/kibana.jsonc | 4 +- .../core-root-server-internal/package.json | 4 +- .../src/bootstrap.ts | 2 +- .../src/root/index.test.ts | 2 +- .../src/server.test.ts | 2 +- .../core-root-server-internal/tsconfig.json | 65 +- .../BUILD.bazel | 113 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 130 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../test_helpers/repository.test.common.ts | 2 +- .../tsconfig.json | 32 +- .../BUILD.bazel | 108 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 16 +- .../core-saved-objects-api-server/BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 12 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 18 +- .../BUILD.bazel | 103 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 122 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 19 +- .../BUILD.bazel | 113 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 16 +- .../core-saved-objects-browser/BUILD.bazel | 111 - .../core-saved-objects-browser/kibana.jsonc | 4 +- .../core-saved-objects-browser/package.json | 7 +- .../core-saved-objects-browser/tsconfig.json | 12 +- .../core-saved-objects-common/BUILD.bazel | 111 - .../core-saved-objects-common/kibana.jsonc | 4 +- .../core-saved-objects-common/package.json | 7 +- .../core-saved-objects-common/tsconfig.json | 9 +- .../BUILD.bazel | 118 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 24 +- .../BUILD.bazel | 104 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 12 +- .../BUILD.bazel | 132 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 29 +- .../BUILD.bazel | 109 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 131 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../src/saved_objects_service.test.ts | 2 +- .../tsconfig.json | 46 +- .../BUILD.bazel | 118 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 19 +- .../core-saved-objects-server/BUILD.bazel | 111 - .../core-saved-objects-server/kibana.jsonc | 4 +- .../core-saved-objects-server/package.json | 6 +- .../core-saved-objects-server/tsconfig.json | 19 +- .../BUILD.bazel | 110 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 13 +- .../core-status-common-internal/BUILD.bazel | 113 - .../core-status-common-internal/kibana.jsonc | 4 +- .../core-status-common-internal/package.json | 7 +- .../core-status-common-internal/tsconfig.json | 13 +- .../status/core-status-common/BUILD.bazel | 114 - .../status/core-status-common/kibana.jsonc | 4 +- .../status/core-status-common/package.json | 7 +- .../status/core-status-common/tsconfig.json | 12 +- .../core-status-server-internal/BUILD.bazel | 132 - .../core-status-server-internal/kibana.jsonc | 4 +- .../core-status-server-internal/package.json | 6 +- .../core-status-server-internal/tsconfig.json | 40 +- .../core-status-server-mocks/BUILD.bazel | 108 - .../core-status-server-mocks/kibana.jsonc | 4 +- .../core-status-server-mocks/package.json | 6 +- .../core-status-server-mocks/tsconfig.json | 15 +- .../status/core-status-server/BUILD.bazel | 106 - .../status/core-status-server/kibana.jsonc | 4 +- .../status/core-status-server/package.json | 6 +- .../status/core-status-server/tsconfig.json | 12 +- .../BUILD.bazel | 108 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 118 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 15 +- .../core-test-helpers-kbn-server/BUILD.bazel | 121 - .../core-test-helpers-kbn-server/kibana.jsonc | 4 +- .../core-test-helpers-kbn-server/package.json | 2 - .../src/create_root.ts | 2 +- .../tsconfig.json | 17 +- .../BUILD.bazel | 109 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- .../core-test-helpers-test-utils/BUILD.bazel | 124 - .../core-test-helpers-test-utils/kibana.jsonc | 4 +- .../core-test-helpers-test-utils/package.json | 6 +- .../tsconfig.json | 22 +- .../core-theme-browser-internal/BUILD.bazel | 125 - .../core-theme-browser-internal/kibana.jsonc | 4 +- .../core-theme-browser-internal/package.json | 7 +- .../core-theme-browser-internal/tsconfig.json | 17 +- .../core-theme-browser-mocks/BUILD.bazel | 115 - .../core-theme-browser-mocks/kibana.jsonc | 4 +- .../core-theme-browser-mocks/package.json | 7 +- .../core-theme-browser-mocks/tsconfig.json | 14 +- .../core/theme/core-theme-browser/BUILD.bazel | 111 - .../theme/core-theme-browser/kibana.jsonc | 4 +- .../theme/core-theme-browser/package.json | 7 +- .../theme/core-theme-browser/tsconfig.json | 9 +- .../BUILD.bazel | 118 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 18 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- .../core-ui-settings-browser/BUILD.bazel | 113 - .../core-ui-settings-browser/kibana.jsonc | 4 +- .../core-ui-settings-browser/package.json | 7 +- .../core-ui-settings-browser/tsconfig.json | 12 +- .../core-ui-settings-common/BUILD.bazel | 112 - .../core-ui-settings-common/kibana.jsonc | 4 +- .../core-ui-settings-common/package.json | 7 +- .../core-ui-settings-common/tsconfig.json | 13 +- .../BUILD.bazel | 127 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../src/clients/ui_settings_client_factory.ts | 2 +- .../tsconfig.json | 33 +- .../core-ui-settings-server-mocks/BUILD.bazel | 105 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../core-ui-settings-server/BUILD.bazel | 105 - .../core-ui-settings-server/kibana.jsonc | 4 +- .../core-ui-settings-server/package.json | 6 +- .../core-ui-settings-server/tsconfig.json | 13 +- .../BUILD.bazel | 107 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../BUILD.bazel | 128 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 34 +- .../core-usage-data-server-mocks/BUILD.bazel | 108 - .../core-usage-data-server-mocks/kibana.jsonc | 4 +- .../core-usage-data-server-mocks/package.json | 6 +- .../tsconfig.json | 15 +- .../core-usage-data-server/BUILD.bazel | 104 - .../core-usage-data-server/kibana.jsonc | 4 +- .../core-usage-data-server/package.json | 6 +- .../core-usage-data-server/tsconfig.json | 9 +- packages/home/sample_data_card/BUILD.bazel | 152 - packages/home/sample_data_card/kibana.jsonc | 4 +- packages/home/sample_data_card/package.json | 5 +- packages/home/sample_data_card/tsconfig.json | 14 +- packages/home/sample_data_tab/BUILD.bazel | 146 - packages/home/sample_data_tab/kibana.jsonc | 4 +- packages/home/sample_data_tab/package.json | 5 +- packages/home/sample_data_tab/tsconfig.json | 14 +- packages/home/sample_data_types/BUILD.bazel | 58 - packages/home/sample_data_types/kibana.jsonc | 4 +- packages/home/sample_data_types/package.json | 3 +- packages/home/sample_data_types/tsconfig.json | 9 +- packages/kbn-ace/BUILD.bazel | 131 - packages/kbn-ace/kibana.jsonc | 4 +- packages/kbn-ace/package.json | 7 +- packages/kbn-ace/tsconfig.json | 9 +- packages/kbn-alerts/BUILD.bazel | 123 - packages/kbn-alerts/kibana.jsonc | 4 +- packages/kbn-alerts/package.json | 7 +- packages/kbn-alerts/tsconfig.json | 12 +- packages/kbn-ambient-common-types/BUILD.bazel | 58 - packages/kbn-ambient-common-types/README.mdx | 5 +- .../kbn-ambient-common-types/kibana.jsonc | 4 +- .../kbn-ambient-common-types/package.json | 2 - .../kbn-ambient-common-types/tsconfig.json | 9 +- packages/kbn-ambient-ftr-types/BUILD.bazel | 58 - packages/kbn-ambient-ftr-types/kibana.jsonc | 4 +- packages/kbn-ambient-ftr-types/package.json | 2 - packages/kbn-ambient-ftr-types/tsconfig.json | 9 +- .../kbn-ambient-storybook-types/BUILD.bazel | 64 - .../kbn-ambient-storybook-types/README.mdx | 6 +- .../kbn-ambient-storybook-types/kibana.jsonc | 4 +- .../kbn-ambient-storybook-types/tsconfig.json | 9 +- packages/kbn-ambient-ui-types/BUILD.bazel | 59 - packages/kbn-ambient-ui-types/README.mdx | 6 +- packages/kbn-ambient-ui-types/kibana.jsonc | 4 +- packages/kbn-ambient-ui-types/tsconfig.json | 9 +- packages/kbn-analytics/BUILD.bazel | 104 +- packages/kbn-analytics/kibana.jsonc | 4 +- packages/kbn-analytics/package.json | 5 +- packages/kbn-analytics/tsconfig.json | 9 +- packages/kbn-apm-config-loader/BUILD.bazel | 116 - packages/kbn-apm-config-loader/kibana.jsonc | 4 +- packages/kbn-apm-config-loader/package.json | 4 +- packages/kbn-apm-config-loader/tsconfig.json | 14 +- packages/kbn-apm-synthtrace/BUILD.bazel | 127 - packages/kbn-apm-synthtrace/kibana.jsonc | 4 +- packages/kbn-apm-synthtrace/package.json | 6 +- packages/kbn-apm-synthtrace/tsconfig.json | 14 +- packages/kbn-apm-utils/BUILD.bazel | 106 - packages/kbn-apm-utils/kibana.jsonc | 4 +- packages/kbn-apm-utils/package.json | 6 +- packages/kbn-apm-utils/tsconfig.json | 9 +- packages/kbn-axe-config/BUILD.bazel | 130 - packages/kbn-axe-config/kibana.jsonc | 4 +- packages/kbn-axe-config/package.json | 7 +- packages/kbn-axe-config/tsconfig.json | 9 +- .../BUILD.bazel | 31 + .../README.mdx | 11 + .../babel_plugin_package_imports.js} | 128 +- .../index.js} | 2 +- .../kibana.jsonc | 6 + .../package.json | 6 + .../tsconfig.json | 22 + .../kbn-babel-plugin-package-imports/types.ts | 8 +- .../BUILD.bazel | 62 - .../README.mdx | 13 - .../kibana.jsonc | 8 - .../package.json | 7 - packages/kbn-babel-preset/BUILD.bazel | 15 +- .../common_babel_parser_options.js | 1 + packages/kbn-babel-preset/common_preset.js | 13 +- packages/kbn-babel-preset/kibana.jsonc | 4 +- packages/kbn-babel-preset/tsconfig.json | 12 + packages/kbn-babel-preset/webpack_preset.js | 4 +- packages/kbn-babel-register/BUILD.bazel | 50 + packages/kbn-babel-register/README.md | 3 + packages/kbn-babel-register/cache/index.js | 80 + .../kbn-babel-register/cache/lmdb_cache.js | 280 + .../cache/lmdb_cache.test.ts} | 8 +- .../cache/no_cache_cache.js | 36 + packages/kbn-babel-register/cache/types.ts | 24 + packages/kbn-babel-register/index.js | 137 + .../install.js} | 2 +- .../jest.config.js | 2 +- packages/kbn-babel-register/kibana.jsonc | 6 + packages/kbn-babel-register/package.json | 6 + .../kbn-babel-register/transforms/babel.js | 35 + .../kbn-babel-register/transforms/index.js | 17 + .../transforms/peggy.js} | 13 +- .../transforms/types.ts} | 2 +- packages/kbn-babel-register/tsconfig.json | 24 + packages/kbn-babel-transform/BUILD.bazel | 33 + packages/kbn-babel-transform/README.md | 3 + .../fast_async_transformer.js | 53 + .../fast_async_worker.mjs} | 15 +- .../index.js} | 24 +- .../jest.config.js | 2 +- packages/kbn-babel-transform/kibana.jsonc | 6 + packages/kbn-babel-transform/options.js | 39 + packages/kbn-babel-transform/package.json | 6 + .../kbn-babel-transform/sync_transform.js | 38 + packages/kbn-babel-transform/tsconfig.json | 18 + packages/kbn-babel-transform/types.ts | 28 + packages/kbn-bazel-packages/BUILD.bazel | 126 - packages/kbn-bazel-packages/kibana.jsonc | 4 +- packages/kbn-bazel-packages/package.json | 4 +- .../kbn-bazel-packages/src/bazel_package.js | 37 +- .../src/bazel_package.test.ts | 60 - .../src/parse_package_manifest.js | 13 +- packages/kbn-bazel-packages/src/types.ts | 10 - packages/kbn-bazel-packages/tsconfig.json | 9 +- packages/kbn-bazel-runner/BUILD.bazel | 133 - packages/kbn-bazel-runner/kibana.jsonc | 4 +- packages/kbn-bazel-runner/package.json | 6 +- packages/kbn-bazel-runner/tsconfig.json | 11 +- packages/kbn-cases-components/BUILD.bazel | 123 - packages/kbn-cases-components/kibana.jsonc | 4 +- packages/kbn-cases-components/package.json | 7 +- packages/kbn-cases-components/tsconfig.json | 12 +- packages/kbn-chart-icons/BUILD.bazel | 142 - packages/kbn-chart-icons/kibana.jsonc | 4 +- packages/kbn-chart-icons/package.json | 7 +- packages/kbn-chart-icons/tsconfig.json | 12 +- packages/kbn-ci-stats-core/BUILD.bazel | 125 - packages/kbn-ci-stats-core/kibana.jsonc | 4 +- packages/kbn-ci-stats-core/package.json | 4 +- packages/kbn-ci-stats-core/tsconfig.json | 12 +- .../BUILD.bazel | 132 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- packages/kbn-ci-stats-reporter/BUILD.bazel | 131 - packages/kbn-ci-stats-reporter/kibana.jsonc | 4 +- packages/kbn-ci-stats-reporter/package.json | 4 +- .../src/ci_stats_reporter.ts | 2 +- packages/kbn-ci-stats-reporter/tsconfig.json | 15 +- packages/kbn-cli-dev-mode/BUILD.bazel | 144 - packages/kbn-cli-dev-mode/kibana.jsonc | 4 +- packages/kbn-cli-dev-mode/package.json | 4 +- packages/kbn-cli-dev-mode/src/bootstrap.ts | 2 +- .../kbn-cli-dev-mode/src/cli_dev_mode.test.ts | 2 +- packages/kbn-cli-dev-mode/src/cli_dev_mode.ts | 2 +- .../src/get_server_watch_paths.test.ts | 10 +- .../src/get_server_watch_paths.ts | 4 +- packages/kbn-cli-dev-mode/tsconfig.json | 22 +- packages/kbn-coloring/BUILD.bazel | 155 - packages/kbn-coloring/kibana.jsonc | 4 +- packages/kbn-coloring/package.json | 7 +- packages/kbn-coloring/tsconfig.json | 17 +- packages/kbn-config-mocks/BUILD.bazel | 108 - packages/kbn-config-mocks/kibana.jsonc | 4 +- packages/kbn-config-mocks/package.json | 6 +- packages/kbn-config-mocks/src/env.mock.ts | 2 +- packages/kbn-config-mocks/tsconfig.json | 15 +- packages/kbn-config-schema/BUILD.bazel | 116 - packages/kbn-config-schema/kibana.jsonc | 4 +- packages/kbn-config-schema/package.json | 4 +- packages/kbn-config-schema/tsconfig.json | 9 +- packages/kbn-config/BUILD.bazel | 135 - packages/kbn-config/kibana.jsonc | 4 +- packages/kbn-config/package.json | 4 +- packages/kbn-config/tsconfig.json | 20 +- packages/kbn-crypto-browser/BUILD.bazel | 110 - packages/kbn-crypto-browser/kibana.jsonc | 4 +- packages/kbn-crypto-browser/package.json | 7 +- packages/kbn-crypto-browser/tsconfig.json | 9 +- packages/kbn-crypto/BUILD.bazel | 113 - packages/kbn-crypto/kibana.jsonc | 4 +- packages/kbn-crypto/package.json | 6 +- packages/kbn-crypto/tsconfig.json | 14 +- packages/kbn-cypress-config/README.md | 3 + packages/kbn-cypress-config/index.ts | 58 + .../jest.config.js | 2 +- packages/kbn-cypress-config/kibana.jsonc | 6 + packages/kbn-cypress-config/package.json | 6 + packages/kbn-cypress-config/tsconfig.json | 17 + packages/kbn-datemath/BUILD.bazel | 85 +- packages/kbn-datemath/kibana.jsonc | 4 +- packages/kbn-datemath/package.json | 4 +- packages/kbn-datemath/tsconfig.json | 9 +- packages/kbn-dev-cli-errors/BUILD.bazel | 122 - packages/kbn-dev-cli-errors/kibana.jsonc | 4 +- packages/kbn-dev-cli-errors/package.json | 4 +- packages/kbn-dev-cli-errors/tsconfig.json | 9 +- packages/kbn-dev-cli-runner/BUILD.bazel | 145 - packages/kbn-dev-cli-runner/kibana.jsonc | 4 +- packages/kbn-dev-cli-runner/package.json | 4 +- packages/kbn-dev-cli-runner/src/metrics.ts | 2 +- packages/kbn-dev-cli-runner/tsconfig.json | 17 +- packages/kbn-dev-proc-runner/BUILD.bazel | 138 - packages/kbn-dev-proc-runner/kibana.jsonc | 4 +- packages/kbn-dev-proc-runner/package.json | 4 +- packages/kbn-dev-proc-runner/tsconfig.json | 14 +- packages/kbn-dev-utils/BUILD.bazel | 187 - packages/kbn-dev-utils/index.ts | 1 - packages/kbn-dev-utils/kibana.jsonc | 4 +- packages/kbn-dev-utils/package.json | 4 +- .../src/plugin_list/discover_plugins.ts | 2 +- .../src/plugin_list/generate_plugin_list.ts | 2 +- .../src/plugin_list/run_plugin_list_cli.ts | 2 +- .../kbn-dev-utils/src/precommit_hook/cli.ts | 2 +- .../src/precommit_hook/git_utils.ts | 2 +- packages/kbn-dev-utils/tsconfig.json | 16 +- packages/kbn-doc-links/BUILD.bazel | 116 - packages/kbn-doc-links/kibana.jsonc | 4 +- packages/kbn-doc-links/package.json | 5 +- packages/kbn-doc-links/tsconfig.json | 12 +- packages/kbn-docs-utils/BUILD.bazel | 120 - packages/kbn-docs-utils/kibana.jsonc | 4 +- packages/kbn-docs-utils/package.json | 4 +- .../extract_import_refs.test.ts | 2 +- .../api_docs/build_api_declarations/utils.ts | 2 +- .../src/api_docs/build_api_docs_cli.ts | 2 +- .../src/api_docs/find_plugins.ts | 2 +- .../api_docs/trim_deleted_docs_from_nav.ts | 2 +- packages/kbn-docs-utils/tsconfig.json | 18 +- packages/kbn-ebt-tools/BUILD.bazel | 106 - packages/kbn-ebt-tools/kibana.jsonc | 4 +- packages/kbn-ebt-tools/package.json | 5 +- packages/kbn-ebt-tools/tsconfig.json | 13 +- packages/kbn-ecs/BUILD.bazel | 104 - packages/kbn-ecs/kibana.jsonc | 4 +- packages/kbn-ecs/package.json | 4 +- packages/kbn-ecs/tsconfig.json | 9 +- packages/kbn-es-archiver/BUILD.bazel | 128 - packages/kbn-es-archiver/kibana.jsonc | 4 +- packages/kbn-es-archiver/package.json | 6 +- packages/kbn-es-archiver/src/actions/load.ts | 4 +- .../src/actions/rebuild_all.ts | 3 +- packages/kbn-es-archiver/src/actions/save.ts | 3 +- .../kbn-es-archiver/src/actions/unload.ts | 5 +- packages/kbn-es-archiver/src/es_archiver.ts | 2 +- .../src/lib/archives/parse.test.ts | 8 +- .../kbn-es-archiver/src/lib/archives/parse.ts | 2 +- packages/kbn-es-archiver/tsconfig.json | 19 +- packages/kbn-es-errors/BUILD.bazel | 105 - packages/kbn-es-errors/kibana.jsonc | 4 +- packages/kbn-es-errors/package.json | 6 +- packages/kbn-es-errors/tsconfig.json | 9 +- packages/kbn-es-query/BUILD.bazel | 110 +- packages/kbn-es-query/kibana.jsonc | 4 +- packages/kbn-es-query/package.json | 5 +- .../filters/helpers/compare_filters.test.ts | 2 +- .../src/kuery/grammar/__mocks__/index.ts | 2 +- packages/kbn-es-query/tsconfig.json | 14 +- packages/kbn-es-types/BUILD.bazel | 105 - packages/kbn-es-types/kibana.jsonc | 4 +- packages/kbn-es-types/package.json | 6 +- packages/kbn-es-types/tsconfig.json | 9 +- packages/kbn-es/BUILD.bazel | 78 - packages/kbn-es/index.ts | 2 - packages/kbn-es/kibana.jsonc | 4 +- packages/kbn-es/package.json | 1 - packages/kbn-es/src/{cli.js => cli.ts} | 29 +- packages/kbn-es/src/cli_commands/archive.js | 69 - packages/kbn-es/src/cli_commands/archive.ts | 68 + .../src/cli_commands/build_snapshots.js | 82 - .../src/cli_commands/build_snapshots.ts | 83 + packages/kbn-es/src/cli_commands/index.ts | 19 + packages/kbn-es/src/cli_commands/snapshot.js | 103 - packages/kbn-es/src/cli_commands/snapshot.ts | 107 + packages/kbn-es/src/cli_commands/source.js | 80 - packages/kbn-es/src/cli_commands/source.ts | 81 + .../src/cli_commands/types.ts} | 10 +- packages/kbn-es/src/cluster_exec_options.ts | 1 + .../src/integration_tests/cluster.test.js | 1 + ...onfig_files.js => extract_config_files.ts} | 24 +- packages/kbn-es/src/utils/index.ts | 2 - .../{parse_es_log.js => parse_es_log.ts} | 11 +- packages/kbn-es/tsconfig.json | 14 +- packages/kbn-eslint-config/.eslintrc.js | 11 + packages/kbn-eslint-config/BUILD.bazel | 57 - packages/kbn-eslint-config/kibana.jsonc | 4 +- packages/kbn-eslint-config/react.js | 4 +- packages/kbn-eslint-config/typescript.js | 3 - .../kbn-eslint-plugin-disable/BUILD.bazel | 125 - .../kbn-eslint-plugin-disable/kibana.jsonc | 4 +- .../kbn-eslint-plugin-disable/package.json | 6 +- .../kbn-eslint-plugin-disable/tsconfig.json | 9 +- packages/kbn-eslint-plugin-eslint/BUILD.bazel | 69 - .../helpers/exports.js | 2 +- .../kbn-eslint-plugin-eslint/kibana.jsonc | 4 +- .../kbn-eslint-plugin-imports/BUILD.bazel | 137 - .../kbn-eslint-plugin-imports/kibana.jsonc | 4 +- .../kbn-eslint-plugin-imports/package.json | 6 +- .../src/get_import_resolver.ts | 2 +- .../src/rules/uniform_imports.ts | 17 +- .../kbn-eslint-plugin-imports/tsconfig.json | 14 +- packages/kbn-expect/BUILD.bazel | 44 - packages/kbn-expect/kibana.jsonc | 4 +- packages/kbn-expect/tsconfig.json | 7 +- .../kbn-failed-test-reporter-cli/BUILD.bazel | 144 - .../failed_tests_reporter_cli.ts | 2 +- .../report_failures_to_file.ts | 2 +- .../kbn-failed-test-reporter-cli/kibana.jsonc | 4 +- .../kbn-failed-test-reporter-cli/package.json | 6 +- .../tsconfig.json | 20 +- packages/kbn-field-types/BUILD.bazel | 121 - packages/kbn-field-types/kibana.jsonc | 4 +- packages/kbn-field-types/package.json | 7 +- packages/kbn-field-types/tsconfig.json | 9 +- .../kbn-find-used-node-modules/BUILD.bazel | 130 - .../kbn-find-used-node-modules/kibana.jsonc | 4 +- .../kbn-find-used-node-modules/package.json | 6 +- .../src/find_used_node_modules.test.ts | 13 +- .../src/find_used_node_modules.ts | 185 +- packages/kbn-find-used-node-modules/src/fs.ts | 10 +- .../src/get_import_requests.ts | 1 - .../kbn-find-used-node-modules/tsconfig.json | 13 +- packages/kbn-flot-charts/BUILD.bazel | 13 - packages/kbn-flot-charts/kibana.jsonc | 4 +- packages/kbn-flot-charts/tsconfig.json | 15 + .../BUILD.bazel | 125 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 14 +- .../kbn-ftr-screenshot-filename/BUILD.bazel | 123 - .../kbn-ftr-screenshot-filename/kibana.jsonc | 4 +- .../kbn-ftr-screenshot-filename/package.json | 6 +- .../kbn-ftr-screenshot-filename/tsconfig.json | 9 +- packages/kbn-generate/BUILD.bazel | 119 - packages/kbn-generate/kibana.jsonc | 4 +- packages/kbn-generate/package.json | 4 +- packages/kbn-generate/src/cli.ts | 3 +- .../src/commands/codeowners_command.ts | 2 +- .../src/commands/package_command.ts | 17 +- .../packages_build_manifest_command.ts | 50 - packages/kbn-generate/src/lib/render.ts | 2 +- packages/kbn-generate/src/paths.ts | 4 +- .../templates/package/BUILD.bazel.ejs | 138 - .../templates/package/kibana.jsonc.ejs | 6 +- .../templates/package/package.json.ejs | 7 +- .../templates/package/tsconfig.json.ejs | 12 +- .../templates/packages_BUILD.bazel.ejs | 42 - packages/kbn-generate/tsconfig.json | 17 +- packages/kbn-get-repo-files/BUILD.bazel | 124 - packages/kbn-get-repo-files/kibana.jsonc | 4 +- packages/kbn-get-repo-files/package.json | 4 +- .../kbn-get-repo-files/src/get_repo_files.ts | 12 +- packages/kbn-get-repo-files/tsconfig.json | 13 +- packages/kbn-guided-onboarding/BUILD.bazel | 150 - packages/kbn-guided-onboarding/kibana.jsonc | 4 +- packages/kbn-guided-onboarding/package.json | 7 +- packages/kbn-guided-onboarding/tsconfig.json | 13 +- packages/kbn-handlebars/BUILD.bazel | 118 - packages/kbn-handlebars/kibana.jsonc | 4 +- packages/kbn-handlebars/package.json | 5 +- packages/kbn-handlebars/tsconfig.json | 9 +- packages/kbn-hapi-mocks/BUILD.bazel | 108 - packages/kbn-hapi-mocks/kibana.jsonc | 4 +- packages/kbn-hapi-mocks/package.json | 6 +- packages/kbn-hapi-mocks/tsconfig.json | 12 +- .../kbn-health-gateway-server/BUILD.bazel | 127 - .../kbn-health-gateway-server/kibana.jsonc | 4 +- .../kbn-health-gateway-server/package.json | 8 +- .../src/config/config_service.test.ts | 2 +- .../src/config/config_service.ts | 2 +- .../kbn-health-gateway-server/tsconfig.json | 21 +- packages/kbn-i18n-react/BUILD.bazel | 99 +- packages/kbn-i18n-react/kibana.jsonc | 4 +- packages/kbn-i18n-react/package.json | 5 +- packages/kbn-i18n-react/tsconfig.json | 12 +- packages/kbn-i18n/BUILD.bazel | 98 +- packages/kbn-i18n/kibana.jsonc | 4 +- packages/kbn-i18n/package.json | 6 +- packages/kbn-i18n/tsconfig.json | 10 +- packages/kbn-import-resolver/BUILD.bazel | 134 - packages/kbn-import-resolver/kibana.jsonc | 4 +- packages/kbn-import-resolver/package.json | 6 +- .../src/helpers/import_req.ts | 47 +- .../src/import_resolver.ts | 120 +- .../integration_tests/import_resolver.test.ts | 39 +- .../kbn-import-resolver/src/resolve_result.ts | 1 + packages/kbn-import-resolver/tsconfig.json | 15 +- packages/kbn-interpreter/BUILD.bazel | 130 - packages/kbn-interpreter/kibana.jsonc | 4 +- packages/kbn-interpreter/package.json | 5 +- .../common/lib/ast/from_expression.test.js | 2 +- .../src/common/lib/ast/to_expression.test.js | 2 +- packages/kbn-interpreter/tsconfig.json | 11 +- packages/kbn-io-ts-utils/BUILD.bazel | 122 - packages/kbn-io-ts-utils/kibana.jsonc | 4 +- packages/kbn-io-ts-utils/package.json | 7 +- packages/kbn-io-ts-utils/tsconfig.json | 12 +- packages/kbn-jest-serializers/BUILD.bazel | 126 - packages/kbn-jest-serializers/kibana.jsonc | 4 +- packages/kbn-jest-serializers/package.json | 6 +- .../src/absolute_path_serializer.ts | 2 +- packages/kbn-jest-serializers/tsconfig.json | 12 +- packages/kbn-journeys/BUILD.bazel | 132 - .../kbn-journeys/journey/journey_config.ts | 2 +- .../journey/journey_ftr_config.ts | 4 +- .../journey/journey_screenshots.ts | 2 +- packages/kbn-journeys/kibana.jsonc | 4 +- packages/kbn-journeys/package.json | 6 +- packages/kbn-journeys/tsconfig.json | 17 +- .../kbn-kibana-manifest-schema/BUILD.bazel | 126 - .../kbn-kibana-manifest-schema/kibana.jsonc | 4 +- .../kbn-kibana-manifest-schema/package.json | 4 +- .../src/kibana_json_v2_schema.ts | 22 +- .../kbn-kibana-manifest-schema/tsconfig.json | 9 +- .../BUILD.bazel | 135 - .../kibana.jsonc | 4 +- .../package.json | 5 +- .../tsconfig.json | 13 +- packages/kbn-logging-mocks/BUILD.bazel | 106 - packages/kbn-logging-mocks/kibana.jsonc | 4 +- packages/kbn-logging-mocks/package.json | 4 +- packages/kbn-logging-mocks/tsconfig.json | 12 +- packages/kbn-logging/BUILD.bazel | 110 - packages/kbn-logging/kibana.jsonc | 4 +- packages/kbn-logging/package.json | 4 +- packages/kbn-logging/tsconfig.json | 13 +- .../kbn-managed-vscode-config-cli/BUILD.bazel | 126 - .../kbn-managed-vscode-config-cli/index.ts | 2 +- .../kibana.jsonc | 4 +- .../package.json | 4 +- .../tsconfig.json | 14 +- .../kbn-managed-vscode-config/BUILD.bazel | 128 - .../kbn-managed-vscode-config/kibana.jsonc | 4 +- .../kbn-managed-vscode-config/package.json | 4 +- .../kbn-managed-vscode-config/tsconfig.json | 12 +- packages/kbn-mapbox-gl/BUILD.bazel | 118 - packages/kbn-mapbox-gl/kibana.jsonc | 4 +- packages/kbn-mapbox-gl/package.json | 7 +- packages/kbn-mapbox-gl/tsconfig.json | 9 +- packages/kbn-monaco/BUILD.bazel | 131 +- packages/kbn-monaco/index.ts | 1 - packages/kbn-monaco/kibana.jsonc | 4 +- packages/kbn-monaco/package.json | 6 +- packages/kbn-monaco/server.ts | 18 + packages/kbn-monaco/src/register_globals.ts | 45 +- packages/kbn-monaco/src/workers_registry.ts | 31 - packages/kbn-monaco/tsconfig.json | 26 +- packages/kbn-monaco/webpack.config.js | 8 +- .../kbn-optimizer-webpack-helpers/BUILD.bazel | 123 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 9 +- packages/kbn-optimizer/BUILD.bazel | 169 - packages/kbn-optimizer/index.ts | 1 - packages/kbn-optimizer/kibana.jsonc | 4 +- packages/kbn-optimizer/package.json | 4 +- ..._babel_runtime_helpers_in_entry_bundles.ts | 2 +- ...libs_browser_polyfills_in_entry_bundles.ts | 2 +- .../find_target_node_imports.ts | 56 - .../src/audit_bundle_dependencies/index.ts | 1 - packages/kbn-optimizer/src/cli.ts | 2 +- .../basic_optimization.test.ts | 10 +- .../optimizer_built_paths.test.ts | 103 +- packages/kbn-optimizer/src/node/cache.ts | 211 - .../src/node/node_auto_tranpilation.ts | 160 - .../src/node/transforms/babel.ts | 52 - .../handle_optimizer_completion.test.ts | 2 +- .../src/optimizer/observe_worker.ts | 39 +- .../src/optimizer/optimizer_built_paths.ts | 1 + .../src/optimizer/optimizer_cache_key.test.ts | 4 +- .../src/optimizer/optimizer_cache_key.ts | 2 +- .../src/optimizer/optimizer_config.test.ts | 2 +- .../worker/populate_bundle_cache_plugin.ts | 32 +- .../src/worker/webpack.config.ts | 19 +- packages/kbn-optimizer/tsconfig.json | 25 +- packages/kbn-osquery-io-ts-types/BUILD.bazel | 125 - packages/kbn-osquery-io-ts-types/kibana.jsonc | 4 +- packages/kbn-osquery-io-ts-types/package.json | 7 +- .../kbn-osquery-io-ts-types/tsconfig.json | 9 +- packages/kbn-package-map/BUILD.bazel | 16 + .../index.d.ts | 0 .../index.js | 2 +- packages/kbn-package-map/kibana.jsonc | 6 + .../package.json | 2 +- packages/kbn-package-map/tsconfig.json | 15 + packages/kbn-peggy-loader/BUILD.bazel | 106 +- packages/kbn-peggy-loader/kibana.jsonc | 4 +- packages/kbn-peggy-loader/package.json | 2 - packages/kbn-peggy-loader/tsconfig.json | 12 +- packages/kbn-peggy/BUILD.bazel | 105 +- packages/kbn-peggy/README.mdx | 6 +- packages/kbn-peggy/index.js | 94 + packages/kbn-peggy/index.ts | 133 - packages/kbn-peggy/kibana.jsonc | 4 +- packages/kbn-peggy/package.json | 2 - packages/kbn-peggy/tsconfig.json | 13 +- packages/kbn-peggy/types.ts | 64 + .../BUILD.bazel | 133 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 15 +- packages/kbn-plugin-discovery/BUILD.bazel | 124 - packages/kbn-plugin-discovery/kibana.jsonc | 4 +- packages/kbn-plugin-discovery/package.json | 6 +- packages/kbn-plugin-discovery/tsconfig.json | 8 +- packages/kbn-plugin-generator/BUILD.bazel | 136 - packages/kbn-plugin-generator/kibana.jsonc | 4 +- packages/kbn-plugin-generator/package.json | 4 +- .../kbn-plugin-generator/src/ask_questions.ts | 2 +- packages/kbn-plugin-generator/src/cli.ts | 2 +- .../integration_tests/generate_plugin.test.ts | 2 +- .../kbn-plugin-generator/src/plugin_types.ts | 2 +- .../src/render_template.ts | 4 +- packages/kbn-plugin-generator/tsconfig.json | 17 +- packages/kbn-plugin-helpers/BUILD.bazel | 129 - packages/kbn-plugin-helpers/kibana.jsonc | 4 +- packages/kbn-plugin-helpers/package.json | 4 +- .../src/integration_tests/build.test.ts | 2 +- .../src/load_kibana_platform_plugin.ts | 2 +- .../kbn-plugin-helpers/src/tasks/optimize.ts | 2 +- .../src/tasks/transform_file_with_babel.ts} | 0 .../src/tasks/write_server_files.ts | 3 +- packages/kbn-plugin-helpers/tsconfig.json | 20 +- packages/kbn-react-field/BUILD.bazel | 133 - packages/kbn-react-field/kibana.jsonc | 4 +- packages/kbn-react-field/package.json | 5 +- packages/kbn-react-field/tsconfig.json | 9 +- packages/kbn-repo-info/BUILD.bazel | 36 + packages/kbn-repo-info/README.md | 3 + .../repo_root.ts => kbn-repo-info/index.js} | 44 +- .../jest.config.js} | 4 +- packages/kbn-repo-info/kibana.jsonc | 5 + packages/kbn-repo-info/package.json | 6 + packages/kbn-repo-info/tsconfig.json | 18 + .../index.ts => kbn-repo-info/types.ts} | 26 +- packages/kbn-repo-path/README.md | 3 + .../kbn-repo-path/index.ts | 2 +- packages/kbn-repo-path/jest.config.js | 13 + packages/kbn-repo-path/kibana.jsonc | 6 + packages/kbn-repo-path/package.json | 6 + packages/kbn-repo-path/repo_path.ts | 71 + packages/kbn-repo-path/tsconfig.json | 17 + .../BUILD.bazel | 134 - .../kbn-repo-source-classifier-cli/index.ts | 2 +- .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 17 +- .../kbn-repo-source-classifier/BUILD.bazel | 125 - .../kbn-repo-source-classifier/kibana.jsonc | 4 +- .../kbn-repo-source-classifier/package.json | 6 +- .../kbn-repo-source-classifier/src/config.ts | 1 + .../src/repo_path.ts | 2 +- .../src/repo_source_classifier.ts | 30 +- .../kbn-repo-source-classifier/tsconfig.json | 13 +- packages/kbn-rison/BUILD.bazel | 103 +- packages/kbn-rison/kibana.jsonc | 4 +- packages/kbn-rison/package.json | 2 - packages/kbn-rison/tsconfig.json | 9 +- packages/kbn-rule-data-utils/BUILD.bazel | 120 - packages/kbn-rule-data-utils/kibana.jsonc | 4 +- packages/kbn-rule-data-utils/package.json | 7 +- packages/kbn-rule-data-utils/tsconfig.json | 12 +- packages/kbn-safer-lodash-set/BUILD.bazel | 57 +- packages/kbn-safer-lodash-set/kibana.jsonc | 4 +- packages/kbn-safer-lodash-set/package.json | 2 - packages/kbn-safer-lodash-set/tsconfig.json | 9 +- .../BUILD.bazel | 143 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 19 +- .../kbn-securitysolution-es-utils/BUILD.bazel | 114 - .../kibana.jsonc | 4 +- .../package.json | 6 +- .../tsconfig.json | 9 +- .../BUILD.bazel | 163 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 15 +- .../BUILD.bazel | 121 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 9 +- .../BUILD.bazel | 124 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 13 +- .../BUILD.bazel | 125 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 15 +- .../BUILD.bazel | 122 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- .../BUILD.bazel | 125 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- .../kbn-securitysolution-list-api/BUILD.bazel | 124 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../src/api/index.test.ts | 15 - .../tsconfig.json | 16 +- .../BUILD.bazel | 115 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- .../BUILD.bazel | 131 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../src/transforms/index.test.ts | 2 +- .../src/use_api/index.test.ts | 14 - .../src/use_create_list_index/index.test.ts | 14 - .../src/use_exception_lists/index.test.ts | 14 - .../src/use_export_list/index.test.ts | 14 - .../src/use_import_list/index.test.ts | 14 - .../use_persist_exception_item/index.test.ts | 14 - .../use_persist_exception_list/index.test.ts | 14 - .../src/use_read_list_index/index.test.ts | 14 - .../tsconfig.json | 17 +- .../BUILD.bazel | 133 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../src/helpers/index.test.ts | 15 - .../tsconfig.json | 17 +- .../kbn-securitysolution-rules/BUILD.bazel | 119 - .../kbn-securitysolution-rules/kibana.jsonc | 4 +- .../kbn-securitysolution-rules/package.json | 7 +- .../kbn-securitysolution-rules/tsconfig.json | 9 +- .../kbn-securitysolution-t-grid/BUILD.bazel | 120 - .../kbn-securitysolution-t-grid/kibana.jsonc | 4 +- .../kbn-securitysolution-t-grid/package.json | 7 +- .../kbn-securitysolution-t-grid/tsconfig.json | 9 +- .../kbn-securitysolution-utils/BUILD.bazel | 119 - .../kbn-securitysolution-utils/kibana.jsonc | 4 +- .../kbn-securitysolution-utils/package.json | 7 +- .../kbn-securitysolution-utils/tsconfig.json | 12 +- packages/kbn-server-http-tools/BUILD.bazel | 122 - packages/kbn-server-http-tools/kibana.jsonc | 4 +- packages/kbn-server-http-tools/package.json | 6 +- packages/kbn-server-http-tools/tsconfig.json | 13 +- .../kbn-server-route-repository/BUILD.bazel | 130 - .../{web_index.ts => browser_index.ts} | 0 .../kbn-server-route-repository/kibana.jsonc | 4 +- .../kbn-server-route-repository/package.json | 6 +- .../kbn-server-route-repository/tsconfig.json | 13 +- packages/kbn-shared-svg/BUILD.bazel | 133 - packages/kbn-shared-svg/kibana.jsonc | 4 +- packages/kbn-shared-svg/package.json | 7 +- packages/kbn-shared-svg/tsconfig.json | 11 +- packages/kbn-shared-ux-utility/BUILD.bazel | 138 - packages/kbn-shared-ux-utility/kibana.jsonc | 4 +- packages/kbn-shared-ux-utility/package.json | 7 +- packages/kbn-shared-ux-utility/tsconfig.json | 9 +- packages/kbn-some-dev-log/BUILD.bazel | 122 - packages/kbn-some-dev-log/kibana.jsonc | 4 +- packages/kbn-some-dev-log/package.json | 6 +- packages/kbn-some-dev-log/tsconfig.json | 9 +- packages/kbn-sort-package-json/BUILD.bazel | 124 - packages/kbn-sort-package-json/kibana.jsonc | 4 +- packages/kbn-sort-package-json/package.json | 4 +- packages/kbn-sort-package-json/tsconfig.json | 9 +- packages/kbn-spec-to-console/BUILD.bazel | 56 - packages/kbn-spec-to-console/kibana.jsonc | 4 +- packages/kbn-std/BUILD.bazel | 93 +- packages/kbn-std/kibana.jsonc | 4 +- packages/kbn-std/package.json | 4 +- packages/kbn-std/src/deep_freeze.ts | 2 +- packages/kbn-std/tsconfig.json | 12 +- packages/kbn-stdio-dev-helpers/BUILD.bazel | 126 - packages/kbn-stdio-dev-helpers/kibana.jsonc | 4 +- packages/kbn-stdio-dev-helpers/package.json | 4 +- packages/kbn-stdio-dev-helpers/tsconfig.json | 9 +- packages/kbn-storybook/BUILD.bazel | 149 - packages/kbn-storybook/kibana.jsonc | 4 +- packages/kbn-storybook/package.json | 4 +- packages/kbn-storybook/preset.js | 6 +- packages/kbn-storybook/src/lib/constants.ts | 2 +- .../src/lib/run_storybook_cli.ts | 9 +- packages/kbn-storybook/src/webpack.config.ts | 7 +- packages/kbn-storybook/tsconfig.json | 17 +- .../kbn-synthetic-package-map/BUILD.bazel | 51 - .../kbn-synthetic-package-map/kibana.jsonc | 8 - .../kbn-synthetic-package-map/tsconfig.json | 14 - packages/kbn-telemetry-tools/BUILD.bazel | 123 - packages/kbn-telemetry-tools/kibana.jsonc | 4 +- packages/kbn-telemetry-tools/package.json | 4 +- .../src/tools/compiler_host.ts | 2 +- packages/kbn-telemetry-tools/tsconfig.json | 16 +- packages/kbn-test-jest-helpers/BUILD.bazel | 182 - packages/kbn-test-jest-helpers/kibana.jsonc | 4 +- packages/kbn-test-jest-helpers/package.json | 6 +- .../src/stub_web_worker.ts | 7 +- packages/kbn-test-jest-helpers/tsconfig.json | 13 +- packages/kbn-test-subj-selector/BUILD.bazel | 122 - packages/kbn-test-subj-selector/kibana.jsonc | 4 +- packages/kbn-test-subj-selector/package.json | 6 +- packages/kbn-test-subj-selector/tsconfig.json | 9 +- packages/kbn-test/BUILD.bazel | 211 - packages/kbn-test/jest-preset.js | 69 +- .../kbn-test/jest_integration/jest-preset.js | 11 +- .../jest_integration_node/jest-preset.js | 13 +- packages/kbn-test/jest_node/jest-preset.js | 5 +- packages/kbn-test/kibana.jsonc | 4 +- packages/kbn-test/package.json | 6 +- packages/kbn-test/src/es/es_test_config.ts | 2 +- packages/kbn-test/src/es/test_es_cluster.ts | 22 +- .../fake_mocha_types.ts | 19 +- .../functional_test_runner.ts | 2 +- .../integration_tests/basic.test.js | 2 +- .../integration_tests/failure_hooks.test.js | 2 +- .../lib/config/config_loading.ts | 2 +- .../lib/config/ftr_configs_manifest.ts | 2 +- .../lib/config/run_check_ftr_configs_cli.ts | 2 +- .../functional_test_runner/lib/es_version.ts | 2 +- .../lib/mocha/decorate_mocha_ui.js | 2 +- .../mocha/reporter/ci_stats_ftr_reporter.ts | 31 +- .../lib/mocha/setup_mocha.ts | 2 +- .../lib/mocha/validate_ci_group_tags.js | 2 +- .../lib/providers/provider_collection.ts | 14 +- .../lib/providers/read_provider_spec.ts | 12 +- .../lib/suite_tracker.test.ts | 4 +- .../lib/suite_tracker.ts | 2 +- .../lib/babel_register_for_test_plugins.js | 37 +- .../functional_tests/lib/run_elasticsearch.ts | 2 +- .../functional_tests/lib/run_kibana_server.ts | 2 +- .../src/functional_tests/run_tests/flags.ts | 2 +- .../functional_tests/run_tests/run_tests.ts | 2 +- .../start_servers/flags.test.ts | 2 +- .../functional_tests/start_servers/flags.ts | 2 +- .../start_servers/start_servers.ts | 2 +- .../__fixtures__/jest.config.js | 26 - .../integration_tests/__fixtures__/test.js | 13 - .../integration_tests/junit_reporter.test.ts | 87 - .../src/jest/junit_reporter/index.js} | 4 +- .../{ => junit_reporter}/junit_reporter.ts | 6 +- packages/kbn-test/src/jest/resolver.js | 101 + packages/kbn-test/src/jest/run.ts | 2 +- .../src/jest/run_check_jest_configs_cli.ts | 2 +- .../kbn-test/src/jest/setup/babel_polyfill.js | 12 - .../jest/setup/preserve_symlinks_resolver.js | 30 - .../kbn-test/src/jest/transforms/babel.js | 1 + packages/kbn-test/src/kbn/users.ts | 1 - .../kbn_client/kbn_client_import_export.ts | 2 +- .../src/mocha/junit_report_generation.js | 2 +- packages/kbn-test/src/mocha/log_cache.js | 7 +- packages/kbn-test/tsconfig.json | 27 +- packages/kbn-timelion-grammar/BUILD.bazel | 31 - packages/kbn-timelion-grammar/kibana.jsonc | 4 +- packages/kbn-timelion-grammar/tsconfig.json | 12 + packages/kbn-tinymath/BUILD.bazel | 52 - packages/kbn-tinymath/kibana.jsonc | 4 +- packages/kbn-tinymath/test/library.test.js | 2 +- packages/kbn-tinymath/tsconfig.json | 10 +- packages/kbn-tooling-log/BUILD.bazel | 128 - packages/kbn-tooling-log/kibana.jsonc | 4 +- packages/kbn-tooling-log/package.json | 4 +- packages/kbn-tooling-log/tsconfig.json | 13 +- packages/kbn-ts-project-linter-cli/README.md | 3 + .../kbn-ts-project-linter-cli/jest.config.js | 13 + .../kbn-ts-project-linter-cli/kibana.jsonc | 6 + .../kbn-ts-project-linter-cli/package.json | 7 + .../run_lint_ts_projects_cli.ts | 122 + .../kbn-ts-project-linter-cli/tsconfig.json | 24 + packages/kbn-ts-project-linter/README.md | 3 + .../ast/ast.ts} | 12 +- packages/kbn-ts-project-linter/ast/babel.ts | 11 + .../ast/compiler_options.test.ts | 292 + .../ast/compiler_options.ts | 80 + .../kbn-ts-project-linter/ast/ends.test.ts | 43 + packages/kbn-ts-project-linter/ast/ends.ts | 30 + .../kbn-ts-project-linter/ast/exclude.test.ts | 74 + packages/kbn-ts-project-linter/ast/exclude.ts | 28 + .../ast}/index.ts | 10 +- packages/kbn-ts-project-linter/ast/props.ts | 24 + .../ast/references.test.ts | 215 + .../kbn-ts-project-linter/ast/references.ts | 110 + .../kbn-ts-project-linter/ast/snip.test.ts | 54 + packages/kbn-ts-project-linter/ast/snip.ts | 44 + packages/kbn-ts-project-linter/index.ts | 10 + packages/kbn-ts-project-linter/jest.config.js | 13 + packages/kbn-ts-project-linter/kibana.jsonc | 6 + .../lib/import_locator.ts | 79 + .../lib/lint_projects.ts | 117 + .../lib/project_file_map.ts | 58 + packages/kbn-ts-project-linter/lib/rule.ts | 57 + .../kbn-ts-project-linter/lib/rule_context.ts | 57 + .../lib/strip_source_code.ts | 137 + packages/kbn-ts-project-linter/package.json | 6 + .../rules/forbidden_compiler_options.ts | 39 + packages/kbn-ts-project-linter/rules/index.ts | 25 + .../rules/reference_pkg_ids.ts | 56 + .../rules/reference_used_pkgs.ts | 65 + .../rules/required_compiler_options.ts | 24 + .../rules/required_excludes.ts | 41 + .../rules/required_file_selectors.ts} | 15 +- .../rules/valid_base_config.ts | 37 + packages/kbn-ts-project-linter/tsconfig.json | 25 + packages/kbn-ts-projects/README.md | 3 + .../kbn-ts-projects}/index.ts | 3 +- packages/kbn-ts-projects/jest.config.js | 13 + packages/kbn-ts-projects/kibana.jsonc | 6 + packages/kbn-ts-projects/package.json | 6 + packages/kbn-ts-projects/project.ts | 158 + .../kbn-ts-projects}/projects.ts | 8 +- packages/kbn-ts-projects/ts_configfile.ts | 49 + packages/kbn-ts-projects/tsconfig.json | 21 + packages/kbn-ts-type-check-cli/README.md | 3 + packages/kbn-ts-type-check-cli/jest.config.js | 13 + packages/kbn-ts-type-check-cli/kibana.jsonc | 6 + packages/kbn-ts-type-check-cli/package.json | 7 + .../root_refs_config.ts | 17 +- .../run_type_check_cli.ts | 177 + packages/kbn-ts-type-check-cli/tsconfig.json | 26 + packages/kbn-type-summarizer-cli/BUILD.bazel | 140 - packages/kbn-type-summarizer-cli/README.md | 9 - packages/kbn-type-summarizer-cli/index.ts | 85 - packages/kbn-type-summarizer-cli/kibana.jsonc | 8 - packages/kbn-type-summarizer-cli/package.json | 8 - .../kbn-type-summarizer-cli/src/cli_config.ts | 177 - .../kbn-type-summarizer-cli/src/cli_flags.ts | 45 - packages/kbn-type-summarizer-cli/src/run.ts | 52 - .../kbn-type-summarizer-cli/tsconfig.json | 15 - packages/kbn-type-summarizer-core/BUILD.bazel | 133 - packages/kbn-type-summarizer-core/README.md | 3 - packages/kbn-type-summarizer-core/index.ts | 27 - .../kbn-type-summarizer-core/kibana.jsonc | 8 - .../kbn-type-summarizer-core/package.json | 8 - .../kbn-type-summarizer-core/src/cli_error.ts | 30 - .../kbn-type-summarizer-core/src/error.ts | 25 - packages/kbn-type-summarizer-core/src/fs.ts | 34 - .../kbn-type-summarizer-core/src/json.test.ts | 23 - packages/kbn-type-summarizer-core/src/json.ts | 21 - .../src/log/cli_log.ts | 249 - .../kbn-type-summarizer-core/src/log/index.ts | 12 - .../src/log/logger.ts | 71 - packages/kbn-type-summarizer-core/src/path.ts | 62 - .../kbn-type-summarizer-core/src/set_map.ts | 49 - .../src/ts_helpers.ts | 94 - .../kbn-type-summarizer-core/tsconfig.json | 15 - packages/kbn-type-summarizer/BUILD.bazel | 135 - packages/kbn-type-summarizer/README.mdx | 32 - packages/kbn-type-summarizer/index.ts | 10 - packages/kbn-type-summarizer/kibana.jsonc | 8 - packages/kbn-type-summarizer/package.json | 8 - .../kbn-type-summarizer/src/lib/ast_index.ts | 145 - .../src/lib/ast_indexer.ts | 403 - .../src/lib/ast_traverser.ts | 162 - .../src/lib/counter_map.ts | 23 - .../src/lib/dts_snipper.ts | 257 - .../src/lib/export_details.ts | 83 - .../src/lib/import_details.ts | 135 - .../src/lib/source_file_mapper.ts | 36 - .../src/lib/source_mapper.ts | 149 - .../src/lib/symbol_resolver.ts | 58 - .../src/lib/ts_nodes/dec_symbol.ts | 33 - .../src/lib/ts_nodes/export_from.ts | 17 - .../src/lib/ts_nodes/exportable_node.ts | 54 - .../src/lib/ts_nodes/imports.ts | 46 - .../src/lib/ts_nodes/index.ts | 13 - .../src/lib/ts_nodes/syntax_kind.ts | 20 - .../kbn-type-summarizer/src/lib/ts_project.ts | 23 - .../src/lib/tsconfig_file.ts | 31 - .../src/lib/type_summary/print_imports.ts | 104 - .../src/lib/type_summary/print_locals.ts | 142 - .../lib/type_summary/print_type_summary.ts | 42 - .../lib/type_summary/type_summary_namer.ts | 67 - .../src/summarize_package.ts | 90 - .../src/tests/integration_helpers.ts | 252 - .../integration_tests/ast_indexer.test.ts | 543 - .../tests/integration_tests/dts_snipper.ts | 138 - .../summarize_package.test.ts | 171 - .../src/tests/source_map_reader.ts | 58 - packages/kbn-type-summarizer/tsconfig.json | 15 - .../kbn-typed-react-router-config/BUILD.bazel | 134 - .../kibana.jsonc | 4 +- .../package.json | 7 +- .../tsconfig.json | 12 +- packages/kbn-ui-framework/BUILD.bazel | 46 - packages/kbn-ui-framework/kibana.jsonc | 4 +- packages/kbn-ui-shared-deps-npm/BUILD.bazel | 176 +- packages/kbn-ui-shared-deps-npm/index.d.ts | 19 - packages/kbn-ui-shared-deps-npm/index.js | 85 +- packages/kbn-ui-shared-deps-npm/kibana.jsonc | 4 +- packages/kbn-ui-shared-deps-npm/package.json | 4 +- .../src/public_path_loader.js | 7 +- .../src/public_path_module_creator.js | 3 + packages/kbn-ui-shared-deps-npm/tsconfig.json | 11 +- .../kbn-ui-shared-deps-npm/webpack.config.js | 3 +- packages/kbn-ui-shared-deps-src/BUILD.bazel | 174 +- packages/kbn-ui-shared-deps-src/kibana.jsonc | 4 +- packages/kbn-ui-shared-deps-src/package.json | 4 +- .../kbn-ui-shared-deps-src/src/definitions.js | 8 +- packages/kbn-ui-shared-deps-src/tsconfig.json | 21 +- .../kbn-ui-shared-deps-src/webpack.config.js | 19 +- packages/kbn-ui-theme/BUILD.bazel | 35 +- packages/kbn-ui-theme/kibana.jsonc | 4 +- packages/kbn-ui-theme/package.json | 7 +- packages/kbn-ui-theme/tsconfig.json | 9 +- .../kbn-user-profile-components/BUILD.bazel | 121 - .../kbn-user-profile-components/kibana.jsonc | 4 +- .../kbn-user-profile-components/package.json | 5 +- .../kbn-user-profile-components/tsconfig.json | 13 +- packages/kbn-utility-types-jest/BUILD.bazel | 104 - packages/kbn-utility-types-jest/kibana.jsonc | 4 +- packages/kbn-utility-types-jest/package.json | 4 +- packages/kbn-utility-types-jest/tsconfig.json | 9 +- packages/kbn-utility-types/BUILD.bazel | 108 - packages/kbn-utility-types/kibana.jsonc | 4 +- packages/kbn-utility-types/package.json | 4 +- packages/kbn-utility-types/tsconfig.json | 9 +- packages/kbn-utils/BUILD.bazel | 112 - packages/kbn-utils/index.ts | 2 - packages/kbn-utils/kibana.jsonc | 4 +- packages/kbn-utils/package.json | 4 +- packages/kbn-utils/src/path/index.test.ts | 2 +- packages/kbn-utils/src/path/index.ts | 2 +- packages/kbn-utils/tsconfig.json | 13 +- packages/kbn-web-worker-stub/README.md | 3 + packages/kbn-web-worker-stub/index.ts | 20 + packages/kbn-web-worker-stub/jest.config.js | 13 + packages/kbn-web-worker-stub/kibana.jsonc | 6 + packages/kbn-web-worker-stub/package.json | 6 + packages/kbn-web-worker-stub/tsconfig.json | 16 + packages/kbn-yarn-lock-validator/BUILD.bazel | 127 - packages/kbn-yarn-lock-validator/kibana.jsonc | 4 +- packages/kbn-yarn-lock-validator/package.json | 4 +- .../src/find_production_dependencies.ts | 2 +- .../src/validate_yarn_lock.ts | 2 +- .../kbn-yarn-lock-validator/src/yarn_lock.ts | 2 +- .../kbn-yarn-lock-validator/tsconfig.json | 14 +- .../shared-ux/avatar/solution/BUILD.bazel | 153 - .../shared-ux/avatar/solution/kibana.jsonc | 4 +- .../shared-ux/avatar/solution/package.json | 7 +- .../shared-ux/avatar/solution/tsconfig.json | 11 +- .../avatar/user_profile/impl/BUILD.bazel | 134 - .../avatar/user_profile/impl/kibana.jsonc | 4 +- .../avatar/user_profile/impl/package.json | 7 +- .../avatar/user_profile/impl/tsconfig.json | 13 +- .../button/exit_full_screen/impl/BUILD.bazel | 160 - .../button/exit_full_screen/impl/kibana.jsonc | 4 +- .../button/exit_full_screen/impl/package.json | 7 +- .../exit_full_screen/impl/tsconfig.json | 14 +- .../button/exit_full_screen/mocks/BUILD.bazel | 136 - .../exit_full_screen/mocks/kibana.jsonc | 4 +- .../exit_full_screen/mocks/package.json | 5 +- .../exit_full_screen/mocks/tsconfig.json | 13 +- .../button/exit_full_screen/types/BUILD.bazel | 59 - .../exit_full_screen/types/kibana.jsonc | 4 +- .../exit_full_screen/types/package.json | 3 +- .../exit_full_screen/types/tsconfig.json | 9 +- packages/shared-ux/button_toolbar/BUILD.bazel | 145 - .../shared-ux/button_toolbar/kibana.jsonc | 4 +- .../shared-ux/button_toolbar/package.json | 5 +- .../shared-ux/button_toolbar/tsconfig.json | 13 +- .../shared-ux/card/no_data/impl/BUILD.bazel | 150 - .../shared-ux/card/no_data/impl/kibana.jsonc | 4 +- .../shared-ux/card/no_data/impl/package.json | 7 +- .../shared-ux/card/no_data/impl/tsconfig.json | 15 +- .../shared-ux/card/no_data/mocks/BUILD.bazel | 142 - .../shared-ux/card/no_data/mocks/kibana.jsonc | 4 +- .../shared-ux/card/no_data/mocks/package.json | 5 +- .../card/no_data/mocks/tsconfig.json | 14 +- .../shared-ux/card/no_data/types/BUILD.bazel | 59 - .../shared-ux/card/no_data/types/kibana.jsonc | 4 +- .../card/no_data/types/tsconfig.json | 12 +- packages/shared-ux/file/context/BUILD.bazel | 136 - packages/shared-ux/file/context/kibana.jsonc | 4 +- packages/shared-ux/file/context/package.json | 5 +- packages/shared-ux/file/context/tsconfig.json | 12 +- .../file/file_picker/impl/BUILD.bazel | 158 - .../file/file_picker/impl/kibana.jsonc | 4 +- .../file/file_picker/impl/package.json | 5 +- .../file/file_picker/impl/tsconfig.json | 20 +- .../file/file_upload/impl/BUILD.bazel | 155 - .../file/file_upload/impl/kibana.jsonc | 4 +- .../file/file_upload/impl/package.json | 5 +- .../file/file_upload/impl/tsconfig.json | 19 +- .../shared-ux/file/image/impl/BUILD.bazel | 148 - .../shared-ux/file/image/impl/kibana.jsonc | 4 +- .../shared-ux/file/image/impl/package.json | 5 +- .../shared-ux/file/image/impl/tsconfig.json | 14 +- .../shared-ux/file/image/mocks/BUILD.bazel | 127 - .../shared-ux/file/image/mocks/kibana.jsonc | 4 +- .../shared-ux/file/image/mocks/package.json | 5 +- .../shared-ux/file/image/mocks/tsconfig.json | 9 +- packages/shared-ux/file/mocks/BUILD.bazel | 134 - packages/shared-ux/file/mocks/kibana.jsonc | 4 +- packages/shared-ux/file/mocks/package.json | 5 +- packages/shared-ux/file/mocks/tsconfig.json | 13 +- packages/shared-ux/file/types/BUILD.bazel | 59 - packages/shared-ux/file/types/kibana.jsonc | 4 +- packages/shared-ux/file/types/tsconfig.json | 9 +- packages/shared-ux/file/util/BUILD.bazel | 142 - packages/shared-ux/file/util/kibana.jsonc | 4 +- packages/shared-ux/file/util/package.json | 5 +- packages/shared-ux/file/util/tsconfig.json | 12 +- .../link/redirect_app/impl/BUILD.bazel | 151 - .../link/redirect_app/impl/kibana.jsonc | 4 +- .../link/redirect_app/impl/package.json | 7 +- .../link/redirect_app/impl/tsconfig.json | 14 +- .../link/redirect_app/mocks/BUILD.bazel | 138 - .../link/redirect_app/mocks/kibana.jsonc | 4 +- .../link/redirect_app/mocks/package.json | 7 +- .../link/redirect_app/mocks/tsconfig.json | 13 +- .../link/redirect_app/types/BUILD.bazel | 59 - .../link/redirect_app/types/kibana.jsonc | 4 +- .../link/redirect_app/types/tsconfig.json | 9 +- packages/shared-ux/markdown/impl/BUILD.bazel | 145 - packages/shared-ux/markdown/impl/kibana.jsonc | 4 +- packages/shared-ux/markdown/impl/package.json | 7 +- .../shared-ux/markdown/impl/tsconfig.json | 12 +- packages/shared-ux/markdown/mocks/BUILD.bazel | 140 - .../shared-ux/markdown/mocks/kibana.jsonc | 4 +- .../shared-ux/markdown/mocks/package.json | 7 +- .../shared-ux/markdown/mocks/tsconfig.json | 13 +- packages/shared-ux/markdown/types/BUILD.bazel | 67 - .../shared-ux/markdown/types/kibana.jsonc | 4 +- .../shared-ux/markdown/types/package.json | 7 +- .../shared-ux/markdown/types/tsconfig.json | 9 +- .../page/analytics_no_data/impl/BUILD.bazel | 144 - .../page/analytics_no_data/impl/kibana.jsonc | 4 +- .../page/analytics_no_data/impl/package.json | 7 +- .../page/analytics_no_data/impl/tsconfig.json | 16 +- .../page/analytics_no_data/mocks/BUILD.bazel | 136 - .../page/analytics_no_data/mocks/kibana.jsonc | 4 +- .../page/analytics_no_data/mocks/package.json | 5 +- .../analytics_no_data/mocks/tsconfig.json | 14 +- .../page/analytics_no_data/types/BUILD.bazel | 60 - .../page/analytics_no_data/types/kibana.jsonc | 4 +- .../page/analytics_no_data/types/package.json | 1 - .../analytics_no_data/types/tsconfig.json | 12 +- .../page/kibana_no_data/impl/BUILD.bazel | 152 - .../page/kibana_no_data/impl/kibana.jsonc | 4 +- .../page/kibana_no_data/impl/package.json | 7 +- .../page/kibana_no_data/impl/tsconfig.json | 17 +- .../page/kibana_no_data/mocks/BUILD.bazel | 139 - .../page/kibana_no_data/mocks/kibana.jsonc | 4 +- .../page/kibana_no_data/mocks/package.json | 5 +- .../page/kibana_no_data/mocks/tsconfig.json | 16 +- .../page/kibana_no_data/types/BUILD.bazel | 59 - .../page/kibana_no_data/types/kibana.jsonc | 4 +- .../page/kibana_no_data/types/package.json | 3 +- .../page/kibana_no_data/types/tsconfig.json | 14 +- .../page/kibana_template/impl/BUILD.bazel | 140 - .../page/kibana_template/impl/kibana.jsonc | 4 +- .../page/kibana_template/impl/package.json | 4 +- .../page/kibana_template/impl/tsconfig.json | 16 +- .../page/kibana_template/mocks/BUILD.bazel | 138 - .../page/kibana_template/mocks/kibana.jsonc | 4 +- .../page/kibana_template/mocks/package.json | 5 +- .../page/kibana_template/mocks/tsconfig.json | 15 +- .../page/kibana_template/types/BUILD.bazel | 59 - .../page/kibana_template/types/kibana.jsonc | 4 +- .../page/kibana_template/types/package.json | 1 - .../page/kibana_template/types/tsconfig.json | 13 +- .../shared-ux/page/no_data/impl/BUILD.bazel | 148 - .../shared-ux/page/no_data/impl/kibana.jsonc | 4 +- .../shared-ux/page/no_data/impl/package.json | 7 +- .../shared-ux/page/no_data/impl/tsconfig.json | 18 +- .../shared-ux/page/no_data/mocks/BUILD.bazel | 137 - .../shared-ux/page/no_data/mocks/kibana.jsonc | 4 +- .../shared-ux/page/no_data/mocks/package.json | 5 +- .../page/no_data/mocks/tsconfig.json | 14 +- .../shared-ux/page/no_data/types/BUILD.bazel | 59 - .../shared-ux/page/no_data/types/kibana.jsonc | 4 +- .../shared-ux/page/no_data/types/package.json | 3 +- .../page/no_data/types/tsconfig.json | 12 +- .../page/no_data_config/impl/BUILD.bazel | 142 - .../page/no_data_config/impl/kibana.jsonc | 4 +- .../page/no_data_config/impl/package.json | 7 +- .../page/no_data_config/impl/tsconfig.json | 16 +- .../page/no_data_config/mocks/BUILD.bazel | 135 - .../page/no_data_config/mocks/kibana.jsonc | 4 +- .../page/no_data_config/mocks/package.json | 5 +- .../page/no_data_config/mocks/tsconfig.json | 14 +- .../page/no_data_config/types/BUILD.bazel | 59 - .../page/no_data_config/types/kibana.jsonc | 4 +- .../page/no_data_config/types/package.json | 3 +- .../page/no_data_config/types/tsconfig.json | 12 +- .../shared-ux/page/solution_nav/BUILD.bazel | 152 - .../shared-ux/page/solution_nav/kibana.jsonc | 4 +- .../shared-ux/page/solution_nav/package.json | 7 +- .../shared-ux/page/solution_nav/tsconfig.json | 14 +- .../prompt/no_data_views/impl/BUILD.bazel | 156 - .../prompt/no_data_views/impl/kibana.jsonc | 4 +- .../prompt/no_data_views/impl/package.json | 7 +- .../prompt/no_data_views/impl/tsconfig.json | 17 +- .../prompt/no_data_views/mocks/BUILD.bazel | 136 - .../prompt/no_data_views/mocks/kibana.jsonc | 4 +- .../prompt/no_data_views/mocks/package.json | 5 +- .../prompt/no_data_views/mocks/tsconfig.json | 13 +- .../prompt/no_data_views/types/BUILD.bazel | 60 - .../prompt/no_data_views/types/kibana.jsonc | 4 +- .../prompt/no_data_views/types/package.json | 3 +- .../prompt/no_data_views/types/tsconfig.json | 9 +- .../shared-ux/prompt/not_found/BUILD.bazel | 142 - .../shared-ux/prompt/not_found/kibana.jsonc | 4 +- .../shared-ux/prompt/not_found/package.json | 3 - .../shared-ux/prompt/not_found/tsconfig.json | 14 +- packages/shared-ux/router/impl/BUILD.bazel | 138 - packages/shared-ux/router/impl/kibana.jsonc | 4 +- packages/shared-ux/router/impl/package.json | 7 +- packages/shared-ux/router/impl/tsconfig.json | 11 +- packages/shared-ux/router/mocks/BUILD.bazel | 133 - packages/shared-ux/router/mocks/kibana.jsonc | 4 +- packages/shared-ux/router/mocks/package.json | 7 +- packages/shared-ux/router/mocks/tsconfig.json | 9 +- packages/shared-ux/router/types/BUILD.bazel | 60 - packages/shared-ux/router/types/kibana.jsonc | 4 +- packages/shared-ux/router/types/package.json | 3 +- packages/shared-ux/router/types/tsconfig.json | 9 +- .../shared-ux/storybook/config/BUILD.bazel | 139 - .../shared-ux/storybook/config/kibana.jsonc | 4 +- .../shared-ux/storybook/config/package.json | 5 +- .../shared-ux/storybook/config/tsconfig.json | 12 +- packages/shared-ux/storybook/mock/BUILD.bazel | 133 - .../shared-ux/storybook/mock/kibana.jsonc | 4 +- .../shared-ux/storybook/mock/package.json | 5 +- .../shared-ux/storybook/mock/tsconfig.json | 9 +- scripts/build_kibana_platform_plugins.js | 9 +- scripts/build_plugin_list_docs.js | 2 +- scripts/check_ts_projects.js | 10 - scripts/classify_source.js | 3 +- scripts/es.js | 2 +- scripts/find_babel_runtime_helpers_in_use.js | 2 +- ...find_node_libs_browser_polyfills_in_use.js | 2 +- .../find_target_node_imports_in_bundles.js | 10 - scripts/generate.js | 3 +- scripts/generate_plugin.js | 2 +- scripts/jest.js | 2 +- scripts/jest_integration.js | 3 +- scripts/kbn.js | 1 - scripts/plugin_helpers.js | 2 +- scripts/precommit_hook.js | 3 +- scripts/read_jest_help.mjs | 2 +- scripts/register_git_hook.js | 4 +- scripts/ship_ci_stats.js | 2 +- scripts/telemetry_check.js | 2 +- scripts/telemetry_extract.js | 2 +- scripts/test_hardening.js | 2 - .../index.ts => scripts/ts_project_linter.js | 3 +- scripts/type_check.js | 2 +- scripts/type_summarizer.js | 11 - scripts/update_vscode_config.js | 2 +- src/cli/cli.js | 2 +- src/cli/dev.js | 2 +- .../integration_tests/invalid_config.test.ts | 2 +- src/cli/serve/serve.js | 3 +- src/cli/tsconfig.json | 16 +- .../cli_encryption_keys.js | 2 +- src/cli_encryption_keys/tsconfig.json | 9 +- src/cli_health_gateway/cli_health_gateway.ts | 2 +- src/cli_health_gateway/tsconfig.json | 9 +- src/cli_keystore/add.js | 2 +- src/cli_keystore/cli_keystore.js | 2 +- src/cli_keystore/tsconfig.json | 9 +- src/cli_plugin/cli.js | 2 +- src/cli_plugin/install/index.js | 3 +- src/cli_plugin/install/settings.js | 2 +- src/cli_plugin/install/settings.test.js | 2 +- src/cli_plugin/list/index.js | 2 +- src/cli_plugin/remove/settings.js | 2 +- src/cli_plugin/tsconfig.json | 10 +- src/cli_setup/cli_setup.ts | 2 +- src/cli_setup/tsconfig.json | 14 +- src/cli_setup/utils.ts | 2 +- .../cli_verification_code.js | 3 +- src/cli_verification_code/tsconfig.json | 9 +- .../capabilities/capabilities_service.test.ts | 2 +- .../http/cookie_session_storage.test.ts | 2 +- .../migrations/7.7.2_xpack_100k.test.ts | 2 +- .../7_13_0_transform_failures.test.ts | 2 +- .../migrations/7_13_0_unknown_types.test.ts | 2 +- .../migrations/batch_size_bytes.test.ts | 2 +- .../migrations/check_target_mappings.test.ts | 2 +- .../migration_from_older_v1.test.ts | 2 +- .../migrations/multiple_es_nodes.test.ts | 2 +- .../migrations/multiple_kibana_nodes.test.ts | 2 +- .../migrations/outdated_docs.test.ts | 2 +- .../migrations/rewriting_id.test.ts | 2 +- .../saved_objects/migrations/test_utils.ts | 2 +- .../wait_for_migration_completion.test.ts | 2 +- .../lib/repository_with_proxy_utils.ts | 2 +- .../validation/validator.test.ts | 2 +- .../ui_settings/index.test.ts | 2 +- src/core/tsconfig.json | 145 +- src/dev/bazel/index.bzl | 4 - src/dev/bazel/jsts_transpiler.bzl | 49 - src/dev/bazel/pkg_npm_types.bzl | 159 - src/dev/build/lib/build.test.ts | 2 +- src/dev/build/lib/config.test.ts | 2 +- src/dev/build/lib/config.ts | 18 + src/dev/build/lib/fs_records.ts | 71 + .../integration_tests/version_info.test.ts | 2 +- src/dev/build/lib/scan_copy.ts | 64 +- src/dev/build/lib/version_info.ts | 2 +- src/dev/build/tasks/assert_path_length.ts | 13 +- .../tasks/build_kibana_example_plugins.ts | 2 +- .../tasks/build_kibana_platform_plugins.ts | 2 +- src/dev/build/tasks/build_packages_task.ts | 195 +- src/dev/build/tasks/clean_tasks.ts | 2 +- src/dev/build/tasks/copy_source_task.ts | 5 + src/dev/build/tasks/copy_source_worker.js | 25 +- .../generate_packages_optimized_assets.ts | 2 +- .../nodejs/extract_node_builds_task.test.ts | 2 +- .../verify_existing_node_builds_task.test.ts | 2 +- .../docker_generator/bundle_dockerfiles.ts | 2 +- .../tasks/os_packages/docker_generator/run.ts | 2 +- src/dev/chromium_version.ts | 2 +- .../__tests__/enumerate_patterns.test.js | 2 +- .../ingest_coverage/team_assignment/index.js | 2 +- src/dev/eslint/lint_files.ts | 2 +- src/dev/eslint/run_eslint_with_types.ts | 21 +- .../license_checker/run_check_licenses_cli.ts | 2 +- src/dev/notice/cli.js | 2 +- .../installed_packages.test.ts | 2 +- src/dev/performance/run_performance_cli.ts | 2 +- src/dev/performance/run_scalability_cli.ts | 2 +- src/dev/plugin_discovery/find_plugins.ts | 2 +- src/dev/precommit_hook/casing_check_config.js | 1 + .../precommit_hook/get_files_for_commit.js | 2 +- src/dev/run_build_docs_cli.ts | 2 +- src/dev/run_check_file_casing.ts | 2 +- .../run_find_plugins_with_circular_deps.ts | 2 +- src/dev/run_precommit_hook.js | 2 +- src/dev/storybook/commands/clean.ts | 2 +- src/dev/tsconfig.json | 31 +- src/dev/typescript/project.ts | 181 - .../typescript/run_check_ts_projects_cli.ts | 155 - src/dev/typescript/run_type_check_cli.ts | 259 - src/dev/typescript/ts_configfile.ts | 71 - src/fixtures/tsconfig.json | 10 +- src/plugins/advanced_settings/tsconfig.json | 25 +- src/plugins/bfetch/tsconfig.json | 15 +- .../expression_gauge/tsconfig.json | 29 +- .../expression_heatmap/tsconfig.json | 29 +- .../expression_legacy_metric/tsconfig.json | 28 +- .../expression_metric/tsconfig.json | 28 +- .../expression_partition_vis/tsconfig.json | 32 +- .../expression_tagcloud/tsconfig.json | 29 +- .../expression_xy/tsconfig.json | 36 +- src/plugins/chart_expressions/tsconfig.json | 10 +- src/plugins/charts/tsconfig.json | 20 +- .../legacy_core_editor.test.mocks.ts | 6 +- src/plugins/console/tsconfig.json | 35 +- src/plugins/controls/storybook/manager.ts | 3 +- src/plugins/controls/tsconfig.json | 33 +- src/plugins/custom_integrations/tsconfig.json | 17 +- src/plugins/dashboard/tsconfig.json | 75 +- src/plugins/data/tsconfig.json | 52 +- src/plugins/data_view_editor/tsconfig.json | 23 +- .../data_view_field_editor/tsconfig.json | 29 +- .../data_view_management/tsconfig.json | 43 +- src/plugins/data_views/tsconfig.json | 26 +- src/plugins/dev_tools/tsconfig.json | 17 +- .../application/context/context_app.scss | 2 +- .../components/layout/discover_layout.scss | 2 +- .../layout/discover_layout.test.tsx | 8 +- src/plugins/discover/tsconfig.json | 81 +- src/plugins/embeddable/tsconfig.json | 30 +- .../forms/hook_form_lib/shared_imports.ts | 3 +- src/plugins/es_ui_shared/tsconfig.json | 19 +- src/plugins/event_annotation/tsconfig.json | 26 +- src/plugins/expression_error/tsconfig.json | 16 +- src/plugins/expression_image/tsconfig.json | 16 +- src/plugins/expression_metric/tsconfig.json | 15 +- .../expression_repeat_image/tsconfig.json | 16 +- .../expression_reveal_image/tsconfig.json | 16 +- src/plugins/expression_shape/tsconfig.json | 16 +- src/plugins/expressions/tsconfig.json | 23 +- src/plugins/field_formats/tsconfig.json | 15 +- src/plugins/files/tsconfig.json | 32 +- src/plugins/files_management/tsconfig.json | 18 +- src/plugins/guided_onboarding/tsconfig.json | 26 +- src/plugins/home/tsconfig.json | 41 +- .../image_embeddable/public/imports.ts | 2 +- src/plugins/image_embeddable/tsconfig.json | 27 +- src/plugins/input_control_vis/tsconfig.json | 27 +- src/plugins/inspector/tsconfig.json | 17 +- src/plugins/interactive_setup/tsconfig.json | 24 +- src/plugins/kibana_overview/tsconfig.json | 32 +- src/plugins/kibana_react/tsconfig.json | 18 +- .../kibana_usage_collection/tsconfig.json | 16 +- src/plugins/kibana_utils/tsconfig.json | 18 +- src/plugins/management/tsconfig.json | 20 +- src/plugins/maps_ems/tsconfig.json | 13 +- src/plugins/navigation/tsconfig.json | 17 +- src/plugins/newsfeed/tsconfig.json | 17 +- src/plugins/presentation_util/tsconfig.json | 27 +- src/plugins/saved_objects/tsconfig.json | 21 +- .../saved_objects_finder/tsconfig.json | 15 +- .../saved_objects_management/tsconfig.json | 29 +- .../saved_objects_tagging_oss/tsconfig.json | 11 +- src/plugins/saved_search/tsconfig.json | 18 +- src/plugins/screenshot_mode/tsconfig.json | 10 +- src/plugins/share/tsconfig.json | 17 +- src/plugins/telemetry/tsconfig.json | 34 +- .../tsconfig.json | 11 +- .../tsconfig.json | 25 +- src/plugins/ui_actions/tsconfig.json | 21 +- src/plugins/ui_actions_enhanced/tsconfig.json | 30 +- src/plugins/unified_field_list/tsconfig.json | 32 +- src/plugins/unified_histogram/tsconfig.json | 31 +- src/plugins/unified_search/tsconfig.json | 43 +- src/plugins/url_forwarding/tsconfig.json | 9 +- src/plugins/usage_collection/tsconfig.json | 18 +- src/plugins/vis_default_editor/tsconfig.json | 36 +- src/plugins/vis_type_markdown/tsconfig.json | 20 +- src/plugins/vis_types/gauge/tsconfig.json | 33 +- src/plugins/vis_types/heatmap/tsconfig.json | 31 +- src/plugins/vis_types/metric/tsconfig.json | 25 +- src/plugins/vis_types/pie/tsconfig.json | 34 +- src/plugins/vis_types/table/tsconfig.json | 33 +- src/plugins/vis_types/tagcloud/tsconfig.json | 24 +- src/plugins/vis_types/timelion/tsconfig.json | 36 +- .../vis_types/timeseries/tsconfig.json | 50 +- src/plugins/vis_types/vega/tsconfig.json | 43 +- src/plugins/vis_types/vislib/tsconfig.json | 40 +- src/plugins/vis_types/xy/tsconfig.json | 25 +- src/plugins/visualizations/tsconfig.json | 68 +- src/setup_node_env/dist.js | 3 +- .../ensure_node_preserve_symlinks.js | 119 - src/setup_node_env/index.js | 7 +- src/setup_node_env/no_transpilation.js | 10 - .../setup_node_env/polyfill.ts | 8 +- ...{no_transpilation_dist.js => setup_env.js} | 2 +- src/setup_node_env/tsconfig.json | 9 +- .../analytics_ftr_helpers/tsconfig.json | 11 +- .../plugins/analytics_plugin_a/tsconfig.json | 9 +- test/examples/config.js | 2 +- test/functional/apps/management/_files.ts | 2 +- test/functional/services/remote/webdriver.ts | 2 +- .../plugins/status/tsconfig.json | 9 +- .../health_gateway/services/health_gateway.ts | 2 +- .../fixtures/test_endpoints/tsconfig.json | 11 +- .../tests/enrollment_token.ts | 2 +- .../plugins/kbn_tp_run_pipeline/tsconfig.json | 17 +- .../tsconfig.json | 8 +- .../plugins/app_link_test/tsconfig.json | 9 +- .../plugins/core_app_status/tsconfig.json | 10 +- .../plugins/core_history_block/tsconfig.json | 10 +- .../plugins/core_http/tsconfig.json | 8 +- .../plugins/core_plugin_a/tsconfig.json | 8 +- .../core_plugin_appleave/tsconfig.json | 8 +- .../plugins/core_plugin_b/tsconfig.json | 11 +- .../core_plugin_chromeless/tsconfig.json | 8 +- .../core_plugin_deep_links/tsconfig.json | 8 +- .../core_plugin_deprecations/tsconfig.json | 10 +- .../tsconfig.json | 8 +- .../core_plugin_helpmenu/tsconfig.json | 8 +- .../core_plugin_route_timeouts/tsconfig.json | 9 +- .../core_plugin_static_assets/tsconfig.json | 8 +- .../core_provider_plugin/tsconfig.json | 10 +- .../plugins/data_search/tsconfig.json | 11 +- .../elasticsearch_client_plugin/tsconfig.json | 8 +- .../plugins/index_patterns/tsconfig.json | 11 +- .../kbn_sample_panel_action/tsconfig.json | 14 +- .../plugins/kbn_top_nav/tsconfig.json | 10 +- .../tsconfig.json | 14 +- .../management_test_plugin/tsconfig.json | 10 +- .../plugins/rendering_plugin/tsconfig.json | 9 +- .../tsconfig.json | 8 +- .../tsconfig.json | 8 +- .../saved_objects_hidden_type/tsconfig.json | 8 +- .../session_notifications/tsconfig.json | 12 +- .../plugins/telemetry/tsconfig.json | 10 +- .../plugins/ui_settings_plugin/tsconfig.json | 9 +- .../plugins/usage_collection/tsconfig.json | 10 +- .../plugins/status_plugin_a/tsconfig.json | 9 +- .../plugins/status_plugin_b/tsconfig.json | 8 +- test/tsconfig.json | 85 +- tsconfig.base.json | 1172 +- tsconfig.bazel.json | 7 - tsconfig.json | 9 +- .../examples/alerting_example/tsconfig.json | 24 +- .../embedded_lens_example/tsconfig.json | 18 +- .../exploratory_view_example/tsconfig.json | 17 +- .../examples/reporting_example/tsconfig.json | 21 +- .../screenshotting_example/tsconfig.json | 16 +- .../testing_embedded_lens/tsconfig.json | 19 +- .../tsconfig.json | 19 +- .../tsconfig.json | 12 +- .../tsconfig.json | 22 +- .../triggers_actions_ui_example/tsconfig.json | 19 +- .../tsconfig.json | 31 +- x-pack/packages/ml/agg_utils/BUILD.bazel | 134 - x-pack/packages/ml/agg_utils/kibana.jsonc | 4 +- x-pack/packages/ml/agg_utils/package.json | 6 +- .../ml/agg_utils/src/validate_number.test.ts | 2 +- x-pack/packages/ml/agg_utils/tsconfig.json | 15 +- .../packages/ml/aiops_components/BUILD.bazel | 157 - .../packages/ml/aiops_components/kibana.jsonc | 4 +- .../packages/ml/aiops_components/package.json | 7 +- .../ml/aiops_components/tsconfig.json | 14 +- x-pack/packages/ml/aiops_utils/BUILD.bazel | 135 - x-pack/packages/ml/aiops_utils/kibana.jsonc | 4 +- x-pack/packages/ml/aiops_utils/package.json | 7 +- x-pack/packages/ml/aiops_utils/tsconfig.json | 13 +- .../ml/is_populated_object/BUILD.bazel | 122 - .../ml/is_populated_object/kibana.jsonc | 4 +- .../ml/is_populated_object/package.json | 6 +- .../ml/is_populated_object/tsconfig.json | 9 +- x-pack/packages/ml/string_hash/BUILD.bazel | 122 - x-pack/packages/ml/string_hash/kibana.jsonc | 4 +- x-pack/packages/ml/string_hash/package.json | 6 +- x-pack/packages/ml/string_hash/tsconfig.json | 9 +- x-pack/performance/tsconfig.json | 13 +- x-pack/plugins/actions/tsconfig.json | 39 +- x-pack/plugins/aiops/tsconfig.json | 49 +- x-pack/plugins/alerting/tsconfig.json | 44 +- x-pack/plugins/apm/ftr_e2e/cypress.config.ts | 4 +- x-pack/plugins/apm/ftr_e2e/tsconfig.json | 7 +- .../apm/scripts/aggregate_latency_metrics.js | 3 +- .../plugins/apm/scripts/create_apm_users.js | 5 +- .../create_functional_tests_archive.js | 4 +- .../apm/scripts/infer_route_return_types.js | 4 +- x-pack/plugins/apm/scripts/test/jest.js | 4 +- .../apm/scripts/upload_telemetry_data.js | 4 +- .../server/deprecations/deprecations.test.ts | 2 +- x-pack/plugins/apm/tsconfig.json | 91 +- x-pack/plugins/banners/tsconfig.json | 17 +- .../canvas/scripts/shareable_runtime.js | 4 +- .../048ed81e-84ae-4a48-9c30-641cf72b0376.jpg | Bin 0 -> 267384 bytes .../0791ed56-9a2e-4d0d-8d2d-a2f8c3c268ee.jpg | Bin 0 -> 201751 bytes .../0c6f377f-771e-432e-8e2e-15c3e9142ad6.png | Bin 0 -> 238918 bytes .../23edd689-2d34-4bb8-a3eb-05420dd87b85.svg | 3 + .../6fb8f925-0e1e-4108-8442-3dbf88d145e5.jpg | Bin 0 -> 41253 bytes .../7f2d5d96-3c85-49a0-94f3-e9b05de23cb6.jpg | Bin 0 -> 69184 bytes .../9c2e5ab5-2dbe-43a8-bc84-e67f191fbcd8.png | Bin 0 -> 318106 bytes .../a30a06eb-2276-44b1-a62d-856e2116138c.jpg | Bin 0 -> 195800 bytes .../aa91a324-8012-477e-a7e4-7c3cd7a6332f.svg | 3 + .../b22b6fa7-618c-4a59-82a1-ca921454da48.svg | 3 + .../d38c5025-eafc-4a35-a5fd-fb7b5bdc9efa.jpg | Bin 0 -> 85775 bytes .../server/templates/pitch_presentation.ts | 52 +- .../shareable_runtime/webpack.config.js | 2 +- x-pack/plugins/canvas/tsconfig.json | 86 +- x-pack/plugins/cases/tsconfig.json | 58 +- x-pack/plugins/cloud/tsconfig.json | 13 +- x-pack/plugins/cloud_defend/tsconfig.json | 18 +- .../cloud_chat/tsconfig.json | 18 +- .../cloud_data_migration/tsconfig.json | 19 +- .../cloud_experiments/tsconfig.json | 21 +- .../cloud_full_story/tsconfig.json | 13 +- .../cloud_gain_sight/tsconfig.json | 11 +- .../cloud_links/tsconfig.json | 15 +- .../cloud_security_posture/tsconfig.json | 45 +- .../cross_cluster_replication/tsconfig.json | 35 +- x-pack/plugins/custom_branding/tsconfig.json | 15 +- .../plugins/dashboard_enhanced/tsconfig.json | 28 +- x-pack/plugins/data_visualizer/tsconfig.json | 61 +- .../plugins/discover_enhanced/tsconfig.json | 32 +- .../drilldowns/url_drilldown/tsconfig.json | 26 +- .../plugins/embeddable_enhanced/tsconfig.json | 20 +- .../encrypted_saved_objects/tsconfig.json | 14 +- .../{ => common}/jest.config.js | 4 +- .../applications/app_search/cypress.config.js | 8 +- .../app_search/cypress/tsconfig.json | 18 +- .../cypress.config.js | 8 +- .../cypress/tsconfig.json | 18 +- .../applications/shared/cypress/commands.ts | 2 - .../applications/shared/cypress/tsconfig.json | 11 +- .../workplace_search/cypress.config.js | 8 +- .../workplace_search/cypress/tsconfig.json | 18 +- .../enterprise_search/public/jest.config.js | 25 + .../enterprise_search/server/jest.config.js | 25 + .../lib/enterprise_search_config_api.test.ts | 2 +- .../lib/enterprise_search_config_api.ts | 2 +- .../plugins/enterprise_search/tsconfig.json | 54 +- x-pack/plugins/event_log/tsconfig.json | 17 +- x-pack/plugins/features/tsconfig.json | 15 +- x-pack/plugins/file_upload/tsconfig.json | 21 +- x-pack/plugins/fleet/cypress.config.ts | 6 +- x-pack/plugins/fleet/cypress/plugins/index.ts | 1 - .../plugins/fleet/cypress/support/commands.ts | 2 - x-pack/plugins/fleet/cypress/tsconfig.json | 47 +- .../get_all_packages/get_all_packages.ts | 2 +- .../install_all_packages.ts | 2 +- .../validate_bundled_packages.test.ts | 2 +- .../fleet/server/routes/agent/handlers.ts | 2 +- .../fleet/server/services/app_context.ts | 2 +- x-pack/plugins/fleet/tsconfig.json | 92 +- x-pack/plugins/global_search/tsconfig.json | 16 +- .../plugins/global_search_bar/tsconfig.json | 21 +- .../global_search_providers/tsconfig.json | 11 +- x-pack/plugins/graph/tsconfig.json | 42 +- x-pack/plugins/grokdebugger/tsconfig.json | 21 +- .../index_lifecycle_management/tsconfig.json | 36 +- x-pack/plugins/index_management/tsconfig.json | 36 +- x-pack/plugins/infra/tsconfig.json | 66 +- x-pack/plugins/ingest_pipelines/tsconfig.json | 34 +- .../plugins/kubernetes_security/tsconfig.json | 33 +- x-pack/plugins/lens/tsconfig.json | 97 +- .../plugins/license_api_guard/tsconfig.json | 12 +- .../plugins/license_management/tsconfig.json | 30 +- x-pack/plugins/licensing/tsconfig.json | 17 +- x-pack/plugins/lists/tsconfig.json | 37 +- x-pack/plugins/logstash/tsconfig.json | 26 +- x-pack/plugins/maps/tsconfig.json | 87 +- .../routes/apidoc_scripts/schema_extractor.ts | 2 +- x-pack/plugins/ml/tsconfig.json | 75 +- x-pack/plugins/monitoring/tsconfig.json | 57 +- .../monitoring_collection/tsconfig.json | 15 +- x-pack/plugins/notifications/tsconfig.json | 18 +- .../plugins/observability/e2e/tsconfig.json | 8 +- x-pack/plugins/observability/tsconfig.json | 78 +- x-pack/plugins/osquery/cypress.config.ts | 9 +- .../plugins/osquery/cypress/plugins/index.ts | 2 +- x-pack/plugins/osquery/cypress/support/e2e.ts | 1 - x-pack/plugins/osquery/cypress/tsconfig.json | 44 +- x-pack/plugins/osquery/tsconfig.json | 55 +- x-pack/plugins/painless_lab/tsconfig.json | 23 +- x-pack/plugins/profiling/tsconfig.json | 60 +- x-pack/plugins/remote_clusters/tsconfig.json | 34 +- x-pack/plugins/reporting/tsconfig.json | 55 +- x-pack/plugins/rollup/tsconfig.json | 37 +- x-pack/plugins/rule_registry/tsconfig.json | 30 +- x-pack/plugins/runtime_fields/tsconfig.json | 16 +- .../saved_objects_tagging/tsconfig.json | 27 +- x-pack/plugins/screenshotting/tsconfig.json | 21 +- x-pack/plugins/searchprofiler/tsconfig.json | 26 +- .../edit_role_mapping_page.test.tsx | 2 +- .../json_rule_editor.test.tsx | 2 +- .../rule_editor_panel.test.tsx | 2 +- x-pack/plugins/security/tsconfig.json | 64 +- .../common/experimental_features.ts | 4 +- .../security_solution/common/jest.config.js | 9 +- .../cypress/cypress.config.ts | 11 +- .../cypress/cypress_ci.config.ts | 10 +- .../cypress/plugins/index.js | 46 - .../security_solution/cypress/tsconfig.json | 12 +- .../security_solution/jest.config.dev.js | 3 +- .../public/app/jest.config.js | 9 +- .../public/cases/jest.config.js | 9 +- .../experimental_features_service.ts | 1 - .../public/common/jest.config.js | 9 +- .../public/detection_engine/jest.config.js | 9 +- .../public/detections/jest.config.js | 9 +- .../public/exceptions/jest.config.js | 9 +- .../public/explore/jest.config.js | 9 +- .../security_solution/public/jest.config.js | 9 +- .../public/landing_pages/jest.config.js | 9 +- .../public/management/jest.config.js | 9 +- .../public/overview/jest.config.js | 9 +- .../public/resolver/jest.config.js | 9 +- .../public/timelines/jest.config.js | 9 +- .../scripts/beat_docs/build.js | 18 +- .../services/endpoint_loader.ts | 2 +- .../server/__mocks__/module_name_map.js | 18 + .../server/client/jest.config.js | 9 +- .../server/endpoint/jest.config.js | 9 +- .../server/fleet_integration/jest.config.js | 9 +- .../security_solution/server/jest.config.js | 9 +- .../server/lib/jest.config.js | 9 +- .../server/lists_integration/jest.config.js | 9 +- .../endpoint_fields/index.test.ts | 2 +- .../search_strategy/endpoint_fields/index.ts | 2 +- .../server/search_strategy/jest.config.js | 9 +- .../server/usage/jest.config.js | 9 +- .../server/utils/jest.config.js | 9 +- .../plugins/security_solution/tsconfig.json | 148 +- x-pack/plugins/session_view/tsconfig.json | 33 +- x-pack/plugins/snapshot_restore/tsconfig.json | 34 +- x-pack/plugins/spaces/tsconfig.json | 36 +- x-pack/plugins/stack_alerts/tsconfig.json | 46 +- x-pack/plugins/stack_connectors/tsconfig.json | 25 +- x-pack/plugins/synthetics/e2e/tsconfig.json | 11 +- .../lib/helper/enzyme_helpers.tsx | 1 - x-pack/plugins/synthetics/tsconfig.json | 82 +- .../server/lib/log_health_metrics.ts | 2 +- x-pack/plugins/task_manager/tsconfig.json | 19 +- .../telemetry_collection_xpack/tsconfig.json | 14 +- .../cypress/cypress.config.ts | 10 +- .../cypress/plugins/index.js | 42 - .../threat_intelligence/cypress/tsconfig.json | 10 +- .../plugins/threat_intelligence/tsconfig.json | 32 +- .../index_fields/index.test.ts | 2 +- .../search_strategy/index_fields/index.ts | 2 +- .../server/utils/beat_schema/fields.json | 1 + .../server/utils/beat_schema/fields.json.d.ts | 10 + .../server/utils/beat_schema/fields.ts | 49317 ---------------- x-pack/plugins/timelines/tsconfig.json | 32 +- x-pack/plugins/transform/tsconfig.json | 45 +- x-pack/plugins/translations/tsconfig.json | 9 +- .../plugins/triggers_actions_ui/tsconfig.json | 52 +- .../plugins/upgrade_assistant/tsconfig.json | 37 +- x-pack/plugins/ux/e2e/tsconfig.json | 8 +- x-pack/plugins/ux/tsconfig.json | 46 +- x-pack/plugins/watcher/tsconfig.json | 37 +- x-pack/scripts/jest.js | 1 - x-pack/test/examples/config.ts | 3 +- .../group3/reporting/download_csv.ts | 3 +- .../services/ml/stack_management_jobs.ts | 3 +- .../plugins/kibana_cors_test/tsconfig.json | 8 +- .../plugins/iframe_embedded/tsconfig.json | 6 +- .../alerts/server/ensure_apm_started.ts | 3 +- x-pack/test/licensing_plugin/config.public.ts | 3 +- .../plugins/test_feature_usage/tsconfig.json | 8 +- x-pack/test/load/runner.ts | 3 +- .../elasticsearch_client/tsconfig.json | 6 +- .../plugins/event_log/tsconfig.json | 8 +- .../plugins/feature_usage_test/tsconfig.json | 9 +- .../plugins/sample_task_plugin/tsconfig.json | 9 +- .../task_manager_performance/tsconfig.json | 9 +- x-pack/test/plugin_functional/config.ts | 3 +- .../plugins/global_search_test/tsconfig.json | 8 +- .../plugins/resolver_test/tsconfig.json | 12 +- .../common/config.ts | 3 +- x-pack/test/scalability/config.ts | 3 +- .../endpoint_solution_integrations.ts | 3 +- .../services/endpoint.ts | 3 +- .../services/endpoint_telemetry.ts | 3 +- .../endpoint_rule_alert_generator.ts | 3 +- .../services/detections/index.ts | 3 +- .../spaces_api_integration/common/config.ts | 3 +- .../apps/alerts/alerts_encryption_keys.js | 2 +- .../apps/metricbeat/_metricbeat_dashboard.ts | 3 +- ...onfig.stack_functional_integration_base.js | 2 +- x-pack/test/tsconfig.json | 175 +- .../application_usage_test/tsconfig.json | 6 +- .../stack_management_usage_test/tsconfig.json | 6 +- yarn.lock | 931 +- 2421 files changed, 17782 insertions(+), 110627 deletions(-) create mode 100644 kbn_pm/src/commands/bootstrap/discovery.mjs create mode 100644 kbn_pm/src/commands/bootstrap/regenerate_package_map.mjs delete mode 100644 kbn_pm/src/commands/bootstrap/regenerate_synthetic_package_map.mjs create mode 100644 kbn_pm/src/commands/bootstrap/validate_package_json.mjs create mode 100644 kbn_pm/src/lib/external_packages.js rename kbn_pm/src/{commands/bootstrap => lib}/normalize_path.mjs (100%) rename kbn_pm/src/{commands/bootstrap => lib}/plugins.mjs (51%) delete mode 100644 packages/BUILD.bazel delete mode 100644 packages/analytics/client/BUILD.bazel delete mode 100644 packages/analytics/shippers/elastic_v3/browser/BUILD.bazel delete mode 100644 packages/analytics/shippers/elastic_v3/common/BUILD.bazel delete mode 100644 packages/analytics/shippers/elastic_v3/server/BUILD.bazel delete mode 100644 packages/analytics/shippers/fullstory/BUILD.bazel delete mode 100644 packages/analytics/shippers/gainsight/BUILD.bazel delete mode 100644 packages/content-management/content_editor/BUILD.bazel delete mode 100644 packages/content-management/table_list/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-browser-internal/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-browser/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-server-internal/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-server-mocks/BUILD.bazel delete mode 100644 packages/core/analytics/core-analytics-server/BUILD.bazel delete mode 100644 packages/core/application/core-application-browser-internal/BUILD.bazel delete mode 100644 packages/core/application/core-application-browser-mocks/BUILD.bazel delete mode 100644 packages/core/application/core-application-browser/BUILD.bazel delete mode 100644 packages/core/application/core-application-common/BUILD.bazel delete mode 100644 packages/core/apps/core-apps-browser-internal/BUILD.bazel delete mode 100644 packages/core/apps/core-apps-browser-mocks/BUILD.bazel delete mode 100644 packages/core/apps/core-apps-server-internal/BUILD.bazel delete mode 100644 packages/core/base/core-base-browser-internal/BUILD.bazel delete mode 100644 packages/core/base/core-base-browser-mocks/BUILD.bazel delete mode 100644 packages/core/base/core-base-common-internal/BUILD.bazel delete mode 100644 packages/core/base/core-base-common/BUILD.bazel delete mode 100644 packages/core/base/core-base-server-internal/BUILD.bazel delete mode 100644 packages/core/base/core-base-server-mocks/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-common/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel delete mode 100644 packages/core/capabilities/core-capabilities-server/BUILD.bazel delete mode 100644 packages/core/chrome/core-chrome-browser-internal/BUILD.bazel delete mode 100644 packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel delete mode 100644 packages/core/chrome/core-chrome-browser/BUILD.bazel delete mode 100644 packages/core/config/core-config-server-internal/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-browser/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-common/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel delete mode 100644 packages/core/deprecations/core-deprecations-server/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-browser/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel delete mode 100644 packages/core/doc-links/core-doc-links-server/BUILD.bazel delete mode 100644 packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel delete mode 100644 packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel delete mode 100644 packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel delete mode 100644 packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel delete mode 100644 packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel delete mode 100644 packages/core/environment/core-environment-server-internal/BUILD.bazel delete mode 100644 packages/core/environment/core-environment-server-mocks/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-browser/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-common/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel delete mode 100644 packages/core/execution-context/core-execution-context-server/BUILD.bazel delete mode 100644 packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel delete mode 100644 packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel delete mode 100644 packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel delete mode 100644 packages/core/http/core-http-browser-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-browser-mocks/BUILD.bazel delete mode 100644 packages/core/http/core-http-browser/BUILD.bazel delete mode 100644 packages/core/http/core-http-common/BUILD.bazel delete mode 100644 packages/core/http/core-http-context-server-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-context-server-mocks/BUILD.bazel delete mode 100644 packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-request-handler-context-server/BUILD.bazel delete mode 100644 packages/core/http/core-http-resources-server-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-resources-server-mocks/BUILD.bazel delete mode 100644 packages/core/http/core-http-resources-server/BUILD.bazel delete mode 100644 packages/core/http/core-http-router-server-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-router-server-mocks/BUILD.bazel delete mode 100644 packages/core/http/core-http-server-internal/BUILD.bazel delete mode 100644 packages/core/http/core-http-server-mocks/BUILD.bazel delete mode 100644 packages/core/http/core-http-server/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-browser-internal/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-browser/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-server-internal/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-server-mocks/BUILD.bazel delete mode 100644 packages/core/i18n/core-i18n-server/BUILD.bazel delete mode 100644 packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel delete mode 100644 packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel delete mode 100644 packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel delete mode 100644 packages/core/integrations/core-integrations-browser-internal/BUILD.bazel delete mode 100644 packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel delete mode 100644 packages/core/lifecycle/core-lifecycle-server/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-browser-internal/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-browser-mocks/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-common-internal/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-server-internal/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-server-mocks/BUILD.bazel delete mode 100644 packages/core/logging/core-logging-server/BUILD.bazel delete mode 100644 packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel delete mode 100644 packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel delete mode 100644 packages/core/metrics/core-metrics-server-internal/BUILD.bazel delete mode 100644 packages/core/metrics/core-metrics-server-mocks/BUILD.bazel delete mode 100644 packages/core/metrics/core-metrics-server/BUILD.bazel delete mode 100644 packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel delete mode 100644 packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel delete mode 100644 packages/core/node/core-node-server-internal/BUILD.bazel delete mode 100644 packages/core/node/core-node-server-mocks/BUILD.bazel delete mode 100644 packages/core/node/core-node-server/BUILD.bazel delete mode 100644 packages/core/notifications/core-notifications-browser-internal/BUILD.bazel delete mode 100644 packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel delete mode 100644 packages/core/notifications/core-notifications-browser/BUILD.bazel delete mode 100644 packages/core/overlays/core-overlays-browser-internal/BUILD.bazel delete mode 100644 packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel delete mode 100644 packages/core/overlays/core-overlays-browser/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-browser-internal/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-browser/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-server-internal/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-server-mocks/BUILD.bazel delete mode 100644 packages/core/plugins/core-plugins-server/BUILD.bazel delete mode 100644 packages/core/preboot/core-preboot-server-internal/BUILD.bazel delete mode 100644 packages/core/preboot/core-preboot-server-mocks/BUILD.bazel delete mode 100644 packages/core/preboot/core-preboot-server/BUILD.bazel delete mode 100644 packages/core/rendering/core-rendering-browser-internal/BUILD.bazel delete mode 100644 packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel delete mode 100644 packages/core/rendering/core-rendering-server-internal/BUILD.bazel delete mode 100644 packages/core/rendering/core-rendering-server-mocks/BUILD.bazel delete mode 100644 packages/core/root/core-root-browser-internal/BUILD.bazel delete mode 100644 packages/core/root/core-root-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-common/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-server/BUILD.bazel delete mode 100644 packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel delete mode 100644 packages/core/status/core-status-common-internal/BUILD.bazel delete mode 100644 packages/core/status/core-status-common/BUILD.bazel delete mode 100644 packages/core/status/core-status-server-internal/BUILD.bazel delete mode 100644 packages/core/status/core-status-server-mocks/BUILD.bazel delete mode 100644 packages/core/status/core-status-server/BUILD.bazel delete mode 100644 packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel delete mode 100644 packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel delete mode 100644 packages/core/test-helpers/core-test-helpers-kbn-server/BUILD.bazel delete mode 100644 packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel delete mode 100644 packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel delete mode 100644 packages/core/theme/core-theme-browser-internal/BUILD.bazel delete mode 100644 packages/core/theme/core-theme-browser-mocks/BUILD.bazel delete mode 100644 packages/core/theme/core-theme-browser/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-common/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel delete mode 100644 packages/core/ui-settings/core-ui-settings-server/BUILD.bazel delete mode 100644 packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel delete mode 100644 packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel delete mode 100644 packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel delete mode 100644 packages/core/usage-data/core-usage-data-server/BUILD.bazel delete mode 100644 packages/home/sample_data_card/BUILD.bazel delete mode 100644 packages/home/sample_data_tab/BUILD.bazel delete mode 100644 packages/home/sample_data_types/BUILD.bazel delete mode 100644 packages/kbn-ace/BUILD.bazel delete mode 100644 packages/kbn-alerts/BUILD.bazel delete mode 100644 packages/kbn-ambient-common-types/BUILD.bazel delete mode 100644 packages/kbn-ambient-ftr-types/BUILD.bazel delete mode 100644 packages/kbn-ambient-storybook-types/BUILD.bazel delete mode 100644 packages/kbn-ambient-ui-types/BUILD.bazel delete mode 100644 packages/kbn-apm-config-loader/BUILD.bazel delete mode 100644 packages/kbn-apm-synthtrace/BUILD.bazel delete mode 100644 packages/kbn-apm-utils/BUILD.bazel delete mode 100644 packages/kbn-axe-config/BUILD.bazel create mode 100644 packages/kbn-babel-plugin-package-imports/BUILD.bazel create mode 100644 packages/kbn-babel-plugin-package-imports/README.mdx rename packages/{kbn-babel-plugin-synthetic-packages/babel_plugin_synthetic_packages.js => kbn-babel-plugin-package-imports/babel_plugin_package_imports.js} (55%) rename packages/{kbn-optimizer/src/node/index.ts => kbn-babel-plugin-package-imports/index.js} (85%) create mode 100644 packages/kbn-babel-plugin-package-imports/kibana.jsonc create mode 100644 packages/kbn-babel-plugin-package-imports/package.json create mode 100644 packages/kbn-babel-plugin-package-imports/tsconfig.json rename kbn_pm/src/commands/projects.js => packages/kbn-babel-plugin-package-imports/types.ts (77%) delete mode 100644 packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel delete mode 100644 packages/kbn-babel-plugin-synthetic-packages/README.mdx delete mode 100644 packages/kbn-babel-plugin-synthetic-packages/kibana.jsonc delete mode 100644 packages/kbn-babel-plugin-synthetic-packages/package.json create mode 100644 packages/kbn-babel-preset/tsconfig.json create mode 100644 packages/kbn-babel-register/BUILD.bazel create mode 100644 packages/kbn-babel-register/README.md create mode 100644 packages/kbn-babel-register/cache/index.js create mode 100644 packages/kbn-babel-register/cache/lmdb_cache.js rename packages/{kbn-optimizer/src/node/integration_tests/cache.test.ts => kbn-babel-register/cache/lmdb_cache.test.ts} (91%) create mode 100644 packages/kbn-babel-register/cache/no_cache_cache.js create mode 100644 packages/kbn-babel-register/cache/types.ts create mode 100644 packages/kbn-babel-register/index.js rename packages/{kbn-optimizer/src/node/polyfill.ts => kbn-babel-register/install.js} (93%) rename packages/{kbn-type-summarizer => kbn-babel-register}/jest.config.js (89%) create mode 100644 packages/kbn-babel-register/kibana.jsonc create mode 100644 packages/kbn-babel-register/package.json create mode 100644 packages/kbn-babel-register/transforms/babel.js create mode 100644 packages/kbn-babel-register/transforms/index.js rename packages/{kbn-optimizer/src/node/transforms/peggy.ts => kbn-babel-register/transforms/peggy.js} (81%) rename packages/{kbn-optimizer/src/node/transforms/transform.ts => kbn-babel-register/transforms/types.ts} (90%) create mode 100644 packages/kbn-babel-register/tsconfig.json create mode 100644 packages/kbn-babel-transform/BUILD.bazel create mode 100644 packages/kbn-babel-transform/README.md create mode 100644 packages/kbn-babel-transform/fast_async_transformer.js rename packages/{kbn-type-summarizer/src/lib/type_summary/export_some_name.ts => kbn-babel-transform/fast_async_worker.mjs} (50%) rename packages/{kbn-type-summarizer-core/src/log/test_log.ts => kbn-babel-transform/index.js} (52%) rename packages/{kbn-type-summarizer-cli => kbn-babel-transform}/jest.config.js (88%) create mode 100644 packages/kbn-babel-transform/kibana.jsonc create mode 100644 packages/kbn-babel-transform/options.js create mode 100644 packages/kbn-babel-transform/package.json create mode 100644 packages/kbn-babel-transform/sync_transform.js create mode 100644 packages/kbn-babel-transform/tsconfig.json create mode 100644 packages/kbn-babel-transform/types.ts delete mode 100644 packages/kbn-bazel-packages/BUILD.bazel delete mode 100644 packages/kbn-bazel-packages/src/bazel_package.test.ts delete mode 100644 packages/kbn-bazel-runner/BUILD.bazel delete mode 100644 packages/kbn-cases-components/BUILD.bazel delete mode 100644 packages/kbn-chart-icons/BUILD.bazel delete mode 100644 packages/kbn-ci-stats-core/BUILD.bazel delete mode 100644 packages/kbn-ci-stats-performance-metrics/BUILD.bazel delete mode 100644 packages/kbn-ci-stats-reporter/BUILD.bazel delete mode 100644 packages/kbn-cli-dev-mode/BUILD.bazel delete mode 100644 packages/kbn-coloring/BUILD.bazel delete mode 100644 packages/kbn-config-mocks/BUILD.bazel delete mode 100644 packages/kbn-config-schema/BUILD.bazel delete mode 100644 packages/kbn-config/BUILD.bazel delete mode 100644 packages/kbn-crypto-browser/BUILD.bazel delete mode 100644 packages/kbn-crypto/BUILD.bazel create mode 100644 packages/kbn-cypress-config/README.md create mode 100644 packages/kbn-cypress-config/index.ts rename packages/{kbn-type-summarizer-core => kbn-cypress-config}/jest.config.js (88%) create mode 100644 packages/kbn-cypress-config/kibana.jsonc create mode 100644 packages/kbn-cypress-config/package.json create mode 100644 packages/kbn-cypress-config/tsconfig.json delete mode 100644 packages/kbn-dev-cli-errors/BUILD.bazel delete mode 100644 packages/kbn-dev-cli-runner/BUILD.bazel delete mode 100644 packages/kbn-dev-proc-runner/BUILD.bazel delete mode 100644 packages/kbn-dev-utils/BUILD.bazel delete mode 100644 packages/kbn-doc-links/BUILD.bazel delete mode 100644 packages/kbn-docs-utils/BUILD.bazel delete mode 100644 packages/kbn-ebt-tools/BUILD.bazel delete mode 100644 packages/kbn-ecs/BUILD.bazel delete mode 100644 packages/kbn-es-archiver/BUILD.bazel delete mode 100644 packages/kbn-es-errors/BUILD.bazel delete mode 100644 packages/kbn-es-types/BUILD.bazel delete mode 100644 packages/kbn-es/BUILD.bazel rename packages/kbn-es/src/{cli.js => cli.ts} (74%) delete mode 100644 packages/kbn-es/src/cli_commands/archive.js create mode 100644 packages/kbn-es/src/cli_commands/archive.ts delete mode 100644 packages/kbn-es/src/cli_commands/build_snapshots.js create mode 100644 packages/kbn-es/src/cli_commands/build_snapshots.ts create mode 100644 packages/kbn-es/src/cli_commands/index.ts delete mode 100644 packages/kbn-es/src/cli_commands/snapshot.js create mode 100644 packages/kbn-es/src/cli_commands/snapshot.ts delete mode 100644 packages/kbn-es/src/cli_commands/source.js create mode 100644 packages/kbn-es/src/cli_commands/source.ts rename packages/{kbn-monaco/src/worker.d.ts => kbn-es/src/cli_commands/types.ts} (66%) rename packages/kbn-es/src/utils/{extract_config_files.js => extract_config_files.ts} (77%) rename packages/kbn-es/src/utils/{parse_es_log.js => parse_es_log.ts} (87%) delete mode 100644 packages/kbn-eslint-config/BUILD.bazel delete mode 100644 packages/kbn-eslint-plugin-disable/BUILD.bazel delete mode 100644 packages/kbn-eslint-plugin-eslint/BUILD.bazel delete mode 100644 packages/kbn-eslint-plugin-imports/BUILD.bazel delete mode 100644 packages/kbn-expect/BUILD.bazel delete mode 100644 packages/kbn-failed-test-reporter-cli/BUILD.bazel delete mode 100644 packages/kbn-field-types/BUILD.bazel delete mode 100644 packages/kbn-find-used-node-modules/BUILD.bazel create mode 100644 packages/kbn-flot-charts/tsconfig.json delete mode 100644 packages/kbn-ftr-common-functional-services/BUILD.bazel delete mode 100644 packages/kbn-ftr-screenshot-filename/BUILD.bazel delete mode 100644 packages/kbn-generate/BUILD.bazel delete mode 100644 packages/kbn-generate/src/commands/packages_build_manifest_command.ts delete mode 100644 packages/kbn-generate/templates/package/BUILD.bazel.ejs delete mode 100644 packages/kbn-generate/templates/packages_BUILD.bazel.ejs delete mode 100644 packages/kbn-get-repo-files/BUILD.bazel delete mode 100644 packages/kbn-guided-onboarding/BUILD.bazel delete mode 100644 packages/kbn-handlebars/BUILD.bazel delete mode 100644 packages/kbn-hapi-mocks/BUILD.bazel delete mode 100644 packages/kbn-health-gateway-server/BUILD.bazel delete mode 100644 packages/kbn-import-resolver/BUILD.bazel delete mode 100644 packages/kbn-interpreter/BUILD.bazel delete mode 100644 packages/kbn-io-ts-utils/BUILD.bazel delete mode 100644 packages/kbn-jest-serializers/BUILD.bazel delete mode 100644 packages/kbn-journeys/BUILD.bazel delete mode 100644 packages/kbn-kibana-manifest-schema/BUILD.bazel delete mode 100644 packages/kbn-language-documentation-popover/BUILD.bazel delete mode 100644 packages/kbn-logging-mocks/BUILD.bazel delete mode 100644 packages/kbn-logging/BUILD.bazel delete mode 100644 packages/kbn-managed-vscode-config-cli/BUILD.bazel delete mode 100644 packages/kbn-managed-vscode-config/BUILD.bazel delete mode 100644 packages/kbn-mapbox-gl/BUILD.bazel create mode 100644 packages/kbn-monaco/server.ts delete mode 100644 packages/kbn-monaco/src/workers_registry.ts delete mode 100644 packages/kbn-optimizer-webpack-helpers/BUILD.bazel delete mode 100644 packages/kbn-optimizer/BUILD.bazel delete mode 100644 packages/kbn-optimizer/src/audit_bundle_dependencies/find_target_node_imports.ts delete mode 100644 packages/kbn-optimizer/src/node/cache.ts delete mode 100644 packages/kbn-optimizer/src/node/node_auto_tranpilation.ts delete mode 100644 packages/kbn-optimizer/src/node/transforms/babel.ts delete mode 100644 packages/kbn-osquery-io-ts-types/BUILD.bazel create mode 100644 packages/kbn-package-map/BUILD.bazel rename packages/{kbn-synthetic-package-map => kbn-package-map}/index.d.ts (100%) rename packages/{kbn-synthetic-package-map => kbn-package-map}/index.js (90%) create mode 100644 packages/kbn-package-map/kibana.jsonc rename packages/{kbn-synthetic-package-map => kbn-package-map}/package.json (74%) create mode 100644 packages/kbn-package-map/tsconfig.json create mode 100644 packages/kbn-peggy/index.js delete mode 100644 packages/kbn-peggy/index.ts create mode 100644 packages/kbn-peggy/types.ts delete mode 100644 packages/kbn-performance-testing-dataset-extractor/BUILD.bazel delete mode 100644 packages/kbn-plugin-discovery/BUILD.bazel delete mode 100644 packages/kbn-plugin-generator/BUILD.bazel delete mode 100644 packages/kbn-plugin-helpers/BUILD.bazel rename packages/{kbn-dev-utils/src/babel.ts => kbn-plugin-helpers/src/tasks/transform_file_with_babel.ts} (100%) delete mode 100644 packages/kbn-react-field/BUILD.bazel create mode 100644 packages/kbn-repo-info/BUILD.bazel create mode 100644 packages/kbn-repo-info/README.md rename packages/{kbn-utils/src/repo_root.ts => kbn-repo-info/index.js} (61%) rename packages/{kbn-type-summarizer/jest.integration.config.js => kbn-repo-info/jest.config.js} (80%) create mode 100644 packages/kbn-repo-info/kibana.jsonc create mode 100644 packages/kbn-repo-info/package.json create mode 100644 packages/kbn-repo-info/tsconfig.json rename packages/{kbn-utils/src/package_json/index.ts => kbn-repo-info/types.ts} (52%) create mode 100644 packages/kbn-repo-path/README.md rename src/setup_node_env/polyfill.js => packages/kbn-repo-path/index.ts (89%) create mode 100644 packages/kbn-repo-path/jest.config.js create mode 100644 packages/kbn-repo-path/kibana.jsonc create mode 100644 packages/kbn-repo-path/package.json create mode 100644 packages/kbn-repo-path/repo_path.ts create mode 100644 packages/kbn-repo-path/tsconfig.json delete mode 100644 packages/kbn-repo-source-classifier-cli/BUILD.bazel delete mode 100644 packages/kbn-repo-source-classifier/BUILD.bazel delete mode 100644 packages/kbn-rule-data-utils/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-autocomplete/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-es-utils/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-exception-list-components/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-hook-utils/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-io-ts-types/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-io-ts-utils/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-list-api/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-list-api/src/api/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-constants/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-list-hooks/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_export_list/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_import_list/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts delete mode 100644 packages/kbn-securitysolution-list-utils/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts delete mode 100644 packages/kbn-securitysolution-rules/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-t-grid/BUILD.bazel delete mode 100644 packages/kbn-securitysolution-utils/BUILD.bazel delete mode 100644 packages/kbn-server-http-tools/BUILD.bazel delete mode 100644 packages/kbn-server-route-repository/BUILD.bazel rename packages/kbn-server-route-repository/{web_index.ts => browser_index.ts} (100%) delete mode 100644 packages/kbn-shared-svg/BUILD.bazel delete mode 100644 packages/kbn-shared-ux-utility/BUILD.bazel delete mode 100644 packages/kbn-some-dev-log/BUILD.bazel delete mode 100644 packages/kbn-sort-package-json/BUILD.bazel delete mode 100644 packages/kbn-spec-to-console/BUILD.bazel delete mode 100644 packages/kbn-stdio-dev-helpers/BUILD.bazel delete mode 100644 packages/kbn-storybook/BUILD.bazel delete mode 100644 packages/kbn-synthetic-package-map/BUILD.bazel delete mode 100644 packages/kbn-synthetic-package-map/kibana.jsonc delete mode 100644 packages/kbn-synthetic-package-map/tsconfig.json delete mode 100644 packages/kbn-telemetry-tools/BUILD.bazel delete mode 100644 packages/kbn-test-jest-helpers/BUILD.bazel delete mode 100644 packages/kbn-test-subj-selector/BUILD.bazel delete mode 100644 packages/kbn-test/BUILD.bazel delete mode 100644 packages/kbn-test/src/jest/integration_tests/__fixtures__/jest.config.js delete mode 100644 packages/kbn-test/src/jest/integration_tests/__fixtures__/test.js delete mode 100644 packages/kbn-test/src/jest/integration_tests/junit_reporter.test.ts rename packages/{kbn-optimizer/src/worker/run_worker_from_source.js => kbn-test/src/jest/junit_reporter/index.js} (80%) rename packages/kbn-test/src/jest/{ => junit_reporter}/junit_reporter.ts (96%) create mode 100644 packages/kbn-test/src/jest/resolver.js delete mode 100644 packages/kbn-test/src/jest/setup/babel_polyfill.js delete mode 100644 packages/kbn-test/src/jest/setup/preserve_symlinks_resolver.js delete mode 100644 packages/kbn-timelion-grammar/BUILD.bazel create mode 100644 packages/kbn-timelion-grammar/tsconfig.json delete mode 100644 packages/kbn-tinymath/BUILD.bazel delete mode 100644 packages/kbn-tooling-log/BUILD.bazel create mode 100644 packages/kbn-ts-project-linter-cli/README.md create mode 100644 packages/kbn-ts-project-linter-cli/jest.config.js create mode 100644 packages/kbn-ts-project-linter-cli/kibana.jsonc create mode 100644 packages/kbn-ts-project-linter-cli/package.json create mode 100644 packages/kbn-ts-project-linter-cli/run_lint_ts_projects_cli.ts create mode 100644 packages/kbn-ts-project-linter-cli/tsconfig.json create mode 100644 packages/kbn-ts-project-linter/README.md rename packages/{kbn-utils/src/package_json/index.test.ts => kbn-ts-project-linter/ast/ast.ts} (57%) create mode 100644 packages/kbn-ts-project-linter/ast/babel.ts create mode 100644 packages/kbn-ts-project-linter/ast/compiler_options.test.ts create mode 100644 packages/kbn-ts-project-linter/ast/compiler_options.ts create mode 100644 packages/kbn-ts-project-linter/ast/ends.test.ts create mode 100644 packages/kbn-ts-project-linter/ast/ends.ts create mode 100644 packages/kbn-ts-project-linter/ast/exclude.test.ts create mode 100644 packages/kbn-ts-project-linter/ast/exclude.ts rename packages/{kbn-optimizer/src/node/transforms => kbn-ts-project-linter/ast}/index.ts (63%) create mode 100644 packages/kbn-ts-project-linter/ast/props.ts create mode 100644 packages/kbn-ts-project-linter/ast/references.test.ts create mode 100644 packages/kbn-ts-project-linter/ast/references.ts create mode 100644 packages/kbn-ts-project-linter/ast/snip.test.ts create mode 100644 packages/kbn-ts-project-linter/ast/snip.ts create mode 100644 packages/kbn-ts-project-linter/index.ts create mode 100644 packages/kbn-ts-project-linter/jest.config.js create mode 100644 packages/kbn-ts-project-linter/kibana.jsonc create mode 100644 packages/kbn-ts-project-linter/lib/import_locator.ts create mode 100644 packages/kbn-ts-project-linter/lib/lint_projects.ts create mode 100644 packages/kbn-ts-project-linter/lib/project_file_map.ts create mode 100644 packages/kbn-ts-project-linter/lib/rule.ts create mode 100644 packages/kbn-ts-project-linter/lib/rule_context.ts create mode 100644 packages/kbn-ts-project-linter/lib/strip_source_code.ts create mode 100644 packages/kbn-ts-project-linter/package.json create mode 100644 packages/kbn-ts-project-linter/rules/forbidden_compiler_options.ts create mode 100644 packages/kbn-ts-project-linter/rules/index.ts create mode 100644 packages/kbn-ts-project-linter/rules/reference_pkg_ids.ts create mode 100644 packages/kbn-ts-project-linter/rules/reference_used_pkgs.ts create mode 100644 packages/kbn-ts-project-linter/rules/required_compiler_options.ts create mode 100644 packages/kbn-ts-project-linter/rules/required_excludes.ts rename packages/{kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts => kbn-ts-project-linter/rules/required_file_selectors.ts} (50%) create mode 100644 packages/kbn-ts-project-linter/rules/valid_base_config.ts create mode 100644 packages/kbn-ts-project-linter/tsconfig.json create mode 100644 packages/kbn-ts-projects/README.md rename {src/dev/typescript => packages/kbn-ts-projects}/index.ts (81%) create mode 100644 packages/kbn-ts-projects/jest.config.js create mode 100644 packages/kbn-ts-projects/kibana.jsonc create mode 100644 packages/kbn-ts-projects/package.json create mode 100644 packages/kbn-ts-projects/project.ts rename {src/dev/typescript => packages/kbn-ts-projects}/projects.ts (95%) create mode 100644 packages/kbn-ts-projects/ts_configfile.ts create mode 100644 packages/kbn-ts-projects/tsconfig.json create mode 100644 packages/kbn-ts-type-check-cli/README.md create mode 100644 packages/kbn-ts-type-check-cli/jest.config.js create mode 100644 packages/kbn-ts-type-check-cli/kibana.jsonc create mode 100644 packages/kbn-ts-type-check-cli/package.json rename {src/dev/typescript => packages/kbn-ts-type-check-cli}/root_refs_config.ts (83%) create mode 100644 packages/kbn-ts-type-check-cli/run_type_check_cli.ts create mode 100644 packages/kbn-ts-type-check-cli/tsconfig.json delete mode 100644 packages/kbn-type-summarizer-cli/BUILD.bazel delete mode 100644 packages/kbn-type-summarizer-cli/README.md delete mode 100644 packages/kbn-type-summarizer-cli/index.ts delete mode 100644 packages/kbn-type-summarizer-cli/kibana.jsonc delete mode 100644 packages/kbn-type-summarizer-cli/package.json delete mode 100644 packages/kbn-type-summarizer-cli/src/cli_config.ts delete mode 100644 packages/kbn-type-summarizer-cli/src/cli_flags.ts delete mode 100644 packages/kbn-type-summarizer-cli/src/run.ts delete mode 100644 packages/kbn-type-summarizer-cli/tsconfig.json delete mode 100644 packages/kbn-type-summarizer-core/BUILD.bazel delete mode 100644 packages/kbn-type-summarizer-core/README.md delete mode 100644 packages/kbn-type-summarizer-core/index.ts delete mode 100644 packages/kbn-type-summarizer-core/kibana.jsonc delete mode 100644 packages/kbn-type-summarizer-core/package.json delete mode 100644 packages/kbn-type-summarizer-core/src/cli_error.ts delete mode 100644 packages/kbn-type-summarizer-core/src/error.ts delete mode 100644 packages/kbn-type-summarizer-core/src/fs.ts delete mode 100644 packages/kbn-type-summarizer-core/src/json.test.ts delete mode 100644 packages/kbn-type-summarizer-core/src/json.ts delete mode 100644 packages/kbn-type-summarizer-core/src/log/cli_log.ts delete mode 100644 packages/kbn-type-summarizer-core/src/log/index.ts delete mode 100644 packages/kbn-type-summarizer-core/src/log/logger.ts delete mode 100644 packages/kbn-type-summarizer-core/src/path.ts delete mode 100644 packages/kbn-type-summarizer-core/src/set_map.ts delete mode 100644 packages/kbn-type-summarizer-core/src/ts_helpers.ts delete mode 100644 packages/kbn-type-summarizer-core/tsconfig.json delete mode 100644 packages/kbn-type-summarizer/BUILD.bazel delete mode 100644 packages/kbn-type-summarizer/README.mdx delete mode 100644 packages/kbn-type-summarizer/index.ts delete mode 100644 packages/kbn-type-summarizer/kibana.jsonc delete mode 100644 packages/kbn-type-summarizer/package.json delete mode 100644 packages/kbn-type-summarizer/src/lib/ast_index.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ast_indexer.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ast_traverser.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/counter_map.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/dts_snipper.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/export_details.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/import_details.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/source_file_mapper.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/source_mapper.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/symbol_resolver.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/dec_symbol.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/export_from.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/exportable_node.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/imports.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/index.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_nodes/syntax_kind.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/ts_project.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/tsconfig_file.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/type_summary/print_imports.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/type_summary/print_locals.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/type_summary/print_type_summary.ts delete mode 100644 packages/kbn-type-summarizer/src/lib/type_summary/type_summary_namer.ts delete mode 100644 packages/kbn-type-summarizer/src/summarize_package.ts delete mode 100644 packages/kbn-type-summarizer/src/tests/integration_helpers.ts delete mode 100644 packages/kbn-type-summarizer/src/tests/integration_tests/ast_indexer.test.ts delete mode 100644 packages/kbn-type-summarizer/src/tests/integration_tests/dts_snipper.ts delete mode 100644 packages/kbn-type-summarizer/src/tests/integration_tests/summarize_package.test.ts delete mode 100644 packages/kbn-type-summarizer/src/tests/source_map_reader.ts delete mode 100644 packages/kbn-type-summarizer/tsconfig.json delete mode 100644 packages/kbn-typed-react-router-config/BUILD.bazel delete mode 100644 packages/kbn-ui-framework/BUILD.bazel delete mode 100644 packages/kbn-ui-shared-deps-npm/index.d.ts delete mode 100644 packages/kbn-user-profile-components/BUILD.bazel delete mode 100644 packages/kbn-utility-types-jest/BUILD.bazel delete mode 100644 packages/kbn-utility-types/BUILD.bazel delete mode 100644 packages/kbn-utils/BUILD.bazel create mode 100644 packages/kbn-web-worker-stub/README.md create mode 100644 packages/kbn-web-worker-stub/index.ts create mode 100644 packages/kbn-web-worker-stub/jest.config.js create mode 100644 packages/kbn-web-worker-stub/kibana.jsonc create mode 100644 packages/kbn-web-worker-stub/package.json create mode 100644 packages/kbn-web-worker-stub/tsconfig.json delete mode 100644 packages/kbn-yarn-lock-validator/BUILD.bazel delete mode 100644 packages/shared-ux/avatar/solution/BUILD.bazel delete mode 100644 packages/shared-ux/avatar/user_profile/impl/BUILD.bazel delete mode 100644 packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel delete mode 100644 packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/button/exit_full_screen/types/BUILD.bazel delete mode 100644 packages/shared-ux/button_toolbar/BUILD.bazel delete mode 100644 packages/shared-ux/card/no_data/impl/BUILD.bazel delete mode 100644 packages/shared-ux/card/no_data/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/card/no_data/types/BUILD.bazel delete mode 100644 packages/shared-ux/file/context/BUILD.bazel delete mode 100644 packages/shared-ux/file/file_picker/impl/BUILD.bazel delete mode 100644 packages/shared-ux/file/file_upload/impl/BUILD.bazel delete mode 100644 packages/shared-ux/file/image/impl/BUILD.bazel delete mode 100644 packages/shared-ux/file/image/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/file/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/file/types/BUILD.bazel delete mode 100644 packages/shared-ux/file/util/BUILD.bazel delete mode 100644 packages/shared-ux/link/redirect_app/impl/BUILD.bazel delete mode 100644 packages/shared-ux/link/redirect_app/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/link/redirect_app/types/BUILD.bazel delete mode 100644 packages/shared-ux/markdown/impl/BUILD.bazel delete mode 100644 packages/shared-ux/markdown/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/markdown/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel delete mode 100644 packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/page/analytics_no_data/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_no_data/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_template/impl/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_template/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/page/kibana_template/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data/impl/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data_config/impl/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data_config/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/page/no_data_config/types/BUILD.bazel delete mode 100644 packages/shared-ux/page/solution_nav/BUILD.bazel delete mode 100644 packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel delete mode 100644 packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/prompt/no_data_views/types/BUILD.bazel delete mode 100644 packages/shared-ux/prompt/not_found/BUILD.bazel delete mode 100644 packages/shared-ux/router/impl/BUILD.bazel delete mode 100644 packages/shared-ux/router/mocks/BUILD.bazel delete mode 100644 packages/shared-ux/router/types/BUILD.bazel delete mode 100644 packages/shared-ux/storybook/config/BUILD.bazel delete mode 100644 packages/shared-ux/storybook/mock/BUILD.bazel delete mode 100644 scripts/check_ts_projects.js delete mode 100644 scripts/find_target_node_imports_in_bundles.js rename packages/kbn-type-summarizer/src/lib/type_summary/index.ts => scripts/ts_project_linter.js (82%) delete mode 100644 scripts/type_summarizer.js delete mode 100644 src/dev/bazel/jsts_transpiler.bzl delete mode 100644 src/dev/bazel/pkg_npm_types.bzl create mode 100644 src/dev/build/lib/fs_records.ts delete mode 100644 src/dev/typescript/project.ts delete mode 100644 src/dev/typescript/run_check_ts_projects_cli.ts delete mode 100644 src/dev/typescript/run_type_check_cli.ts delete mode 100644 src/dev/typescript/ts_configfile.ts delete mode 100644 src/setup_node_env/ensure_node_preserve_symlinks.js delete mode 100644 src/setup_node_env/no_transpilation.js rename packages/kbn-es/src/cli_commands/index.js => src/setup_node_env/polyfill.ts (60%) rename src/setup_node_env/{no_transpilation_dist.js => setup_env.js} (93%) delete mode 100644 tsconfig.bazel.json delete mode 100644 x-pack/packages/ml/agg_utils/BUILD.bazel delete mode 100644 x-pack/packages/ml/aiops_components/BUILD.bazel delete mode 100644 x-pack/packages/ml/aiops_utils/BUILD.bazel delete mode 100644 x-pack/packages/ml/is_populated_object/BUILD.bazel delete mode 100644 x-pack/packages/ml/string_hash/BUILD.bazel create mode 100644 x-pack/plugins/canvas/server/templates/assets/048ed81e-84ae-4a48-9c30-641cf72b0376.jpg create mode 100644 x-pack/plugins/canvas/server/templates/assets/0791ed56-9a2e-4d0d-8d2d-a2f8c3c268ee.jpg create mode 100644 x-pack/plugins/canvas/server/templates/assets/0c6f377f-771e-432e-8e2e-15c3e9142ad6.png create mode 100644 x-pack/plugins/canvas/server/templates/assets/23edd689-2d34-4bb8-a3eb-05420dd87b85.svg create mode 100644 x-pack/plugins/canvas/server/templates/assets/6fb8f925-0e1e-4108-8442-3dbf88d145e5.jpg create mode 100644 x-pack/plugins/canvas/server/templates/assets/7f2d5d96-3c85-49a0-94f3-e9b05de23cb6.jpg create mode 100644 x-pack/plugins/canvas/server/templates/assets/9c2e5ab5-2dbe-43a8-bc84-e67f191fbcd8.png create mode 100644 x-pack/plugins/canvas/server/templates/assets/a30a06eb-2276-44b1-a62d-856e2116138c.jpg create mode 100644 x-pack/plugins/canvas/server/templates/assets/aa91a324-8012-477e-a7e4-7c3cd7a6332f.svg create mode 100644 x-pack/plugins/canvas/server/templates/assets/b22b6fa7-618c-4a59-82a1-ca921454da48.svg create mode 100644 x-pack/plugins/canvas/server/templates/assets/d38c5025-eafc-4a35-a5fd-fb7b5bdc9efa.jpg rename x-pack/plugins/enterprise_search/{ => common}/jest.config.js (91%) create mode 100644 x-pack/plugins/enterprise_search/public/jest.config.js create mode 100644 x-pack/plugins/enterprise_search/server/jest.config.js delete mode 100644 x-pack/plugins/security_solution/cypress/plugins/index.js create mode 100644 x-pack/plugins/security_solution/server/__mocks__/module_name_map.js delete mode 100644 x-pack/plugins/threat_intelligence/cypress/plugins/index.js create mode 100644 x-pack/plugins/timelines/server/utils/beat_schema/fields.json create mode 100644 x-pack/plugins/timelines/server/utils/beat_schema/fields.json.d.ts delete mode 100644 x-pack/plugins/timelines/server/utils/beat_schema/fields.ts diff --git a/.bazelrc.common b/.bazelrc.common index d93c107637b7..e8cdda8d2ae9 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -49,12 +49,11 @@ query --incompatible_no_implicit_file_export # Log configs ## different from default common --color=yes -common --show_progress +common --noshow_progress common --show_task_finish common --show_progress_rate_limit=10 build --progress_report_interval=10 -build --show_loading_progress -build --show_result=1 +build --noshow_loading_progress # Specifies desired output mode for running tests. # Valid values are diff --git a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts index 2468111d6933..43abaa7dcc52 100644 --- a/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts +++ b/.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts @@ -294,14 +294,14 @@ export async function pickTestGroupRunOrder() { groups: [ { type: UNIT_TYPE, - defaultMin: 3, + defaultMin: 60, maxMin: JEST_MAX_MINUTES, overheadMin: 0.2, names: jestUnitConfigs, }, { type: INTEGRATION_TYPE, - defaultMin: 10, + defaultMin: 60, maxMin: JEST_MAX_MINUTES, overheadMin: 0.2, names: jestIntegrationConfigs, @@ -389,7 +389,7 @@ export async function pickTestGroupRunOrder() { label: 'Jest Tests', command: getRequiredEnv('JEST_UNIT_SCRIPT'), parallelism: unit.count, - timeout_in_minutes: 60, + timeout_in_minutes: 120, key: 'jest', agents: { queue: 'n2-4-spot', @@ -409,7 +409,7 @@ export async function pickTestGroupRunOrder() { label: 'Jest Integration Tests', command: getRequiredEnv('JEST_INTEGRATION_SCRIPT'), parallelism: integration.count, - timeout_in_minutes: 60, + timeout_in_minutes: 120, key: 'jest-integration', agents: { queue: 'n2-4-spot', diff --git a/.buildkite/scripts/steps/checks.sh b/.buildkite/scripts/steps/checks.sh index 0e11ac04eea1..c7c22d7958ed 100755 --- a/.buildkite/scripts/steps/checks.sh +++ b/.buildkite/scripts/steps/checks.sh @@ -6,18 +6,18 @@ export DISABLE_BOOTSTRAP_VALIDATION=false .buildkite/scripts/bootstrap.sh .buildkite/scripts/steps/checks/precommit_hook.sh -.buildkite/scripts/steps/checks/ftr_configs.sh +.buildkite/scripts/steps/checks/ts_projects.sh .buildkite/scripts/steps/checks/bazel_packages.sh +.buildkite/scripts/steps/checks/verify_notice.sh +.buildkite/scripts/steps/checks/plugin_list_docs.sh .buildkite/scripts/steps/checks/event_log.sh .buildkite/scripts/steps/checks/telemetry.sh -.buildkite/scripts/steps/checks/ts_projects.sh .buildkite/scripts/steps/checks/jest_configs.sh -.buildkite/scripts/steps/checks/plugin_list_docs.sh .buildkite/scripts/steps/checks/bundle_limits.sh .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/verify_notice.sh .buildkite/scripts/steps/checks/test_projects.sh .buildkite/scripts/steps/checks/test_hardening.sh +.buildkite/scripts/steps/checks/ftr_configs.sh diff --git a/.buildkite/scripts/steps/checks/bazel_packages.sh b/.buildkite/scripts/steps/checks/bazel_packages.sh index a8a631ed48ae..507b0d5bbdc1 100755 --- a/.buildkite/scripts/steps/checks/bazel_packages.sh +++ b/.buildkite/scripts/steps/checks/bazel_packages.sh @@ -4,10 +4,6 @@ set -euo pipefail source .buildkite/scripts/common/util.sh -echo --- Check Bazel Packages Manifest -node scripts/generate packages_build_manifest -check_for_changed_files 'node scripts/generate packages_build_manifest' true - echo --- Check Codeowners Manifest if [ -f ".github/CODEOWNERS" ]; then node scripts/generate codeowners diff --git a/.buildkite/scripts/steps/checks/ts_projects.sh b/.buildkite/scripts/steps/checks/ts_projects.sh index a98f0f6d90f1..ed0c6890675c 100755 --- a/.buildkite/scripts/steps/checks/ts_projects.sh +++ b/.buildkite/scripts/steps/checks/ts_projects.sh @@ -4,5 +4,11 @@ set -euo pipefail source .buildkite/scripts/common/util.sh -echo --- Check TypeScript Projects -node scripts/check_ts_projects +echo --- Run TS Project Linter +cmd="node scripts/ts_project_linter" +if is_pr && ! is_auto_commit_disabled; then + cmd="$cmd --fix" +fi + +eval "$cmd" +check_for_changed_files "$cmd" true diff --git a/.buildkite/tsconfig.json b/.buildkite/tsconfig.json index f40776430f39..52a8d88f3d85 100644 --- a/.buildkite/tsconfig.json +++ b/.buildkite/tsconfig.json @@ -1,12 +1,9 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "declarationMap": true, "incremental": false, "composite": false, - "emitDeclarationOnly": true, - "outDir": "./target/types", + "outDir": "target/types", "types": ["node", "mocha"], "paths": { "#pipeline-utils": [".buildkite/pipeline-utils/index.ts"], @@ -19,5 +16,8 @@ "scripts/**/*", "pipelines/flaky_tests/groups.json", "pull_requests.json" + ], + "exclude": [ + "target/**/*", ] } diff --git a/.eslintrc.js b/.eslintrc.js index 5a5648935685..29956462b034 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,12 +6,14 @@ * Side Public License, v 1. */ +require('@kbn/babel-register').install(); + const Path = require('path'); const Fs = require('fs'); const normalizePath = require('normalize-path'); const { discoverPackageManifestPaths, Jsonc } = require('@kbn/bazel-packages'); -const { REPO_ROOT } = require('@kbn/utils'); +const { REPO_ROOT } = require('@kbn/repo-info'); const APACHE_2_0_LICENSE_HEADER = ` /* @@ -137,6 +139,7 @@ const DEV_DIRECTORIES = [ '__mocks__', '__stories__', 'e2e', + 'cypress', 'fixtures', 'ftr_e2e', 'integration_tests', @@ -165,7 +168,7 @@ const DEV_FILE_PATTERNS = [ 'mock.{js,ts,tsx}', '_stubs.{js,ts,tsx}', '{testHelpers,test_helper,test_utils}.{js,ts,tsx}', - '{postcss,webpack}.config.js', + '{postcss,webpack,cypress}.config.{js,ts}', ]; /** Glob patterns which describe dev-only code. */ @@ -175,10 +178,10 @@ const DEV_PATTERNS = [ ...DEV_FILE_PATTERNS.map((file) => `{packages,src,x-pack}/**/${file}`), 'packages/kbn-interpreter/tasks/**/*', 'src/dev/**/*', - 'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*', - 'x-pack/plugins/*/server/scripts/**/*', - 'x-pack/plugins/fleet/cypress', + 'x-pack/{dev-tools,tasks,test,build_chromium}/**/*', 'x-pack/performance/**/*', + 'src/setup_node_env/index.js', + 'src/cli/dev.js', ]; /** Restricted imports with suggested alternatives */ @@ -599,6 +602,7 @@ module.exports = { 'x-pack/test/saved_object_api_integration/*/apis/**/*', 'x-pack/test/ui_capabilities/*/tests/**/*', 'x-pack/test/performance/**/*.ts', + '**/cypress.config.{js,ts}', ], rules: { 'import/no-default-export': 'off', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0e3865ae5b28..b4e1691627c2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -889,8 +889,10 @@ packages/kbn-apm-config-loader @elastic/kibana-core @vigneshshanmugam packages/kbn-apm-synthtrace @elastic/apm-ui packages/kbn-apm-utils @elastic/apm-ui packages/kbn-axe-config @elastic/kibana-qa -packages/kbn-babel-plugin-synthetic-packages @elastic/kibana-operations +packages/kbn-babel-plugin-package-imports @elastic/kibana-operations packages/kbn-babel-preset @elastic/kibana-operations +packages/kbn-babel-register @elastic/kibana-operations +packages/kbn-babel-transform @elastic/kibana-operations packages/kbn-bazel-packages @elastic/kibana-operations packages/kbn-bazel-runner @elastic/kibana-operations packages/kbn-cases-components @elastic/response-ops @@ -905,6 +907,7 @@ packages/kbn-config-mocks @elastic/kibana-core packages/kbn-config-schema @elastic/kibana-core packages/kbn-crypto @elastic/kibana-security packages/kbn-crypto-browser @elastic/kibana-core +packages/kbn-cypress-config @elastic/kibana-operations packages/kbn-datemath @elastic/kibana-app-services packages/kbn-dev-cli-errors @elastic/kibana-operations packages/kbn-dev-cli-runner @elastic/kibana-operations @@ -954,6 +957,7 @@ packages/kbn-monaco @elastic/kibana-global-experience packages/kbn-optimizer @elastic/kibana-operations packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations packages/kbn-osquery-io-ts-types @elastic/security-asset-management +packages/kbn-package-map @elastic/kibana-operations packages/kbn-peggy @elastic/kibana-operations packages/kbn-peggy-loader @elastic/kibana-operations packages/kbn-performance-testing-dataset-extractor @elastic/kibana-performance-testing @@ -961,6 +965,8 @@ packages/kbn-plugin-discovery @elastic/kibana-operations packages/kbn-plugin-generator @elastic/kibana-operations packages/kbn-plugin-helpers @elastic/kibana-operations packages/kbn-react-field @elastic/kibana-app-services +packages/kbn-repo-info @elastic/kibana-operations +packages/kbn-repo-path @elastic/kibana-operations packages/kbn-repo-source-classifier @elastic/kibana-operations packages/kbn-repo-source-classifier-cli @elastic/kibana-operations packages/kbn-rison @elastic/kibana-operations @@ -991,7 +997,6 @@ packages/kbn-spec-to-console @elastic/platform-deployment-management packages/kbn-std @elastic/kibana-core packages/kbn-stdio-dev-helpers @elastic/kibana-operations packages/kbn-storybook @elastic/kibana-operations -packages/kbn-synthetic-package-map @elastic/kibana-operations packages/kbn-telemetry-tools @elastic/kibana-core packages/kbn-test @elastic/kibana-operations packages/kbn-test-jest-helpers @elastic/kibana-operations @@ -999,9 +1004,10 @@ packages/kbn-test-subj-selector @elastic/kibana-operations packages/kbn-timelion-grammar @elastic/kibana-visualizations packages/kbn-tinymath @elastic/kibana-visualizations packages/kbn-tooling-log @elastic/kibana-operations -packages/kbn-type-summarizer @elastic/kibana-operations -packages/kbn-type-summarizer-cli @elastic/kibana-operations -packages/kbn-type-summarizer-core @elastic/kibana-operations +packages/kbn-ts-project-linter @elastic/kibana-operations +packages/kbn-ts-project-linter-cli @elastic/kibana-operations +packages/kbn-ts-projects @elastic/kibana-operations +packages/kbn-ts-type-check-cli @elastic/kibana-operations packages/kbn-typed-react-router-config @elastic/apm-ui packages/kbn-ui-framework @elastic/kibana-design packages/kbn-ui-shared-deps-npm @elastic/kibana-operations @@ -1011,6 +1017,7 @@ packages/kbn-user-profile-components @elastic/kibana-security packages/kbn-utility-types @elastic/kibana-core packages/kbn-utility-types-jest @elastic/kibana-operations packages/kbn-utils @elastic/kibana-operations +packages/kbn-web-worker-stub @elastic/kibana-operations packages/kbn-yarn-lock-validator @elastic/kibana-operations packages/shared-ux/avatar/solution @elastic/kibana-global-experience packages/shared-ux/avatar/user_profile/impl @elastic/kibana-global-experience diff --git a/.gitignore b/.gitignore index e2e526faa5ff..ac56ce3034f7 100644 --- a/.gitignore +++ b/.gitignore @@ -94,8 +94,7 @@ report.asciidoc # Automatically generated and user-modifiable /tsconfig.refs.json -tsconfig.base.type_check.json -tsconfig.type_check.json +*.type_check.json # Yarn local mirror content .yarn-local-mirror @@ -111,5 +110,5 @@ elastic-agent-* fleet-server-* elastic-agent.yml fleet-server.yml -/packages/kbn-synthetic-package-map/synthetic-packages.json - +/packages/kbn-package-map/package-map.json +/packages/kbn-synthetic-package-map/ diff --git a/BUILD.bazel b/BUILD.bazel index e838d312d876..02ed0e7a2973 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,11 +3,18 @@ exports_files( [ "tsconfig.base.json", - "tsconfig.bazel.json", "tsconfig.browser.json", "tsconfig.browser_bazel.json", "tsconfig.json", - "package.json" + "package.json", + ".browserslistrc" ], visibility = ["//visibility:public"] ) + +config_setting( + name = "dist", + values = { + "define": "dist=true" + } +) diff --git a/NOTICE.txt b/NOTICE.txt index 5115746affeb..358f52f23a0e 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -135,6 +135,32 @@ THE SOFTWARE. This product uses Noto fonts that are licensed under the SIL Open Font License, Version 1.1. +--- +This project includes code from the NX project, which is MIT licensed: + +(The MIT License) + +Copyright (c) 2017-2022 Narwhal Technologies Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --- Vendored copy of `strip-json-comments` so that we can use it when npm modules are not available. https://github.com/sindresorhus/strip-json-comments/tree/34b79cb0f1129aa85ef4b5c3292e8bc546984ef9 diff --git a/dev_docs/operations/operations_landing.mdx b/dev_docs/operations/operations_landing.mdx index b38570ea44d1..ab572bb73bb0 100644 --- a/dev_docs/operations/operations_landing.mdx +++ b/dev_docs/operations/operations_landing.mdx @@ -37,7 +37,7 @@ layout: landing { pageId: "kibDevDocsOpsOptimizer" }, { pageId: "kibDevDocsOpsBabelPreset" }, { pageId: "kibDevDocsOpsTypeSummarizer" }, - { pageId: "kibDevDocsOpsBabelPluginSyntheticPackages" }, + { pageId: "kibDevDocsOpsBabelPluginPackageImports" }, { pageId: "kibDevDocsOpsUiSharedDepsNpm" }, { pageId: "kibDevDocsOpsUiSharedDepsSrc" }, { pageId: "kibDevDocsOpsPluginDiscovery" }, diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 814beb270c7f..06666957c9ee 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -6,7 +6,7 @@ NOTE: node scripts/build_plugin_list_docs - You can update the template within node_modules/@kbn/dev-utils/target_node/src/plugin_list/generate_plugin_list.js + You can update the template within packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts //// diff --git a/examples/bfetch_explorer/tsconfig.json b/examples/bfetch_explorer/tsconfig.json index 42e691f7ad15..94a4f021199d 100644 --- a/examples/bfetch_explorer/tsconfig.json +++ b/examples/bfetch_explorer/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "index.ts", @@ -10,11 +10,13 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/bfetch/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/bfetch-plugin", + "@kbn/kibana-react-plugin", ] } diff --git a/examples/controls_example/tsconfig.json b/examples/controls_example/tsconfig.json index 43673c863c7d..1af21f31728d 100644 --- a/examples/controls_example/tsconfig.json +++ b/examples/controls_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,13 +11,19 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/controls/tsconfig.json" }, - { "path": "../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../src/plugins/presentation_util/tsconfig.json" } + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/data-plugin", + "@kbn/controls-plugin", + "@kbn/navigation-plugin", + "@kbn/presentation-util-plugin", + "@kbn/shared-ux-page-kibana-template", + "@kbn/embeddable-plugin", + "@kbn/data-views-plugin", + "@kbn/es-query", ] } diff --git a/examples/dashboard_embeddable_examples/tsconfig.json b/examples/dashboard_embeddable_examples/tsconfig.json index f35247900bc7..1258cf36fcb2 100644 --- a/examples/dashboard_embeddable_examples/tsconfig.json +++ b/examples/dashboard_embeddable_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,13 +10,14 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/dashboard/tsconfig.json" }, - { "path": "../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../embeddable_examples/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/dashboard-plugin", + "@kbn/kibana-react-plugin", + "@kbn/embeddable-examples-plugin", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/data_view_field_editor_example/tsconfig.json b/examples/data_view_field_editor_example/tsconfig.json index 51e599fd0eff..7411ac2608a6 100644 --- a/examples/data_view_field_editor_example/tsconfig.json +++ b/examples/data_view_field_editor_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,13 +9,14 @@ "public/**/*.tsx", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/data_views/tsconfig.json" }, - { "path": "../../src/plugins/data_view_field_editor/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/developer_examples/tsconfig.json b/examples/developer_examples/tsconfig.json index 0f3d8e259cb5..fdd37bde1e1e 100644 --- a/examples/developer_examples/tsconfig.json +++ b/examples/developer_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,10 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/examples/embeddable_examples/tsconfig.json b/examples/embeddable_examples/tsconfig.json index f32e7eb0850d..e80cad0399c9 100644 --- a/examples/embeddable_examples/tsconfig.json +++ b/examples/embeddable_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,15 +11,18 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../src/plugins/dashboard/tsconfig.json" }, - { "path": "../../src/plugins/saved_objects/tsconfig.json" }, - { "path": "../../src/plugins/presentation_util/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/ui-actions-plugin", + "@kbn/embeddable-plugin", + "@kbn/dashboard-plugin", + "@kbn/saved-objects-plugin", + "@kbn/i18n", + "@kbn/utility-types", ] } diff --git a/examples/embeddable_explorer/tsconfig.json b/examples/embeddable_explorer/tsconfig.json index b0c9c5dd74e2..b69738ab1f0b 100644 --- a/examples/embeddable_explorer/tsconfig.json +++ b/examples/embeddable_explorer/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,13 +10,15 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../src/plugins/inspector/tsconfig.json" }, - { "path": "../embeddable_examples/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/embeddable-plugin", + "@kbn/ui-actions-plugin", + "@kbn/inspector-plugin", + "@kbn/embeddable-examples-plugin", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/expressions_explorer/tsconfig.json b/examples/expressions_explorer/tsconfig.json index 0386f5e7188f..14703c0a4b8d 100644 --- a/examples/expressions_explorer/tsconfig.json +++ b/examples/expressions_explorer/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,13 +9,17 @@ "public/**/*.tsx", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/expressions/tsconfig.json" }, - { "path": "../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../src/plugins/inspector/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/expressions-plugin", + "@kbn/ui-actions-plugin", + "@kbn/inspector-plugin", + "@kbn/developer-examples-plugin", + "@kbn/i18n", + "@kbn/i18n-react", ] } diff --git a/examples/field_formats_example/tsconfig.json b/examples/field_formats_example/tsconfig.json index a7651b649e5b..4bedd7ff663b 100644 --- a/examples/field_formats_example/tsconfig.json +++ b/examples/field_formats_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "target/types", }, "include": [ "index.ts", @@ -12,12 +11,15 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/field_formats/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/data_view_field_editor/tsconfig.json" } + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/field-types", ] } diff --git a/examples/files_example/tsconfig.json b/examples/files_example/tsconfig.json index 9329f941c100..1a8172e72886 100644 --- a/examples/files_example/tsconfig.json +++ b/examples/files_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,10 +11,18 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/files/tsconfig.json" }, + "@kbn/core", + "@kbn/files-plugin", + "@kbn/shared-ux-file-types", + "@kbn/core-application-browser", + "@kbn/shared-ux-file-context", + "@kbn/shared-ux-file-image", + "@kbn/shared-ux-file-upload", + "@kbn/shared-ux-file-picker", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/guided_onboarding_example/tsconfig.json b/examples/guided_onboarding_example/tsconfig.json index 579818d8cbf7..d3c93fc9ec38 100644 --- a/examples/guided_onboarding_example/tsconfig.json +++ b/examples/guided_onboarding_example/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "__jest__/**/*", @@ -13,11 +11,13 @@ "../../typings/**/*", ], "kbn_references": [ - { - "path": "../../src/core/tsconfig.json" - }, - { - "path": "../../src/plugins/guided_onboarding/tsconfig.json" - }, + "@kbn/core", + "@kbn/guided-onboarding-plugin", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/guided-onboarding", + ], + "exclude": [ + "target/**/*", ] } diff --git a/examples/hello_world/tsconfig.json b/examples/hello_world/tsconfig.json index 6cfb28f7b331..6bf319afc2d9 100644 --- a/examples/hello_world/tsconfig.json +++ b/examples/hello_world/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,9 +11,11 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" } + "@kbn/core", + "@kbn/developer-examples-plugin" ] } diff --git a/examples/locator_examples/tsconfig.json b/examples/locator_examples/tsconfig.json index 43d13f87d005..2548553d7d1b 100644 --- a/examples/locator_examples/tsconfig.json +++ b/examples/locator_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,13 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/share/tsconfig.json" }, + "@kbn/core", + "@kbn/share-plugin", + "@kbn/utility-types", + "@kbn/kibana-utils-plugin", ] } diff --git a/examples/locator_explorer/tsconfig.json b/examples/locator_explorer/tsconfig.json index c609c50849cb..4cd9cc3f79a5 100644 --- a/examples/locator_explorer/tsconfig.json +++ b/examples/locator_explorer/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,11 +10,13 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/share/tsconfig.json" }, - { "path": "../locator_examples/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/share-plugin", + "@kbn/locator-examples-plugin", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/partial_results_example/tsconfig.json b/examples/partial_results_example/tsconfig.json index 97d4c752cc3b..d552b69a1670 100644 --- a/examples/partial_results_example/tsconfig.json +++ b/examples/partial_results_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "target/types", }, "include": [ "index.ts", @@ -10,10 +9,12 @@ "public/**/*.tsx", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/expressions-plugin", ] } diff --git a/examples/preboot_example/tsconfig.json b/examples/preboot_example/tsconfig.json index 270d71891751..130f58639961 100644 --- a/examples/preboot_example/tsconfig.json +++ b/examples/preboot_example/tsconfig.json @@ -1,10 +1,15 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*", "server/**/*"], - "kbn_references": [{ "path": "../../src/core/tsconfig.json" }] + "kbn_references": [ + "@kbn/core", + "@kbn/core-http-browser", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", + ] } diff --git a/examples/response_stream/tsconfig.json b/examples/response_stream/tsconfig.json index 162ecac0dca9..9e54eb4fb152 100644 --- a/examples/response_stream/tsconfig.json +++ b/examples/response_stream/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "index.ts", @@ -11,11 +11,15 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/data-plugin", + "@kbn/kibana-react-plugin", + "@kbn/aiops-utils", + "@kbn/config-schema", ] } diff --git a/examples/routing_example/tsconfig.json b/examples/routing_example/tsconfig.json index b3962d53fa4f..bf0c7af2e33c 100644 --- a/examples/routing_example/tsconfig.json +++ b/examples/routing_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,9 +11,13 @@ "common/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/core-http-browser", + "@kbn/config-schema", ] } diff --git a/examples/screenshot_mode_example/tsconfig.json b/examples/screenshot_mode_example/tsconfig.json index 5fc60b67ef56..ef8a3647d1d1 100644 --- a/examples/screenshot_mode_example/tsconfig.json +++ b/examples/screenshot_mode_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,12 +11,16 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../src/plugins/screenshot_mode/tsconfig.json" }, - { "path": "../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/navigation-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/usage-collection-plugin", + "@kbn/developer-examples-plugin", + "@kbn/analytics", + "@kbn/i18n-react", ] } diff --git a/examples/search_examples/tsconfig.json b/examples/search_examples/tsconfig.json index ef6c3e9c307e..3c5ac732dbfc 100644 --- a/examples/search_examples/tsconfig.json +++ b/examples/search_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,16 +11,25 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/data_views/tsconfig.json" }, - { "path": "../../src/plugins/inspector/tsconfig.json" }, - { "path": "../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../src/plugins/share/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/inspector-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/navigation-plugin", + "@kbn/share-plugin", + "@kbn/developer-examples-plugin", + "@kbn/unified-search-plugin", + "@kbn/i18n-react", + "@kbn/utility-types", + "@kbn/es-query", + "@kbn/i18n", + "@kbn/core-mount-utils-browser-internal", + "@kbn/config-schema", ] } diff --git a/examples/share_examples/tsconfig.json b/examples/share_examples/tsconfig.json index 43d13f87d005..102ef302040f 100644 --- a/examples/share_examples/tsconfig.json +++ b/examples/share_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,11 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/share/tsconfig.json" }, + "@kbn/core", + "@kbn/share-plugin", ] } diff --git a/examples/state_containers_examples/tsconfig.json b/examples/state_containers_examples/tsconfig.json index 09652684fecf..24bef65c50b4 100644 --- a/examples/state_containers_examples/tsconfig.json +++ b/examples/state_containers_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,14 +11,16 @@ "common/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/data_views/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/navigation-plugin", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/developer-examples-plugin", + "@kbn/es-query", ] } diff --git a/examples/ui_action_examples/tsconfig.json b/examples/ui_action_examples/tsconfig.json index 3a141670cb3f..b87f7cdf0d86 100644 --- a/examples/ui_action_examples/tsconfig.json +++ b/examples/ui_action_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,12 @@ "server/**/*.ts", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/ui_actions/tsconfig.json" }, + "@kbn/kibana-react-plugin", + "@kbn/ui-actions-plugin", + "@kbn/core", ] } diff --git a/examples/ui_actions_explorer/tsconfig.json b/examples/ui_actions_explorer/tsconfig.json index cfa13411c270..494a2b188a57 100644 --- a/examples/ui_actions_explorer/tsconfig.json +++ b/examples/ui_actions_explorer/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,12 +9,14 @@ "public/**/*.tsx", "../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../ui_action_examples/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/ui-actions-plugin", + "@kbn/ui-actions-examples-plugin", + "@kbn/developer-examples-plugin", ] } diff --git a/examples/user_profile_examples/tsconfig.json b/examples/user_profile_examples/tsconfig.json index f1d9145a39c1..0891a2ac5cc8 100644 --- a/examples/user_profile_examples/tsconfig.json +++ b/examples/user_profile_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,10 +10,17 @@ "server/**/*.ts", "../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../src/core/tsconfig.json" }, - { "path": "../../x-pack/plugins/security/tsconfig.json" }, - { "path": "../developer_examples/tsconfig.json" } + "@kbn/core", + "@kbn/security-plugin", + "@kbn/developer-examples-plugin", + "@kbn/user-profile-components", + "@kbn/shared-ux-page-kibana-template", + "@kbn/features-plugin", + "@kbn/spaces-plugin", + "@kbn/config-schema", ] } diff --git a/kbn_pm/README.mdx b/kbn_pm/README.mdx index 03568d5667a2..99f9316540f8 100644 --- a/kbn_pm/README.mdx +++ b/kbn_pm/README.mdx @@ -38,7 +38,7 @@ There are cases where `@kbn/pm` relies on code from packages, mostly to prevent 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/synthetic-package-map` to run Bazel + 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. \ No newline at end of file diff --git a/kbn_pm/src/cli.mjs b/kbn_pm/src/cli.mjs index 2c9d1019b588..376369cd9833 100644 --- a/kbn_pm/src/cli.mjs +++ b/kbn_pm/src/cli.mjs @@ -20,6 +20,7 @@ import { getHelp } from './lib/help.mjs'; import { createFlagError, isCliError } from './lib/cli_error.mjs'; import { getCmd } from './commands/index.mjs'; import { Log } from './lib/log.mjs'; +import External from './lib/external_packages.js'; const start = Date.now(); const args = new Args(process.argv.slice(2), process.env.CI ? ['--quiet'] : []); @@ -31,7 +32,7 @@ const cmdName = args.getCommandName(); */ async function tryToGetCiStatsReporter(log) { try { - const { CiStatsReporter } = await import('@kbn/ci-stats-reporter'); + const { CiStatsReporter } = External['@kbn/ci-stats-reporter'](); return CiStatsReporter.fromEnv(log); } catch { return; diff --git a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs index e00316aac3e7..1ed315fb93df 100644 --- a/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs +++ b/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs @@ -8,13 +8,15 @@ import { run } from '../../lib/spawn.mjs'; import * as Bazel from '../../lib/bazel.mjs'; +import External from '../../lib/external_packages.js'; + import { haveNodeModulesBeenManuallyDeleted, removeYarnIntegrityFileIfExists } from './yarn.mjs'; import { setupRemoteCache } from './setup_remote_cache.mjs'; -import { regenerateSyntheticPackageMap } from './regenerate_synthetic_package_map.mjs'; import { sortPackageJson } from './sort_package_json.mjs'; -import { REPO_ROOT } from '../../lib/paths.mjs'; -import { pluginDiscovery } from './plugins.mjs'; +import { regeneratePackageMap } from './regenerate_package_map.mjs'; import { regenerateBaseTsconfig } from './regenerate_base_tsconfig.mjs'; +import { packageDiscovery, pluginDiscovery } from './discovery.mjs'; +import { validatePackageJson } from './validate_package_json.mjs'; /** @type {import('../../lib/command').Command} */ export const command = { @@ -83,45 +85,50 @@ export const command = { }); } - const plugins = await time('plugin discovery', async () => { - return await pluginDiscovery(); + // discover the location of packages and plugins + const [plugins, packages] = await Promise.all([ + time('plugin discovery', pluginDiscovery), + time('package discovery', packageDiscovery), + ]); + + // generate the package map which powers the resolver and several other features + // needed as an input to the bazel builds + await time('regenerate package map', async () => { + await regeneratePackageMap(packages, plugins, log); }); - // generate the synthetic package map which powers several other features, needed - // as an input to the package build - await time('regenerate synthetic package map', async () => { - await regenerateSyntheticPackageMap(plugins); + await time('pre-build webpack bundles for packages', async () => { + await Bazel.buildWebpackBundles(log, { offline, quiet }); }); - await time('build packages', async () => { - await Bazel.buildPackages(log, { offline, quiet }); - }); - await time('sort package json', async () => { - await sortPackageJson(); - }); await time('regenerate tsconfig.base.json', async () => { - const { discoverBazelPackages } = await import('@kbn/bazel-packages'); - await regenerateBaseTsconfig(await discoverBazelPackages(REPO_ROOT), plugins); + await regenerateBaseTsconfig(); }); - if (validate) { - // now that packages are built we can import `@kbn/yarn-lock-validator` - const { readYarnLock, validateDependencies } = await import('@kbn/yarn-lock-validator'); - const yarnLock = await time('read yarn.lock', async () => { - return await readYarnLock(); - }); - await time('validate dependencies', async () => { - await validateDependencies(log, yarnLock); - }); - } + await Promise.all([ + time('sort package json', async () => { + await sortPackageJson(); + }), + time('validate package json', async () => { + // now that deps are installed we can import `@kbn/yarn-lock-validator` + const { kibanaPackageJson } = External['@kbn/repo-info'](); + await validatePackageJson(kibanaPackageJson, log); + }), + validate + ? time('validate dependencies', async () => { + // now that deps are installed we can import `@kbn/yarn-lock-validator` + const { readYarnLock, validateDependencies } = External['@kbn/yarn-lock-validator'](); + await validateDependencies(log, await readYarnLock()); + }) + : undefined, + vscodeConfig + ? time('update vscode config', async () => { + // Update vscode settings + await run('node', ['scripts/update_vscode_config']); - if (vscodeConfig) { - await time('update vscode config', async () => { - // Update vscode settings - await run('node', ['scripts/update_vscode_config']); - - log.success('vscode config updated'); - }); - } + log.success('vscode config updated'); + }) + : undefined, + ]); }, }; diff --git a/kbn_pm/src/commands/bootstrap/discovery.mjs b/kbn_pm/src/commands/bootstrap/discovery.mjs new file mode 100644 index 000000000000..42cce1ed3a12 --- /dev/null +++ b/kbn_pm/src/commands/bootstrap/discovery.mjs @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { REPO_ROOT } from '../../lib/paths.mjs'; + +// we need to run these in order to generate the pkg map which is used by things +// like `@kbn/babel-register`, so we have to import the JS files directory and can't +// rely on `@kbn/babel-register`. + +export async function packageDiscovery() { + const { discoverBazelPackages } = await import( + // eslint-disable-next-line @kbn/imports/uniform_imports + '../../../../packages/kbn-bazel-packages/index.js' + ); + + return await discoverBazelPackages(REPO_ROOT); +} + +export async function pluginDiscovery() { + const { getPluginSearchPaths, simpleKibanaPlatformPluginDiscovery } = await import( + // eslint-disable-next-line @kbn/imports/uniform_imports + '../../../../packages/kbn-plugin-discovery/index.js' + ); + + const searchPaths = getPluginSearchPaths({ + rootDir: REPO_ROOT, + examples: true, + oss: false, + testPlugins: true, + }); + + return simpleKibanaPlatformPluginDiscovery(searchPaths, []); +} diff --git a/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs b/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs index e7fc7fd2be48..c86a04c4d7b9 100644 --- a/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs +++ b/kbn_pm/src/commands/bootstrap/regenerate_base_tsconfig.mjs @@ -10,47 +10,23 @@ import Path from 'path'; import Fsp from 'fs/promises'; import { REPO_ROOT } from '../../lib/paths.mjs'; -import { convertPluginIdToPackageId } from './plugins.mjs'; -import { normalizePath } from './normalize_path.mjs'; +import External from '../../lib/external_packages.js'; -/** - * @param {import('@kbn/bazel-packages').BazelPackage[]} packages - * @param {import('@kbn/plugin-discovery').KibanaPlatformPlugin[]} plugins - */ -export async function regenerateBaseTsconfig(packages, plugins) { +export async function regenerateBaseTsconfig() { + const pkgMap = External['@kbn/package-map']().readPackageMap(); const tsconfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json'); const lines = (await Fsp.readFile(tsconfigPath, 'utf-8')).split('\n'); - const packagesMap = packages - .slice() - .sort((a, b) => a.normalizedRepoRelativeDir.localeCompare(b.normalizedRepoRelativeDir)) - .flatMap((p) => { - if (!p.pkg) { - return []; - } - - const id = p.pkg.name; - const path = p.normalizedRepoRelativeDir; - return [` "${id}": ["${path}"],`, ` "${id}/*": ["${path}/*"],`]; - }); - - const pluginsMap = plugins - .slice() - .sort((a, b) => a.manifestPath.localeCompare(b.manifestPath)) - .flatMap((p) => { - const id = convertPluginIdToPackageId(p.manifest.id); - const path = normalizePath(Path.relative(REPO_ROOT, p.directory)); - return [` "${id}": ["${path}"],`, ` "${id}/*": ["${path}/*"],`]; - }); - const start = lines.findIndex((l) => l.trim() === '// START AUTOMATED PACKAGE LISTING'); const end = lines.findIndex((l) => l.trim() === '// END AUTOMATED PACKAGE LISTING'); const current = await Fsp.readFile(tsconfigPath, 'utf8'); const updated = [ ...lines.slice(0, start + 1), - ...packagesMap, - ...pluginsMap, + ...Array.from(pkgMap.entries()).flatMap(([moduleId, repoRelPath]) => [ + ` "${moduleId}": ["${repoRelPath}"],`, + ` "${moduleId}/*": ["${repoRelPath}/*"],`, + ]), ...lines.slice(end), ].join('\n'); diff --git a/kbn_pm/src/commands/bootstrap/regenerate_package_map.mjs b/kbn_pm/src/commands/bootstrap/regenerate_package_map.mjs new file mode 100644 index 000000000000..03f806fae5b2 --- /dev/null +++ b/kbn_pm/src/commands/bootstrap/regenerate_package_map.mjs @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import Fs from 'fs'; +import Fsp from 'fs/promises'; + +import { convertPluginIdToPackageId } from '../../lib/plugins.mjs'; +import { normalizePath } from '../../lib/normalize_path.mjs'; +import { REPO_ROOT } from '../../lib/paths.mjs'; + +/** + * + * @param {import('@kbn/bazel-packages').BazelPackage[]} packages + * @param {import('@kbn/plugin-discovery').KibanaPlatformPlugin[]} plugins + * @param {import('@kbn/some-dev-log').SomeDevLog} log + */ +export async function regeneratePackageMap(packages, plugins, log) { + // clean up old version of package map package + Fs.rmSync(Path.resolve(REPO_ROOT, 'packages/kbn-synthetic-package-map'), { + recursive: true, + force: true, + }); + + const path = Path.resolve(REPO_ROOT, 'packages/kbn-package-map/package-map.json'); + const existingContent = Fs.existsSync(path) ? await Fsp.readFile(path, 'utf8') : undefined; + + /** @type {Array<[string, string]>} */ + const entries = [['@kbn/core', 'src/core']]; + + for (const pkg of packages) { + entries.push([pkg.manifest.id, pkg.normalizedRepoRelativeDir]); + } + + for (const plugin of plugins) { + entries.push([ + convertPluginIdToPackageId(plugin.manifest.id), + normalizePath(Path.relative(REPO_ROOT, plugin.directory)), + ]); + } + + const content = JSON.stringify( + entries.sort((a, b) => a[0].localeCompare(b[0])), + null, + 2 + ); + + if (content !== existingContent) { + await Fsp.writeFile(path, content); + log.warning('updated package map, many caches may be invalidated'); + } +} diff --git a/kbn_pm/src/commands/bootstrap/regenerate_synthetic_package_map.mjs b/kbn_pm/src/commands/bootstrap/regenerate_synthetic_package_map.mjs deleted file mode 100644 index ea1f53727997..000000000000 --- a/kbn_pm/src/commands/bootstrap/regenerate_synthetic_package_map.mjs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fsp from 'fs/promises'; - -import { normalizePath } from './normalize_path.mjs'; -import { REPO_ROOT } from '../../lib/paths.mjs'; -import { convertPluginIdToPackageId } from './plugins.mjs'; - -/** - * @param {import('@kbn/plugin-discovery').KibanaPlatformPlugin[]} plugins - */ -export async function regenerateSyntheticPackageMap(plugins) { - /** @type {Array<[string, string]>} */ - const entries = [['@kbn/core', 'src/core']]; - - for (const plugin of plugins) { - entries.push([ - convertPluginIdToPackageId(plugin.manifest.id), - normalizePath(Path.relative(REPO_ROOT, plugin.directory)), - ]); - } - - await Fsp.writeFile( - Path.resolve(REPO_ROOT, 'packages/kbn-synthetic-package-map/synthetic-packages.json'), - JSON.stringify(entries, null, 2) - ); -} diff --git a/kbn_pm/src/commands/bootstrap/sort_package_json.mjs b/kbn_pm/src/commands/bootstrap/sort_package_json.mjs index f78401c257e4..959b6297da96 100644 --- a/kbn_pm/src/commands/bootstrap/sort_package_json.mjs +++ b/kbn_pm/src/commands/bootstrap/sort_package_json.mjs @@ -10,9 +10,10 @@ import Path from 'path'; import Fs from 'fs'; import { REPO_ROOT } from '../../lib/paths.mjs'; +import External from '../../lib/external_packages.js'; export async function sortPackageJson() { - const { sortPackageJson } = await import('@kbn/sort-package-json'); + const { sortPackageJson } = External['@kbn/sort-package-json'](); const path = Path.resolve(REPO_ROOT, 'package.json'); const json = Fs.readFileSync(path, 'utf8'); diff --git a/kbn_pm/src/commands/bootstrap/validate_package_json.mjs b/kbn_pm/src/commands/bootstrap/validate_package_json.mjs new file mode 100644 index 000000000000..8a88898dcf31 --- /dev/null +++ b/kbn_pm/src/commands/bootstrap/validate_package_json.mjs @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createCliError } from '../../lib/cli_error.mjs'; + +/** + * @param {import('@kbn/repo-info').KibanaPackageJson} pkgJson + * @param {import('@kbn/some-dev-log').SomeDevLog} log + */ +export async function validatePackageJson(pkgJson, log) { + const failures = false; + + const typesInProd = Object.keys(pkgJson.dependencies).filter((id) => id.startsWith('@types/')); + if (typesInProd.length) { + const list = typesInProd.map((id) => ` - ${id}`).join('\n'); + log.error( + `The following @types/* packages are listed in dependencies but should be in the devDependencies:\n${list}` + ); + } + + if (failures) { + throw createCliError('failed to validate package.json, check for errors above'); + } +} diff --git a/kbn_pm/src/commands/run_in_packages_command.mjs b/kbn_pm/src/commands/run_in_packages_command.mjs index 84649f60e009..362fd499d115 100644 --- a/kbn_pm/src/commands/run_in_packages_command.mjs +++ b/kbn_pm/src/commands/run_in_packages_command.mjs @@ -10,6 +10,7 @@ import Path from 'path'; import { REPO_ROOT } from '../lib/paths.mjs'; import { run, spawnStreaming } from '../lib/spawn.mjs'; +import External from '../lib/external_packages.js'; /** @type {import('../lib/command').Command} */ export const command = { @@ -39,7 +40,7 @@ export const command = { const exclude = args.getStringValues('exclude') ?? []; const include = args.getStringValues('include') ?? []; - const { discoverBazelPackages } = await import('@kbn/bazel-packages'); + const { discoverBazelPackages } = External['@kbn/bazel-packages'](); const packages = await discoverBazelPackages(REPO_ROOT); for (const { manifest, pkg, normalizedRepoRelativeDir } of packages) { if ( diff --git a/kbn_pm/src/commands/x_command.mjs b/kbn_pm/src/commands/x_command.mjs index f42d20c93d30..e46c7eb0f740 100644 --- a/kbn_pm/src/commands/x_command.mjs +++ b/kbn_pm/src/commands/x_command.mjs @@ -6,267 +6,8 @@ * Side Public License, v 1. */ -import Fs from 'fs'; -import Path from 'path'; - -import { REPO_ROOT } from '../lib/paths.mjs'; -import { pluginDiscovery } from './bootstrap/plugins.mjs'; - -const RULE_DEPS = /([\s\n]deps\s*=\s*)((?:\w+(?: \+ )?)?(?:\[[^\]]*\])?)(\s*,|\s*\))/; - -/** - * @param {string} text - * @param {number} index - */ -function findStartOfLine(text, index) { - let cursor = index; - while (cursor > 0) { - if (text[cursor - 1] === '\n') { - return cursor; - } - cursor -= 1; - } - - return cursor; -} - -/** - * @param {string} starlark - * @param {string} name - */ -function findBazelRule(starlark, name) { - const match = starlark.match(new RegExp(`name\\s*=\\s*${name}`)); - if (typeof match?.index !== 'number') { - throw new Error(`unable to find rule named [${name}]`); - } - - const openParen = starlark.slice(0, match.index).lastIndexOf('('); - if (openParen === -1) { - throw new Error(`unable to find opening paren for rule [${name}] [index=${match.index}]`); - } - - const start = findStartOfLine(starlark, openParen); - const end = starlark.indexOf(')', start); - if (end === -1) { - throw new Error(`unable to find closing parent for rule [${name}] [start=${start}]`); - } - - const type = starlark.slice(start, starlark.indexOf('(', start)).trim(); - - // add 1 so that the "end" chunk starts after the closing ) - return { start, end: end + 1, type }; -} - -/** - * @param {string} starlark - * @param {string} name - */ -function removeBazelRule(starlark, name) { - const pos = findBazelRule(starlark, name); - - let end = pos.end; - - // slurp up all the newlines directly after the closing ) - while (starlark[end] === '\n') { - end += 1; - } - - return starlark.slice(0, pos.start) + starlark.slice(end); -} - -/** - * @param {string} starlark - * @param {string} dep - * @returns - */ -function addDep(starlark, dep) { - const depsMatch = starlark.match(RULE_DEPS); - - if (typeof depsMatch?.index !== 'number') { - return starlark.replace(/,?[\s\n]*\)[\s\n]*$/, '') + `,\n deps = [${dep}],\n)`; - } - - const [, head, value, tail] = depsMatch; - - return ( - starlark.slice(0, depsMatch.index) + - head + - (() => { - const multiline = value.includes('\n'); - const existingArray = value.indexOf(']'); - if (existingArray === -1) { - return value + ` + [${dep}]`; - } - - const valHead = value.slice(0, existingArray).replace(/,?\s*$/, ','); - const valTail = value.slice(existingArray); - - return `${valHead}${multiline ? '\n ' : ' '}${dep}${multiline ? ',\n' : ''}${valTail}`; - })() + - tail + - starlark.slice(depsMatch.index + depsMatch[0].length) - ); -} - -/** - * @param {string} starlark - * @param {string} name - * @param {string} newName - * @param {(rule: string) => string} mod - */ -function duplicateRule(starlark, name, newName, mod) { - const origPos = findBazelRule(starlark, name); - - const orig = starlark.slice(origPos.start, origPos.end); - - const withName = orig.replace( - /^(\s*)name\s*=\s*.*$/m, - (match, head) => `${head}name = ${newName}${match.endsWith(',') ? ',' : ''}` - ); - - return starlark.slice(0, origPos.end) + `\n\n${mod(withName)}` + starlark.slice(origPos.end); -} - /** @type {import('../lib/command').Command} */ export const command = { name: '_x', - async run({ log }) { - const updates = { pkgJson: 0, buildBazel: 0, tsconfig: 0, tsconfigRefs: 0 }; - - await import('../../../src/setup_node_env/index' + '.js'); - const { PROJECTS } = await import('./projects' + '.js'); - const { discoverBazelPackages } = await import('@kbn/bazel-packages'); - const pkgs = await discoverBazelPackages(REPO_ROOT); - const plugins = await pluginDiscovery(); - - // update package.json files to point to their target_types dir - const relTypes = './target_types/index.d.ts'; - for (const pkg of pkgs) { - if (!pkg.hasBuildTypesRule()) { - log.warning(`not defining "types" for ${pkg.manifest.id} because it doesn't build types`); - continue; - } - - const dir = Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir); - const pkgJsonPath = Path.resolve(dir, 'package.json'); - - const pkgJson = Fs.readFileSync(pkgJsonPath, 'utf8'); - const parsed = JSON.parse(pkgJson); - - if (parsed.types === relTypes) { - continue; - } - - Fs.writeFileSync( - pkgJsonPath, - JSON.stringify( - { - ...parsed, - types: relTypes, - }, - null, - 2 - ) + (pkgJson.endsWith('\n') ? '\n' : '') - ); - - updates.pkgJson += 1; - } - log.success(`updated ${updates.pkgJson} package.json files`); - - // update BUILD.bazel files to not rely on type_summarizer - for (const pkg of pkgs) { - if (!pkg.hasBuildTypesRule()) { - continue; - } - - const starlark = pkg.buildBazelContent; - if (typeof starlark !== 'string') { - throw new Error('missing buildBazelContent'); - } - - const npmTypes = findBazelRule(starlark, '"npm_module_types"'); - - if (npmTypes.type === 'alias') { - log.info(`ignoring npm_module_types rule which is an alias in ${pkg.manifest.id}`); - continue; - } - - // remove rules for old npm_module_types - const withoutOldTypes = removeBazelRule(starlark, '"npm_module_types"'); - - // duplicate js_library rule and name npm_module_types rule which adds the ':tsc_types' dep - const withTypesJsLib = duplicateRule( - withoutOldTypes, - 'PKG_DIRNAME', - '"npm_module_types"', - (newRule) => addDep(newRule, '":tsc_types"') - ); - - const withBuildTypesWrapper = - removeBazelRule(withTypesJsLib, '"build_types"').trimEnd() + - ` - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) -`; - - Fs.writeFileSync( - Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir, 'BUILD.bazel'), - withBuildTypesWrapper - ); - - updates.buildBazel += 1; - } - log.success(`updated ${updates.buildBazel} BUILD.bazel files`); - - // stop enabling declaration source maps in tsconfig - for (const pkg of [...pkgs, ...plugins]) { - const dir = - 'normalizedRepoRelativeDir' in pkg - ? Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir) - : pkg.directory; - - let changed; - - const tsconfigPath = Path.resolve(dir, 'tsconfig.json'); - if (Fs.existsSync(tsconfigPath)) { - const current = Fs.readFileSync(tsconfigPath, 'utf8'); - const next = current.replace(/\n\s*"declarationMap"\s*:.+\n/m, '\n'); - - if (current !== next) { - changed = true; - Fs.writeFileSync(tsconfigPath, next); - } - } - - const buildBazelPath = Path.resolve(dir, 'BUILD.bazel'); - if (Fs.existsSync(buildBazelPath)) { - const current = Fs.readFileSync(buildBazelPath, 'utf8'); - const next = current.replace(/\n.*\bdeclaration_map\b.*\n/, '\n'); - if (current !== next) { - changed = true; - Fs.writeFileSync(buildBazelPath, next); - } - } - - if (changed) { - updates.tsconfig += 1; - } - } - log.success(`dropped declarationMap from ${updates.tsconfig} tsconfig.json files`); - - // rename "references" in plugin tsconfig.json files to "kbn_references" - for (const project of PROJECTS) { - const tsconfigJson = Fs.readFileSync(project.tsConfigPath, 'utf8'); - const updated = tsconfigJson.replace('"references"', '"kbn_references"'); - if (updated !== tsconfigJson) { - Fs.writeFileSync(project.tsConfigPath, updated); - updates.tsconfigRefs += 1; - } - } - log.success(`updated tsconfig references key in ${updates.tsconfigRefs} tsconfig.json files`); - }, + async run() {}, }; diff --git a/kbn_pm/src/lib/bazel.mjs b/kbn_pm/src/lib/bazel.mjs index 7e0256633cfd..2ec27b359f15 100644 --- a/kbn_pm/src/lib/bazel.mjs +++ b/kbn_pm/src/lib/bazel.mjs @@ -18,6 +18,12 @@ import { indent } from './indent.mjs'; const BAZEL_RUNNER_SRC = '../../../packages/kbn-bazel-runner/index.js'; +const BAZEL_TARGETS = [ + '//packages/kbn-ui-shared-deps-npm:shared_built_assets', + '//packages/kbn-ui-shared-deps-src:shared_built_assets', + '//packages/kbn-monaco:target_workers', +]; + async function getBazelRunner() { /* eslint-disable no-unsanitized/method */ /** @type {import('@kbn/bazel-runner')} */ @@ -83,7 +89,7 @@ export async function watch(log, opts = undefined) { // `.bazel_fix_commands.json` but its not needed at the moment '--run_output=false', 'build', - '//packages:build', + ...BAZEL_TARGETS, '--show_result=1', ...(opts?.offline ? ['--config=offline'] : []), ]; @@ -158,13 +164,13 @@ export async function installYarnDeps(log, opts = undefined) { * @param {import('./log.mjs').Log} log * @param {{ offline?: boolean, quiet?: boolean } | undefined} opts */ -export async function buildPackages(log, opts = undefined) { - await runBazel(log, ['build', '//packages:build', '--show_result=1'], { +export async function buildWebpackBundles(log, opts = undefined) { + await runBazel(log, ['build', ...BAZEL_TARGETS, '--show_result=1'], { offline: opts?.offline, quiet: opts?.quiet, }); - log.success('packages built'); + log.success('shared bundles built'); } /** diff --git a/kbn_pm/src/lib/external_packages.js b/kbn_pm/src/lib/external_packages.js new file mode 100644 index 000000000000..d984a15dfd02 --- /dev/null +++ b/kbn_pm/src/lib/external_packages.js @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ +module.exports = { + ['@kbn/bazel-packages']() { + require('@kbn/babel-register').install(); + return require('@kbn/bazel-packages'); + }, + + ['@kbn/ci-stats-reporter']() { + require('@kbn/babel-register').install(); + return require('@kbn/ci-stats-reporter'); + }, + + ['@kbn/yarn-lock-validator']() { + require('@kbn/babel-register').install(); + return require('@kbn/yarn-lock-validator'); + }, + + ['@kbn/sort-package-json']() { + require('@kbn/babel-register').install(); + return require('@kbn/sort-package-json'); + }, + + ['@kbn/package-map']() { + require('@kbn/babel-register').install(); + return require('@kbn/package-map'); + }, + + ['@kbn/get-repo-files']() { + require('@kbn/babel-register').install(); + return require('@kbn/get-repo-files'); + }, + + ['@kbn/repo-info']() { + require('@kbn/babel-register').install(); + return require('@kbn/repo-info'); + }, + + ['@kbn/ts-projects']() { + require('@kbn/babel-register').install(); + return require('@kbn/ts-projects'); + }, + + /** + * @param {string} absPath + * @returns {unknown} + */ + reqAbs(absPath) { + require('@kbn/babel-register').install(); + // eslint-disable-next-line import/no-dynamic-require + return require(absPath); + }, +}; diff --git a/kbn_pm/src/lib/find_clean_paths.mjs b/kbn_pm/src/lib/find_clean_paths.mjs index a15118031038..62874358d467 100644 --- a/kbn_pm/src/lib/find_clean_paths.mjs +++ b/kbn_pm/src/lib/find_clean_paths.mjs @@ -10,21 +10,20 @@ import Path from 'path'; import Fs from 'fs'; import { REPO_ROOT } from './paths.mjs'; +import External from './external_packages.js'; /** - * Attempt to load the synthetic package map, if bootstrap hasn't run successfully + * Attempt to load the package map, if bootstrap hasn't run successfully * this might fail. * @param {import('@kbn/some-dev-log').SomeDevLog} log - * @returns {Promise} + * @returns {Promise} */ -async function tryToGetSyntheticPackageMap(log) { +async function tryToGetPackageMap(log) { try { - const { readPackageMap } = await import('@kbn/synthetic-package-map'); + const { readPackageMap } = External['@kbn/package-map'](); return readPackageMap(); } catch (error) { - log.warning( - 'unable to load synthetic package map, unable to clean target directories in synthetic packages' - ); + log.warning('unable to load package map, unable to clean target directories in packages'); return new Map(); } } @@ -67,7 +66,7 @@ export function readCleanPatterns(packageDir) { * @returns {Promise} */ export async function findPluginCleanPaths(log) { - const packageMap = await tryToGetSyntheticPackageMap(log); + const packageMap = await tryToGetPackageMap(log); return [...packageMap.values()].flatMap((repoRelativePath) => { const pkgDir = Path.resolve(REPO_ROOT, repoRelativePath); return [Path.resolve(pkgDir, 'target'), ...readCleanPatterns(pkgDir)]; diff --git a/kbn_pm/src/commands/bootstrap/normalize_path.mjs b/kbn_pm/src/lib/normalize_path.mjs similarity index 100% rename from kbn_pm/src/commands/bootstrap/normalize_path.mjs rename to kbn_pm/src/lib/normalize_path.mjs diff --git a/kbn_pm/src/commands/bootstrap/plugins.mjs b/kbn_pm/src/lib/plugins.mjs similarity index 51% rename from kbn_pm/src/commands/bootstrap/plugins.mjs rename to kbn_pm/src/lib/plugins.mjs index b4d48d8ef74c..01bdbfd41c8e 100644 --- a/kbn_pm/src/commands/bootstrap/plugins.mjs +++ b/kbn_pm/src/lib/plugins.mjs @@ -6,14 +6,8 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '../../lib/paths.mjs'; - -/** @type {string} */ -const PLUGIN_DISCOVERY_SRC = '../../../../packages/kbn-plugin-discovery/index.js'; - /** * @param {string} pluginId - * @returns {string} */ export function convertPluginIdToPackageId(pluginId) { if (pluginId === 'core') { @@ -28,24 +22,3 @@ export function convertPluginIdToPackageId(pluginId) { .replace(/-\w(-\w)+-/g, (match) => `-${match.split('-').join('')}-`) .replace(/-plugin-plugin$/, '-plugin'); } - -/** - * @returns {Promise} - */ -export async function pluginDiscovery() { - /* eslint-disable no-unsanitized/method */ - /** @type {import('@kbn/plugin-discovery')} */ - const { getPluginSearchPaths, simpleKibanaPlatformPluginDiscovery } = await import( - PLUGIN_DISCOVERY_SRC - ); - /* eslint-enable no-unsanitized/method */ - - const searchPaths = getPluginSearchPaths({ - rootDir: REPO_ROOT, - examples: true, - oss: false, - testPlugins: true, - }); - - return simpleKibanaPlatformPluginDiscovery(searchPaths, []); -} diff --git a/kbn_pm/tsconfig.json b/kbn_pm/tsconfig.json index f8ef60867aca..78117e296355 100644 --- a/kbn_pm/tsconfig.json +++ b/kbn_pm/tsconfig.json @@ -1,14 +1,28 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "outDir": "target", + "outDir": "target/types", "checkJs": true, - "target": "ES2022", "module": "ESNext" }, "include": [ "src/**/*.mjs", + "src/**/*.js", "src/**/*.ts", ], - "exclude": [] + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/babel-register", + "@kbn/bazel-packages", + "@kbn/repo-info", + "@kbn/yarn-lock-validator", + "@kbn/get-repo-files", + "@kbn/sort-package-json", + { "path": "../src/dev/tsconfig.json" }, + "@kbn/ci-stats-reporter", + "@kbn/package-map", + "@kbn/ts-projects" + ] } diff --git a/package.json b/package.json index 6fc8d8aec7eb..af670efaa684 100644 --- a/package.json +++ b/package.json @@ -128,314 +128,315 @@ "@hapi/hoek": "^9.2.1", "@hapi/inert": "^6.0.4", "@hapi/wreck": "^17.1.0", - "@kbn/ace": "link:bazel-bin/packages/kbn-ace", - "@kbn/aiops-components": "link:bazel-bin/x-pack/packages/ml/aiops_components", - "@kbn/aiops-utils": "link:bazel-bin/x-pack/packages/ml/aiops_utils", - "@kbn/alerts": "link:bazel-bin/packages/kbn-alerts", - "@kbn/analytics": "link:bazel-bin/packages/kbn-analytics", - "@kbn/analytics-client": "link:bazel-bin/packages/analytics/client", - "@kbn/analytics-shippers-elastic-v3-browser": "link:bazel-bin/packages/analytics/shippers/elastic_v3/browser", - "@kbn/analytics-shippers-elastic-v3-common": "link:bazel-bin/packages/analytics/shippers/elastic_v3/common", - "@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/analytics-shippers-gainsight": "link:bazel-bin/packages/analytics/shippers/gainsight", - "@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader", - "@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils", - "@kbn/cases-components": "link:bazel-bin/packages/kbn-cases-components", - "@kbn/chart-icons": "link:bazel-bin/packages/kbn-chart-icons", - "@kbn/coloring": "link:bazel-bin/packages/kbn-coloring", - "@kbn/config": "link:bazel-bin/packages/kbn-config", - "@kbn/config-mocks": "link:bazel-bin/packages/kbn-config-mocks", - "@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema", + "@kbn/ace": "link:packages/kbn-ace", + "@kbn/aiops-components": "link:x-pack/packages/ml/aiops_components", + "@kbn/aiops-utils": "link:x-pack/packages/ml/aiops_utils", + "@kbn/alerts": "link:packages/kbn-alerts", + "@kbn/analytics": "link:packages/kbn-analytics", + "@kbn/analytics-client": "link:packages/analytics/client", + "@kbn/analytics-shippers-elastic-v3-browser": "link:packages/analytics/shippers/elastic_v3/browser", + "@kbn/analytics-shippers-elastic-v3-common": "link:packages/analytics/shippers/elastic_v3/common", + "@kbn/analytics-shippers-elastic-v3-server": "link:packages/analytics/shippers/elastic_v3/server", + "@kbn/analytics-shippers-fullstory": "link:packages/analytics/shippers/fullstory", + "@kbn/analytics-shippers-gainsight": "link:packages/analytics/shippers/gainsight", + "@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader", + "@kbn/apm-utils": "link:packages/kbn-apm-utils", + "@kbn/cases-components": "link:packages/kbn-cases-components", + "@kbn/chart-icons": "link:packages/kbn-chart-icons", + "@kbn/coloring": "link:packages/kbn-coloring", + "@kbn/config": "link:packages/kbn-config", + "@kbn/config-mocks": "link:packages/kbn-config-mocks", + "@kbn/config-schema": "link:packages/kbn-config-schema", "@kbn/content-management-content-editor": "link:bazel-bin/packages/content-management/content_editor", "@kbn/content-management-table-list": "link:bazel-bin/packages/content-management/table_list", - "@kbn/core-analytics-browser": "link:bazel-bin/packages/core/analytics/core-analytics-browser", - "@kbn/core-analytics-browser-internal": "link:bazel-bin/packages/core/analytics/core-analytics-browser-internal", - "@kbn/core-analytics-browser-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-browser-mocks", - "@kbn/core-analytics-server": "link:bazel-bin/packages/core/analytics/core-analytics-server", - "@kbn/core-analytics-server-internal": "link:bazel-bin/packages/core/analytics/core-analytics-server-internal", - "@kbn/core-analytics-server-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-server-mocks", - "@kbn/core-application-browser": "link:bazel-bin/packages/core/application/core-application-browser", - "@kbn/core-application-browser-internal": "link:bazel-bin/packages/core/application/core-application-browser-internal", - "@kbn/core-application-browser-mocks": "link:bazel-bin/packages/core/application/core-application-browser-mocks", - "@kbn/core-application-common": "link:bazel-bin/packages/core/application/core-application-common", - "@kbn/core-apps-browser-internal": "link:bazel-bin/packages/core/apps/core-apps-browser-internal", - "@kbn/core-apps-browser-mocks": "link:bazel-bin/packages/core/apps/core-apps-browser-mocks", - "@kbn/core-apps-server-internal": "link:bazel-bin/packages/core/apps/core-apps-server-internal", - "@kbn/core-base-browser-internal": "link:bazel-bin/packages/core/base/core-base-browser-internal", - "@kbn/core-base-browser-mocks": "link:bazel-bin/packages/core/base/core-base-browser-mocks", - "@kbn/core-base-common": "link:bazel-bin/packages/core/base/core-base-common", - "@kbn/core-base-common-internal": "link:bazel-bin/packages/core/base/core-base-common-internal", - "@kbn/core-base-server-internal": "link:bazel-bin/packages/core/base/core-base-server-internal", - "@kbn/core-base-server-mocks": "link:bazel-bin/packages/core/base/core-base-server-mocks", - "@kbn/core-capabilities-browser-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-internal", - "@kbn/core-capabilities-browser-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-mocks", - "@kbn/core-capabilities-common": "link:bazel-bin/packages/core/capabilities/core-capabilities-common", - "@kbn/core-capabilities-server": "link:bazel-bin/packages/core/capabilities/core-capabilities-server", - "@kbn/core-capabilities-server-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-internal", - "@kbn/core-capabilities-server-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-mocks", - "@kbn/core-chrome-browser": "link:bazel-bin/packages/core/chrome/core-chrome-browser", - "@kbn/core-chrome-browser-internal": "link:bazel-bin/packages/core/chrome/core-chrome-browser-internal", - "@kbn/core-chrome-browser-mocks": "link:bazel-bin/packages/core/chrome/core-chrome-browser-mocks", - "@kbn/core-config-server-internal": "link:bazel-bin/packages/core/config/core-config-server-internal", - "@kbn/core-config-server-mocks": "link:bazel-bin/packages/core/config/core-config-server-mocks", - "@kbn/core-deprecations-browser": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser", - "@kbn/core-deprecations-browser-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-internal", - "@kbn/core-deprecations-browser-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-mocks", - "@kbn/core-deprecations-common": "link:bazel-bin/packages/core/deprecations/core-deprecations-common", - "@kbn/core-deprecations-server": "link:bazel-bin/packages/core/deprecations/core-deprecations-server", - "@kbn/core-deprecations-server-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-internal", - "@kbn/core-deprecations-server-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-mocks", - "@kbn/core-doc-links-browser": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser", - "@kbn/core-doc-links-browser-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-internal", - "@kbn/core-doc-links-browser-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-mocks", - "@kbn/core-doc-links-server": "link:bazel-bin/packages/core/doc-links/core-doc-links-server", - "@kbn/core-doc-links-server-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal", - "@kbn/core-doc-links-server-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks", - "@kbn/core-elasticsearch-client-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server", - "@kbn/core-elasticsearch-client-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal", - "@kbn/core-elasticsearch-client-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks", - "@kbn/core-elasticsearch-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server", - "@kbn/core-elasticsearch-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal", - "@kbn/core-elasticsearch-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks", - "@kbn/core-environment-server-internal": "link:bazel-bin/packages/core/environment/core-environment-server-internal", - "@kbn/core-environment-server-mocks": "link:bazel-bin/packages/core/environment/core-environment-server-mocks", - "@kbn/core-execution-context-browser": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser", - "@kbn/core-execution-context-browser-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-internal", - "@kbn/core-execution-context-browser-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-mocks", - "@kbn/core-execution-context-common": "link:bazel-bin/packages/core/execution-context/core-execution-context-common", - "@kbn/core-execution-context-server": "link:bazel-bin/packages/core/execution-context/core-execution-context-server", - "@kbn/core-execution-context-server-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-internal", - "@kbn/core-execution-context-server-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-mocks", - "@kbn/core-fatal-errors-browser": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser", - "@kbn/core-fatal-errors-browser-internal": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal", - "@kbn/core-fatal-errors-browser-mocks": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks", - "@kbn/core-http-browser": "link:bazel-bin/packages/core/http/core-http-browser", - "@kbn/core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal", - "@kbn/core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks", - "@kbn/core-http-common": "link:bazel-bin/packages/core/http/core-http-common", - "@kbn/core-http-context-server-internal": "link:bazel-bin/packages/core/http/core-http-context-server-internal", - "@kbn/core-http-context-server-mocks": "link:bazel-bin/packages/core/http/core-http-context-server-mocks", - "@kbn/core-http-request-handler-context-server": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server", - "@kbn/core-http-request-handler-context-server-internal": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server-internal", - "@kbn/core-http-resources-server": "link:bazel-bin/packages/core/http/core-http-resources-server", - "@kbn/core-http-resources-server-internal": "link:bazel-bin/packages/core/http/core-http-resources-server-internal", - "@kbn/core-http-resources-server-mocks": "link:bazel-bin/packages/core/http/core-http-resources-server-mocks", - "@kbn/core-http-router-server-internal": "link:bazel-bin/packages/core/http/core-http-router-server-internal", - "@kbn/core-http-router-server-mocks": "link:bazel-bin/packages/core/http/core-http-router-server-mocks", - "@kbn/core-http-server": "link:bazel-bin/packages/core/http/core-http-server", - "@kbn/core-http-server-internal": "link:bazel-bin/packages/core/http/core-http-server-internal", - "@kbn/core-http-server-mocks": "link:bazel-bin/packages/core/http/core-http-server-mocks", - "@kbn/core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser", - "@kbn/core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal", - "@kbn/core-i18n-browser-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks", - "@kbn/core-i18n-server": "link:bazel-bin/packages/core/i18n/core-i18n-server", - "@kbn/core-i18n-server-internal": "link:bazel-bin/packages/core/i18n/core-i18n-server-internal", - "@kbn/core-i18n-server-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-server-mocks", - "@kbn/core-injected-metadata-browser-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal", - "@kbn/core-injected-metadata-browser-mocks": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "@kbn/core-injected-metadata-common-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal", - "@kbn/core-integrations-browser-internal": "link:bazel-bin/packages/core/integrations/core-integrations-browser-internal", - "@kbn/core-integrations-browser-mocks": "link:bazel-bin/packages/core/integrations/core-integrations-browser-mocks", - "@kbn/core-lifecycle-browser": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser", - "@kbn/core-lifecycle-browser-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-internal", - "@kbn/core-lifecycle-browser-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-mocks", - "@kbn/core-lifecycle-server": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server", - "@kbn/core-lifecycle-server-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-internal", - "@kbn/core-lifecycle-server-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-mocks", - "@kbn/core-logging-browser-internal": "link:bazel-bin/packages/core/logging/core-logging-browser-internal", - "@kbn/core-logging-browser-mocks": "link:bazel-bin/packages/core/logging/core-logging-browser-mocks", - "@kbn/core-logging-common-internal": "link:bazel-bin/packages/core/logging/core-logging-common-internal", - "@kbn/core-logging-server": "link:bazel-bin/packages/core/logging/core-logging-server", - "@kbn/core-logging-server-internal": "link:bazel-bin/packages/core/logging/core-logging-server-internal", - "@kbn/core-logging-server-mocks": "link:bazel-bin/packages/core/logging/core-logging-server-mocks", - "@kbn/core-metrics-collectors-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-internal", - "@kbn/core-metrics-collectors-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-mocks", - "@kbn/core-metrics-server": "link:bazel-bin/packages/core/metrics/core-metrics-server", - "@kbn/core-metrics-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-server-internal", - "@kbn/core-metrics-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-server-mocks", - "@kbn/core-mount-utils-browser": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser", - "@kbn/core-mount-utils-browser-internal": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser-internal", - "@kbn/core-node-server": "link:bazel-bin/packages/core/node/core-node-server", - "@kbn/core-node-server-internal": "link:bazel-bin/packages/core/node/core-node-server-internal", - "@kbn/core-node-server-mocks": "link:bazel-bin/packages/core/node/core-node-server-mocks", - "@kbn/core-notifications-browser": "link:bazel-bin/packages/core/notifications/core-notifications-browser", - "@kbn/core-notifications-browser-internal": "link:bazel-bin/packages/core/notifications/core-notifications-browser-internal", - "@kbn/core-notifications-browser-mocks": "link:bazel-bin/packages/core/notifications/core-notifications-browser-mocks", - "@kbn/core-overlays-browser": "link:bazel-bin/packages/core/overlays/core-overlays-browser", - "@kbn/core-overlays-browser-internal": "link:bazel-bin/packages/core/overlays/core-overlays-browser-internal", - "@kbn/core-overlays-browser-mocks": "link:bazel-bin/packages/core/overlays/core-overlays-browser-mocks", - "@kbn/core-plugins-base-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-base-server-internal", - "@kbn/core-plugins-browser": "link:bazel-bin/packages/core/plugins/core-plugins-browser", - "@kbn/core-plugins-browser-internal": "link:bazel-bin/packages/core/plugins/core-plugins-browser-internal", - "@kbn/core-plugins-browser-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-browser-mocks", - "@kbn/core-plugins-server": "link:bazel-bin/packages/core/plugins/core-plugins-server", - "@kbn/core-plugins-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-server-internal", - "@kbn/core-plugins-server-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-server-mocks", - "@kbn/core-preboot-server": "link:bazel-bin/packages/core/preboot/core-preboot-server", - "@kbn/core-preboot-server-internal": "link:bazel-bin/packages/core/preboot/core-preboot-server-internal", - "@kbn/core-preboot-server-mocks": "link:bazel-bin/packages/core/preboot/core-preboot-server-mocks", - "@kbn/core-rendering-browser-internal": "link:bazel-bin/packages/core/rendering/core-rendering-browser-internal", - "@kbn/core-rendering-browser-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-browser-mocks", - "@kbn/core-rendering-server-internal": "link:bazel-bin/packages/core/rendering/core-rendering-server-internal", - "@kbn/core-rendering-server-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-server-mocks", - "@kbn/core-root-browser-internal": "link:bazel-bin/packages/core/root/core-root-browser-internal", - "@kbn/core-root-server-internal": "link:bazel-bin/packages/core/root/core-root-server-internal", - "@kbn/core-saved-objects-api-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser", - "@kbn/core-saved-objects-api-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server", - "@kbn/core-saved-objects-api-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-internal", - "@kbn/core-saved-objects-api-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-mocks", - "@kbn/core-saved-objects-base-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal", - "@kbn/core-saved-objects-base-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks", - "@kbn/core-saved-objects-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser", - "@kbn/core-saved-objects-browser-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal", - "@kbn/core-saved-objects-browser-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks", - "@kbn/core-saved-objects-common": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-common", - "@kbn/core-saved-objects-import-export-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-internal", - "@kbn/core-saved-objects-import-export-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-mocks", - "@kbn/core-saved-objects-migration-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-internal", - "@kbn/core-saved-objects-migration-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-mocks", - "@kbn/core-saved-objects-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server", - "@kbn/core-saved-objects-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-internal", - "@kbn/core-saved-objects-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-mocks", - "@kbn/core-saved-objects-utils-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server", - "@kbn/core-status-common": "link:bazel-bin/packages/core/status/core-status-common", - "@kbn/core-status-common-internal": "link:bazel-bin/packages/core/status/core-status-common-internal", - "@kbn/core-status-server": "link:bazel-bin/packages/core/status/core-status-server", - "@kbn/core-status-server-internal": "link:bazel-bin/packages/core/status/core-status-server-internal", - "@kbn/core-status-server-mocks": "link:bazel-bin/packages/core/status/core-status-server-mocks", - "@kbn/core-test-helpers-deprecations-getters": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters", - "@kbn/core-test-helpers-http-setup-browser": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser", - "@kbn/core-test-helpers-so-type-serializer": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-so-type-serializer", - "@kbn/core-test-helpers-test-utils": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-test-utils", - "@kbn/core-theme-browser": "link:bazel-bin/packages/core/theme/core-theme-browser", - "@kbn/core-theme-browser-internal": "link:bazel-bin/packages/core/theme/core-theme-browser-internal", - "@kbn/core-theme-browser-mocks": "link:bazel-bin/packages/core/theme/core-theme-browser-mocks", - "@kbn/core-ui-settings-browser": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser", - "@kbn/core-ui-settings-browser-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-internal", - "@kbn/core-ui-settings-browser-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-mocks", - "@kbn/core-ui-settings-common": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-common", - "@kbn/core-ui-settings-server": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server", - "@kbn/core-ui-settings-server-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-internal", - "@kbn/core-ui-settings-server-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-mocks", - "@kbn/core-usage-data-base-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-base-server-internal", - "@kbn/core-usage-data-server": "link:bazel-bin/packages/core/usage-data/core-usage-data-server", - "@kbn/core-usage-data-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-internal", - "@kbn/core-usage-data-server-mocks": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-mocks", - "@kbn/crypto": "link:bazel-bin/packages/kbn-crypto", - "@kbn/crypto-browser": "link:bazel-bin/packages/kbn-crypto-browser", - "@kbn/datemath": "link:bazel-bin/packages/kbn-datemath", - "@kbn/doc-links": "link:bazel-bin/packages/kbn-doc-links", - "@kbn/ebt-tools": "link:bazel-bin/packages/kbn-ebt-tools", - "@kbn/ecs": "link:bazel-bin/packages/kbn-ecs", - "@kbn/es-errors": "link:bazel-bin/packages/kbn-es-errors", - "@kbn/es-query": "link:bazel-bin/packages/kbn-es-query", - "@kbn/es-types": "link:bazel-bin/packages/kbn-es-types", - "@kbn/field-types": "link:bazel-bin/packages/kbn-field-types", - "@kbn/flot-charts": "link:bazel-bin/packages/kbn-flot-charts", - "@kbn/guided-onboarding": "link:bazel-bin/packages/kbn-guided-onboarding", - "@kbn/handlebars": "link:bazel-bin/packages/kbn-handlebars", - "@kbn/hapi-mocks": "link:bazel-bin/packages/kbn-hapi-mocks", - "@kbn/health-gateway-server": "link:bazel-bin/packages/kbn-health-gateway-server", - "@kbn/home-sample-data-card": "link:bazel-bin/packages/home/sample_data_card", - "@kbn/home-sample-data-tab": "link:bazel-bin/packages/home/sample_data_tab", - "@kbn/home-sample-data-types": "link:bazel-bin/packages/home/sample_data_types", - "@kbn/i18n": "link:bazel-bin/packages/kbn-i18n", - "@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react", - "@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter", - "@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils", - "@kbn/language-documentation-popover": "link:bazel-bin/packages/kbn-language-documentation-popover", - "@kbn/logging": "link:bazel-bin/packages/kbn-logging", - "@kbn/logging-mocks": "link:bazel-bin/packages/kbn-logging-mocks", - "@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl", - "@kbn/ml-agg-utils": "link:bazel-bin/x-pack/packages/ml/agg_utils", - "@kbn/ml-is-populated-object": "link:bazel-bin/x-pack/packages/ml/is_populated_object", - "@kbn/ml-string-hash": "link:bazel-bin/x-pack/packages/ml/string_hash", - "@kbn/monaco": "link:bazel-bin/packages/kbn-monaco", - "@kbn/osquery-io-ts-types": "link:bazel-bin/packages/kbn-osquery-io-ts-types", - "@kbn/plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery", - "@kbn/react-field": "link:bazel-bin/packages/kbn-react-field", - "@kbn/rison": "link:bazel-bin/packages/kbn-rison", - "@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-exception-list-components": "link:bazel-bin/packages/kbn-securitysolution-exception-list-components", - "@kbn/securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils", - "@kbn/securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types", - "@kbn/securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types", - "@kbn/securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types", - "@kbn/securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils", - "@kbn/securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api", - "@kbn/securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants", - "@kbn/securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks", - "@kbn/securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils", - "@kbn/securitysolution-rules": "link:bazel-bin/packages/kbn-securitysolution-rules", - "@kbn/securitysolution-t-grid": "link:bazel-bin/packages/kbn-securitysolution-t-grid", - "@kbn/securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils", - "@kbn/server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools", - "@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository", - "@kbn/shared-svg": "link:bazel-bin/packages/kbn-shared-svg", - "@kbn/shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution", - "@kbn/shared-ux-avatar-user-profile-components": "link:bazel-bin/packages/shared-ux/avatar/user_profile/impl", - "@kbn/shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/impl", - "@kbn/shared-ux-button-exit-full-screen-mocks": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/mocks", - "@kbn/shared-ux-button-exit-full-screen-types": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/types", - "@kbn/shared-ux-button-toolbar": "link:bazel-bin/packages/shared-ux/button_toolbar", - "@kbn/shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl", - "@kbn/shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks", - "@kbn/shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types", - "@kbn/shared-ux-file-context": "link:bazel-bin/packages/shared-ux/file/context", - "@kbn/shared-ux-file-image": "link:bazel-bin/packages/shared-ux/file/image/impl", - "@kbn/shared-ux-file-image-mocks": "link:bazel-bin/packages/shared-ux/file/image/mocks", - "@kbn/shared-ux-file-mocks": "link:bazel-bin/packages/shared-ux/file/mocks", - "@kbn/shared-ux-file-picker": "link:bazel-bin/packages/shared-ux/file/file_picker/impl", - "@kbn/shared-ux-file-types": "link:bazel-bin/packages/shared-ux/file/types", - "@kbn/shared-ux-file-upload": "link:bazel-bin/packages/shared-ux/file/file_upload/impl", - "@kbn/shared-ux-file-util": "link:bazel-bin/packages/shared-ux/file/util", - "@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl", - "@kbn/shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks", - "@kbn/shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types", - "@kbn/shared-ux-markdown": "link:bazel-bin/packages/shared-ux/markdown/impl", - "@kbn/shared-ux-markdown-mocks": "link:bazel-bin/packages/shared-ux/markdown/mocks", - "@kbn/shared-ux-markdown-types": "link:bazel-bin/packages/shared-ux/markdown/types", - "@kbn/shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/impl", - "@kbn/shared-ux-page-analytics-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/mocks", - "@kbn/shared-ux-page-analytics-no-data-types": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/types", - "@kbn/shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl", - "@kbn/shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks", - "@kbn/shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types", - "@kbn/shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl", - "@kbn/shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks", - "@kbn/shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types", - "@kbn/shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl", - "@kbn/shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl", - "@kbn/shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks", - "@kbn/shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types", - "@kbn/shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks", - "@kbn/shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types", - "@kbn/shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav", - "@kbn/shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl", - "@kbn/shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks", - "@kbn/shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types", - "@kbn/shared-ux-prompt-not-found": "link:bazel-bin/packages/shared-ux/prompt/not_found", - "@kbn/shared-ux-router-mocks": "link:bazel-bin/packages/shared-ux/router/mocks", - "@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services", - "@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook", - "@kbn/shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock", - "@kbn/shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility", - "@kbn/std": "link:bazel-bin/packages/kbn-std", - "@kbn/timelion-grammar": "link:bazel-bin/packages/kbn-timelion-grammar", - "@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath", - "@kbn/typed-react-router-config": "link:bazel-bin/packages/kbn-typed-react-router-config", - "@kbn/ui-framework": "link:bazel-bin/packages/kbn-ui-framework", - "@kbn/ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm", - "@kbn/ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src", - "@kbn/ui-theme": "link:bazel-bin/packages/kbn-ui-theme", - "@kbn/user-profile-components": "link:bazel-bin/packages/kbn-user-profile-components", - "@kbn/utility-types": "link:bazel-bin/packages/kbn-utility-types", - "@kbn/utility-types-jest": "link:bazel-bin/packages/kbn-utility-types-jest", - "@kbn/utils": "link:bazel-bin/packages/kbn-utils", + "@kbn/core-analytics-browser": "link:packages/core/analytics/core-analytics-browser", + "@kbn/core-analytics-browser-internal": "link:packages/core/analytics/core-analytics-browser-internal", + "@kbn/core-analytics-browser-mocks": "link:packages/core/analytics/core-analytics-browser-mocks", + "@kbn/core-analytics-server": "link:packages/core/analytics/core-analytics-server", + "@kbn/core-analytics-server-internal": "link:packages/core/analytics/core-analytics-server-internal", + "@kbn/core-analytics-server-mocks": "link:packages/core/analytics/core-analytics-server-mocks", + "@kbn/core-application-browser": "link:packages/core/application/core-application-browser", + "@kbn/core-application-browser-internal": "link:packages/core/application/core-application-browser-internal", + "@kbn/core-application-browser-mocks": "link:packages/core/application/core-application-browser-mocks", + "@kbn/core-application-common": "link:packages/core/application/core-application-common", + "@kbn/core-apps-browser-internal": "link:packages/core/apps/core-apps-browser-internal", + "@kbn/core-apps-browser-mocks": "link:packages/core/apps/core-apps-browser-mocks", + "@kbn/core-apps-server-internal": "link:packages/core/apps/core-apps-server-internal", + "@kbn/core-base-browser-internal": "link:packages/core/base/core-base-browser-internal", + "@kbn/core-base-browser-mocks": "link:packages/core/base/core-base-browser-mocks", + "@kbn/core-base-common": "link:packages/core/base/core-base-common", + "@kbn/core-base-common-internal": "link:packages/core/base/core-base-common-internal", + "@kbn/core-base-server-internal": "link:packages/core/base/core-base-server-internal", + "@kbn/core-base-server-mocks": "link:packages/core/base/core-base-server-mocks", + "@kbn/core-capabilities-browser-internal": "link:packages/core/capabilities/core-capabilities-browser-internal", + "@kbn/core-capabilities-browser-mocks": "link:packages/core/capabilities/core-capabilities-browser-mocks", + "@kbn/core-capabilities-common": "link:packages/core/capabilities/core-capabilities-common", + "@kbn/core-capabilities-server": "link:packages/core/capabilities/core-capabilities-server", + "@kbn/core-capabilities-server-internal": "link:packages/core/capabilities/core-capabilities-server-internal", + "@kbn/core-capabilities-server-mocks": "link:packages/core/capabilities/core-capabilities-server-mocks", + "@kbn/core-chrome-browser": "link:packages/core/chrome/core-chrome-browser", + "@kbn/core-chrome-browser-internal": "link:packages/core/chrome/core-chrome-browser-internal", + "@kbn/core-chrome-browser-mocks": "link:packages/core/chrome/core-chrome-browser-mocks", + "@kbn/core-config-server-internal": "link:packages/core/config/core-config-server-internal", + "@kbn/core-config-server-mocks": "link:packages/core/config/core-config-server-mocks", + "@kbn/core-deprecations-browser": "link:packages/core/deprecations/core-deprecations-browser", + "@kbn/core-deprecations-browser-internal": "link:packages/core/deprecations/core-deprecations-browser-internal", + "@kbn/core-deprecations-browser-mocks": "link:packages/core/deprecations/core-deprecations-browser-mocks", + "@kbn/core-deprecations-common": "link:packages/core/deprecations/core-deprecations-common", + "@kbn/core-deprecations-server": "link:packages/core/deprecations/core-deprecations-server", + "@kbn/core-deprecations-server-internal": "link:packages/core/deprecations/core-deprecations-server-internal", + "@kbn/core-deprecations-server-mocks": "link:packages/core/deprecations/core-deprecations-server-mocks", + "@kbn/core-doc-links-browser": "link:packages/core/doc-links/core-doc-links-browser", + "@kbn/core-doc-links-browser-internal": "link:packages/core/doc-links/core-doc-links-browser-internal", + "@kbn/core-doc-links-browser-mocks": "link:packages/core/doc-links/core-doc-links-browser-mocks", + "@kbn/core-doc-links-server": "link:packages/core/doc-links/core-doc-links-server", + "@kbn/core-doc-links-server-internal": "link:packages/core/doc-links/core-doc-links-server-internal", + "@kbn/core-doc-links-server-mocks": "link:packages/core/doc-links/core-doc-links-server-mocks", + "@kbn/core-elasticsearch-client-server": "link:packages/core/elasticsearch/core-elasticsearch-client-server", + "@kbn/core-elasticsearch-client-server-internal": "link:packages/core/elasticsearch/core-elasticsearch-client-server-internal", + "@kbn/core-elasticsearch-client-server-mocks": "link:packages/core/elasticsearch/core-elasticsearch-client-server-mocks", + "@kbn/core-elasticsearch-server": "link:packages/core/elasticsearch/core-elasticsearch-server", + "@kbn/core-elasticsearch-server-internal": "link:packages/core/elasticsearch/core-elasticsearch-server-internal", + "@kbn/core-elasticsearch-server-mocks": "link:packages/core/elasticsearch/core-elasticsearch-server-mocks", + "@kbn/core-environment-server-internal": "link:packages/core/environment/core-environment-server-internal", + "@kbn/core-environment-server-mocks": "link:packages/core/environment/core-environment-server-mocks", + "@kbn/core-execution-context-browser": "link:packages/core/execution-context/core-execution-context-browser", + "@kbn/core-execution-context-browser-internal": "link:packages/core/execution-context/core-execution-context-browser-internal", + "@kbn/core-execution-context-browser-mocks": "link:packages/core/execution-context/core-execution-context-browser-mocks", + "@kbn/core-execution-context-common": "link:packages/core/execution-context/core-execution-context-common", + "@kbn/core-execution-context-server": "link:packages/core/execution-context/core-execution-context-server", + "@kbn/core-execution-context-server-internal": "link:packages/core/execution-context/core-execution-context-server-internal", + "@kbn/core-execution-context-server-mocks": "link:packages/core/execution-context/core-execution-context-server-mocks", + "@kbn/core-fatal-errors-browser": "link:packages/core/fatal-errors/core-fatal-errors-browser", + "@kbn/core-fatal-errors-browser-internal": "link:packages/core/fatal-errors/core-fatal-errors-browser-internal", + "@kbn/core-fatal-errors-browser-mocks": "link:packages/core/fatal-errors/core-fatal-errors-browser-mocks", + "@kbn/core-http-browser": "link:packages/core/http/core-http-browser", + "@kbn/core-http-browser-internal": "link:packages/core/http/core-http-browser-internal", + "@kbn/core-http-browser-mocks": "link:packages/core/http/core-http-browser-mocks", + "@kbn/core-http-common": "link:packages/core/http/core-http-common", + "@kbn/core-http-context-server-internal": "link:packages/core/http/core-http-context-server-internal", + "@kbn/core-http-context-server-mocks": "link:packages/core/http/core-http-context-server-mocks", + "@kbn/core-http-request-handler-context-server": "link:packages/core/http/core-http-request-handler-context-server", + "@kbn/core-http-request-handler-context-server-internal": "link:packages/core/http/core-http-request-handler-context-server-internal", + "@kbn/core-http-resources-server": "link:packages/core/http/core-http-resources-server", + "@kbn/core-http-resources-server-internal": "link:packages/core/http/core-http-resources-server-internal", + "@kbn/core-http-resources-server-mocks": "link:packages/core/http/core-http-resources-server-mocks", + "@kbn/core-http-router-server-internal": "link:packages/core/http/core-http-router-server-internal", + "@kbn/core-http-router-server-mocks": "link:packages/core/http/core-http-router-server-mocks", + "@kbn/core-http-server": "link:packages/core/http/core-http-server", + "@kbn/core-http-server-internal": "link:packages/core/http/core-http-server-internal", + "@kbn/core-http-server-mocks": "link:packages/core/http/core-http-server-mocks", + "@kbn/core-i18n-browser": "link:packages/core/i18n/core-i18n-browser", + "@kbn/core-i18n-browser-internal": "link:packages/core/i18n/core-i18n-browser-internal", + "@kbn/core-i18n-browser-mocks": "link:packages/core/i18n/core-i18n-browser-mocks", + "@kbn/core-i18n-server": "link:packages/core/i18n/core-i18n-server", + "@kbn/core-i18n-server-internal": "link:packages/core/i18n/core-i18n-server-internal", + "@kbn/core-i18n-server-mocks": "link:packages/core/i18n/core-i18n-server-mocks", + "@kbn/core-injected-metadata-browser-internal": "link:packages/core/injected-metadata/core-injected-metadata-browser-internal", + "@kbn/core-injected-metadata-browser-mocks": "link:packages/core/injected-metadata/core-injected-metadata-browser-mocks", + "@kbn/core-injected-metadata-common-internal": "link:packages/core/injected-metadata/core-injected-metadata-common-internal", + "@kbn/core-integrations-browser-internal": "link:packages/core/integrations/core-integrations-browser-internal", + "@kbn/core-integrations-browser-mocks": "link:packages/core/integrations/core-integrations-browser-mocks", + "@kbn/core-lifecycle-browser": "link:packages/core/lifecycle/core-lifecycle-browser", + "@kbn/core-lifecycle-browser-internal": "link:packages/core/lifecycle/core-lifecycle-browser-internal", + "@kbn/core-lifecycle-browser-mocks": "link:packages/core/lifecycle/core-lifecycle-browser-mocks", + "@kbn/core-lifecycle-server": "link:packages/core/lifecycle/core-lifecycle-server", + "@kbn/core-lifecycle-server-internal": "link:packages/core/lifecycle/core-lifecycle-server-internal", + "@kbn/core-lifecycle-server-mocks": "link:packages/core/lifecycle/core-lifecycle-server-mocks", + "@kbn/core-logging-browser-internal": "link:packages/core/logging/core-logging-browser-internal", + "@kbn/core-logging-browser-mocks": "link:packages/core/logging/core-logging-browser-mocks", + "@kbn/core-logging-common-internal": "link:packages/core/logging/core-logging-common-internal", + "@kbn/core-logging-server": "link:packages/core/logging/core-logging-server", + "@kbn/core-logging-server-internal": "link:packages/core/logging/core-logging-server-internal", + "@kbn/core-logging-server-mocks": "link:packages/core/logging/core-logging-server-mocks", + "@kbn/core-metrics-collectors-server-internal": "link:packages/core/metrics/core-metrics-collectors-server-internal", + "@kbn/core-metrics-collectors-server-mocks": "link:packages/core/metrics/core-metrics-collectors-server-mocks", + "@kbn/core-metrics-server": "link:packages/core/metrics/core-metrics-server", + "@kbn/core-metrics-server-internal": "link:packages/core/metrics/core-metrics-server-internal", + "@kbn/core-metrics-server-mocks": "link:packages/core/metrics/core-metrics-server-mocks", + "@kbn/core-mount-utils-browser": "link:packages/core/mount-utils/core-mount-utils-browser", + "@kbn/core-mount-utils-browser-internal": "link:packages/core/mount-utils/core-mount-utils-browser-internal", + "@kbn/core-node-server": "link:packages/core/node/core-node-server", + "@kbn/core-node-server-internal": "link:packages/core/node/core-node-server-internal", + "@kbn/core-node-server-mocks": "link:packages/core/node/core-node-server-mocks", + "@kbn/core-notifications-browser": "link:packages/core/notifications/core-notifications-browser", + "@kbn/core-notifications-browser-internal": "link:packages/core/notifications/core-notifications-browser-internal", + "@kbn/core-notifications-browser-mocks": "link:packages/core/notifications/core-notifications-browser-mocks", + "@kbn/core-overlays-browser": "link:packages/core/overlays/core-overlays-browser", + "@kbn/core-overlays-browser-internal": "link:packages/core/overlays/core-overlays-browser-internal", + "@kbn/core-overlays-browser-mocks": "link:packages/core/overlays/core-overlays-browser-mocks", + "@kbn/core-plugins-base-server-internal": "link:packages/core/plugins/core-plugins-base-server-internal", + "@kbn/core-plugins-browser": "link:packages/core/plugins/core-plugins-browser", + "@kbn/core-plugins-browser-internal": "link:packages/core/plugins/core-plugins-browser-internal", + "@kbn/core-plugins-browser-mocks": "link:packages/core/plugins/core-plugins-browser-mocks", + "@kbn/core-plugins-server": "link:packages/core/plugins/core-plugins-server", + "@kbn/core-plugins-server-internal": "link:packages/core/plugins/core-plugins-server-internal", + "@kbn/core-plugins-server-mocks": "link:packages/core/plugins/core-plugins-server-mocks", + "@kbn/core-preboot-server": "link:packages/core/preboot/core-preboot-server", + "@kbn/core-preboot-server-internal": "link:packages/core/preboot/core-preboot-server-internal", + "@kbn/core-preboot-server-mocks": "link:packages/core/preboot/core-preboot-server-mocks", + "@kbn/core-rendering-browser-internal": "link:packages/core/rendering/core-rendering-browser-internal", + "@kbn/core-rendering-browser-mocks": "link:packages/core/rendering/core-rendering-browser-mocks", + "@kbn/core-rendering-server-internal": "link:packages/core/rendering/core-rendering-server-internal", + "@kbn/core-rendering-server-mocks": "link:packages/core/rendering/core-rendering-server-mocks", + "@kbn/core-root-browser-internal": "link:packages/core/root/core-root-browser-internal", + "@kbn/core-root-server-internal": "link:packages/core/root/core-root-server-internal", + "@kbn/core-saved-objects-api-browser": "link:packages/core/saved-objects/core-saved-objects-api-browser", + "@kbn/core-saved-objects-api-server": "link:packages/core/saved-objects/core-saved-objects-api-server", + "@kbn/core-saved-objects-api-server-internal": "link:packages/core/saved-objects/core-saved-objects-api-server-internal", + "@kbn/core-saved-objects-api-server-mocks": "link:packages/core/saved-objects/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-base-server-internal": "link:packages/core/saved-objects/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-base-server-mocks": "link:packages/core/saved-objects/core-saved-objects-base-server-mocks", + "@kbn/core-saved-objects-browser": "link:packages/core/saved-objects/core-saved-objects-browser", + "@kbn/core-saved-objects-browser-internal": "link:packages/core/saved-objects/core-saved-objects-browser-internal", + "@kbn/core-saved-objects-browser-mocks": "link:packages/core/saved-objects/core-saved-objects-browser-mocks", + "@kbn/core-saved-objects-common": "link:packages/core/saved-objects/core-saved-objects-common", + "@kbn/core-saved-objects-import-export-server-internal": "link:packages/core/saved-objects/core-saved-objects-import-export-server-internal", + "@kbn/core-saved-objects-import-export-server-mocks": "link:packages/core/saved-objects/core-saved-objects-import-export-server-mocks", + "@kbn/core-saved-objects-migration-server-internal": "link:packages/core/saved-objects/core-saved-objects-migration-server-internal", + "@kbn/core-saved-objects-migration-server-mocks": "link:packages/core/saved-objects/core-saved-objects-migration-server-mocks", + "@kbn/core-saved-objects-server": "link:packages/core/saved-objects/core-saved-objects-server", + "@kbn/core-saved-objects-server-internal": "link:packages/core/saved-objects/core-saved-objects-server-internal", + "@kbn/core-saved-objects-server-mocks": "link:packages/core/saved-objects/core-saved-objects-server-mocks", + "@kbn/core-saved-objects-utils-server": "link:packages/core/saved-objects/core-saved-objects-utils-server", + "@kbn/core-status-common": "link:packages/core/status/core-status-common", + "@kbn/core-status-common-internal": "link:packages/core/status/core-status-common-internal", + "@kbn/core-status-server": "link:packages/core/status/core-status-server", + "@kbn/core-status-server-internal": "link:packages/core/status/core-status-server-internal", + "@kbn/core-status-server-mocks": "link:packages/core/status/core-status-server-mocks", + "@kbn/core-test-helpers-deprecations-getters": "link:packages/core/test-helpers/core-test-helpers-deprecations-getters", + "@kbn/core-test-helpers-http-setup-browser": "link:packages/core/test-helpers/core-test-helpers-http-setup-browser", + "@kbn/core-test-helpers-so-type-serializer": "link:packages/core/test-helpers/core-test-helpers-so-type-serializer", + "@kbn/core-test-helpers-test-utils": "link:packages/core/test-helpers/core-test-helpers-test-utils", + "@kbn/core-theme-browser": "link:packages/core/theme/core-theme-browser", + "@kbn/core-theme-browser-internal": "link:packages/core/theme/core-theme-browser-internal", + "@kbn/core-theme-browser-mocks": "link:packages/core/theme/core-theme-browser-mocks", + "@kbn/core-ui-settings-browser": "link:packages/core/ui-settings/core-ui-settings-browser", + "@kbn/core-ui-settings-browser-internal": "link:packages/core/ui-settings/core-ui-settings-browser-internal", + "@kbn/core-ui-settings-browser-mocks": "link:packages/core/ui-settings/core-ui-settings-browser-mocks", + "@kbn/core-ui-settings-common": "link:packages/core/ui-settings/core-ui-settings-common", + "@kbn/core-ui-settings-server": "link:packages/core/ui-settings/core-ui-settings-server", + "@kbn/core-ui-settings-server-internal": "link:packages/core/ui-settings/core-ui-settings-server-internal", + "@kbn/core-ui-settings-server-mocks": "link:packages/core/ui-settings/core-ui-settings-server-mocks", + "@kbn/core-usage-data-base-server-internal": "link:packages/core/usage-data/core-usage-data-base-server-internal", + "@kbn/core-usage-data-server": "link:packages/core/usage-data/core-usage-data-server", + "@kbn/core-usage-data-server-internal": "link:packages/core/usage-data/core-usage-data-server-internal", + "@kbn/core-usage-data-server-mocks": "link:packages/core/usage-data/core-usage-data-server-mocks", + "@kbn/crypto": "link:packages/kbn-crypto", + "@kbn/crypto-browser": "link:packages/kbn-crypto-browser", + "@kbn/datemath": "link:packages/kbn-datemath", + "@kbn/doc-links": "link:packages/kbn-doc-links", + "@kbn/ebt-tools": "link:packages/kbn-ebt-tools", + "@kbn/ecs": "link:packages/kbn-ecs", + "@kbn/es-errors": "link:packages/kbn-es-errors", + "@kbn/es-query": "link:packages/kbn-es-query", + "@kbn/es-types": "link:packages/kbn-es-types", + "@kbn/field-types": "link:packages/kbn-field-types", + "@kbn/flot-charts": "link:packages/kbn-flot-charts", + "@kbn/guided-onboarding": "link:packages/kbn-guided-onboarding", + "@kbn/handlebars": "link:packages/kbn-handlebars", + "@kbn/hapi-mocks": "link:packages/kbn-hapi-mocks", + "@kbn/health-gateway-server": "link:packages/kbn-health-gateway-server", + "@kbn/home-sample-data-card": "link:packages/home/sample_data_card", + "@kbn/home-sample-data-tab": "link:packages/home/sample_data_tab", + "@kbn/home-sample-data-types": "link:packages/home/sample_data_types", + "@kbn/i18n": "link:packages/kbn-i18n", + "@kbn/i18n-react": "link:packages/kbn-i18n-react", + "@kbn/interpreter": "link:packages/kbn-interpreter", + "@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils", + "@kbn/language-documentation-popover": "link:packages/kbn-language-documentation-popover", + "@kbn/logging": "link:packages/kbn-logging", + "@kbn/logging-mocks": "link:packages/kbn-logging-mocks", + "@kbn/mapbox-gl": "link:packages/kbn-mapbox-gl", + "@kbn/ml-agg-utils": "link:x-pack/packages/ml/agg_utils", + "@kbn/ml-is-populated-object": "link:x-pack/packages/ml/is_populated_object", + "@kbn/ml-string-hash": "link:x-pack/packages/ml/string_hash", + "@kbn/monaco": "link:packages/kbn-monaco", + "@kbn/osquery-io-ts-types": "link:packages/kbn-osquery-io-ts-types", + "@kbn/plugin-discovery": "link:packages/kbn-plugin-discovery", + "@kbn/react-field": "link:packages/kbn-react-field", + "@kbn/repo-info": "link:packages/kbn-repo-info", + "@kbn/rison": "link:packages/kbn-rison", + "@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils", + "@kbn/safer-lodash-set": "link:packages/kbn-safer-lodash-set", + "@kbn/securitysolution-autocomplete": "link:packages/kbn-securitysolution-autocomplete", + "@kbn/securitysolution-es-utils": "link:packages/kbn-securitysolution-es-utils", + "@kbn/securitysolution-exception-list-components": "link:packages/kbn-securitysolution-exception-list-components", + "@kbn/securitysolution-hook-utils": "link:packages/kbn-securitysolution-hook-utils", + "@kbn/securitysolution-io-ts-alerting-types": "link:packages/kbn-securitysolution-io-ts-alerting-types", + "@kbn/securitysolution-io-ts-list-types": "link:packages/kbn-securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-types": "link:packages/kbn-securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils": "link:packages/kbn-securitysolution-io-ts-utils", + "@kbn/securitysolution-list-api": "link:packages/kbn-securitysolution-list-api", + "@kbn/securitysolution-list-constants": "link:packages/kbn-securitysolution-list-constants", + "@kbn/securitysolution-list-hooks": "link:packages/kbn-securitysolution-list-hooks", + "@kbn/securitysolution-list-utils": "link:packages/kbn-securitysolution-list-utils", + "@kbn/securitysolution-rules": "link:packages/kbn-securitysolution-rules", + "@kbn/securitysolution-t-grid": "link:packages/kbn-securitysolution-t-grid", + "@kbn/securitysolution-utils": "link:packages/kbn-securitysolution-utils", + "@kbn/server-http-tools": "link:packages/kbn-server-http-tools", + "@kbn/server-route-repository": "link:packages/kbn-server-route-repository", + "@kbn/shared-svg": "link:packages/kbn-shared-svg", + "@kbn/shared-ux-avatar-solution": "link:packages/shared-ux/avatar/solution", + "@kbn/shared-ux-avatar-user-profile-components": "link:packages/shared-ux/avatar/user_profile/impl", + "@kbn/shared-ux-button-exit-full-screen": "link:packages/shared-ux/button/exit_full_screen/impl", + "@kbn/shared-ux-button-exit-full-screen-mocks": "link:packages/shared-ux/button/exit_full_screen/mocks", + "@kbn/shared-ux-button-exit-full-screen-types": "link:packages/shared-ux/button/exit_full_screen/types", + "@kbn/shared-ux-button-toolbar": "link:packages/shared-ux/button_toolbar", + "@kbn/shared-ux-card-no-data": "link:packages/shared-ux/card/no_data/impl", + "@kbn/shared-ux-card-no-data-mocks": "link:packages/shared-ux/card/no_data/mocks", + "@kbn/shared-ux-card-no-data-types": "link:packages/shared-ux/card/no_data/types", + "@kbn/shared-ux-file-context": "link:packages/shared-ux/file/context", + "@kbn/shared-ux-file-image": "link:packages/shared-ux/file/image/impl", + "@kbn/shared-ux-file-image-mocks": "link:packages/shared-ux/file/image/mocks", + "@kbn/shared-ux-file-mocks": "link:packages/shared-ux/file/mocks", + "@kbn/shared-ux-file-picker": "link:packages/shared-ux/file/file_picker/impl", + "@kbn/shared-ux-file-types": "link:packages/shared-ux/file/types", + "@kbn/shared-ux-file-upload": "link:packages/shared-ux/file/file_upload/impl", + "@kbn/shared-ux-file-util": "link:packages/shared-ux/file/util", + "@kbn/shared-ux-link-redirect-app": "link:packages/shared-ux/link/redirect_app/impl", + "@kbn/shared-ux-link-redirect-app-mocks": "link:packages/shared-ux/link/redirect_app/mocks", + "@kbn/shared-ux-link-redirect-app-types": "link:packages/shared-ux/link/redirect_app/types", + "@kbn/shared-ux-markdown": "link:packages/shared-ux/markdown/impl", + "@kbn/shared-ux-markdown-mocks": "link:packages/shared-ux/markdown/mocks", + "@kbn/shared-ux-markdown-types": "link:packages/shared-ux/markdown/types", + "@kbn/shared-ux-page-analytics-no-data": "link:packages/shared-ux/page/analytics_no_data/impl", + "@kbn/shared-ux-page-analytics-no-data-mocks": "link:packages/shared-ux/page/analytics_no_data/mocks", + "@kbn/shared-ux-page-analytics-no-data-types": "link:packages/shared-ux/page/analytics_no_data/types", + "@kbn/shared-ux-page-kibana-no-data": "link:packages/shared-ux/page/kibana_no_data/impl", + "@kbn/shared-ux-page-kibana-no-data-mocks": "link:packages/shared-ux/page/kibana_no_data/mocks", + "@kbn/shared-ux-page-kibana-no-data-types": "link:packages/shared-ux/page/kibana_no_data/types", + "@kbn/shared-ux-page-kibana-template": "link:packages/shared-ux/page/kibana_template/impl", + "@kbn/shared-ux-page-kibana-template-mocks": "link:packages/shared-ux/page/kibana_template/mocks", + "@kbn/shared-ux-page-kibana-template-types": "link:packages/shared-ux/page/kibana_template/types", + "@kbn/shared-ux-page-no-data": "link:packages/shared-ux/page/no_data/impl", + "@kbn/shared-ux-page-no-data-config": "link:packages/shared-ux/page/no_data_config/impl", + "@kbn/shared-ux-page-no-data-config-mocks": "link:packages/shared-ux/page/no_data_config/mocks", + "@kbn/shared-ux-page-no-data-config-types": "link:packages/shared-ux/page/no_data_config/types", + "@kbn/shared-ux-page-no-data-mocks": "link:packages/shared-ux/page/no_data/mocks", + "@kbn/shared-ux-page-no-data-types": "link:packages/shared-ux/page/no_data/types", + "@kbn/shared-ux-page-solution-nav": "link:packages/shared-ux/page/solution_nav", + "@kbn/shared-ux-prompt-no-data-views": "link:packages/shared-ux/prompt/no_data_views/impl", + "@kbn/shared-ux-prompt-no-data-views-mocks": "link:packages/shared-ux/prompt/no_data_views/mocks", + "@kbn/shared-ux-prompt-no-data-views-types": "link:packages/shared-ux/prompt/no_data_views/types", + "@kbn/shared-ux-prompt-not-found": "link:packages/shared-ux/prompt/not_found", + "@kbn/shared-ux-router-mocks": "link:packages/shared-ux/router/mocks", + "@kbn/shared-ux-services": "link:packages/kbn-shared-ux-services", + "@kbn/shared-ux-storybook": "link:packages/kbn-shared-ux-storybook", + "@kbn/shared-ux-storybook-mock": "link:packages/shared-ux/storybook/mock", + "@kbn/shared-ux-utility": "link:packages/kbn-shared-ux-utility", + "@kbn/std": "link:packages/kbn-std", + "@kbn/timelion-grammar": "link:packages/kbn-timelion-grammar", + "@kbn/tinymath": "link:packages/kbn-tinymath", + "@kbn/typed-react-router-config": "link:packages/kbn-typed-react-router-config", + "@kbn/ui-framework": "link:packages/kbn-ui-framework", + "@kbn/ui-shared-deps-npm": "link:packages/kbn-ui-shared-deps-npm", + "@kbn/ui-shared-deps-src": "link:packages/kbn-ui-shared-deps-src", + "@kbn/ui-theme": "link:packages/kbn-ui-theme", + "@kbn/user-profile-components": "link:packages/kbn-user-profile-components", + "@kbn/utility-types": "link:packages/kbn-utility-types", + "@kbn/utility-types-jest": "link:packages/kbn-utility-types-jest", + "@kbn/utils": "link:packages/kbn-utils", "@loaders.gl/core": "^2.3.1", "@loaders.gl/json": "^2.3.1", "@loaders.gl/shapefile": "^2.3.1", @@ -464,8 +465,6 @@ "@turf/distance": "6.0.1", "@turf/helpers": "6.0.1", "@turf/length": "^6.0.2", - "@types/adm-zip": "^0.5.0", - "@types/byte-size": "^8.1.0", "@xstate/react": "^3.0.1", "JSONStream": "1.3.5", "abort-controller": "^3.0.0", @@ -732,69 +731,75 @@ "@jest/reporters": "^29.3.1", "@jest/transform": "^29.3.1", "@jest/types": "^29.3.1", - "@kbn/ambient-common-types": "link:bazel-bin/packages/kbn-ambient-common-types", - "@kbn/ambient-ftr-types": "link:bazel-bin/packages/kbn-ambient-ftr-types", - "@kbn/ambient-storybook-types": "link:bazel-bin/packages/kbn-ambient-storybook-types", - "@kbn/ambient-ui-types": "link:bazel-bin/packages/kbn-ambient-ui-types", - "@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace", - "@kbn/axe-config": "link:bazel-bin/packages/kbn-axe-config", - "@kbn/babel-plugin-synthetic-packages": "link:bazel-bin/packages/kbn-babel-plugin-synthetic-packages", - "@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset", - "@kbn/bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages", - "@kbn/bazel-runner": "link:bazel-bin/packages/kbn-bazel-runner", - "@kbn/ci-stats-core": "link:bazel-bin/packages/kbn-ci-stats-core", - "@kbn/ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-ci-stats-performance-metrics", - "@kbn/ci-stats-reporter": "link:bazel-bin/packages/kbn-ci-stats-reporter", - "@kbn/cli-dev-mode": "link:bazel-bin/packages/kbn-cli-dev-mode", - "@kbn/core-test-helpers-kbn-server": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-kbn-server", - "@kbn/dev-cli-errors": "link:bazel-bin/packages/kbn-dev-cli-errors", - "@kbn/dev-cli-runner": "link:bazel-bin/packages/kbn-dev-cli-runner", - "@kbn/dev-proc-runner": "link:bazel-bin/packages/kbn-dev-proc-runner", - "@kbn/dev-utils": "link:bazel-bin/packages/kbn-dev-utils", - "@kbn/docs-utils": "link:bazel-bin/packages/kbn-docs-utils", - "@kbn/es": "link:bazel-bin/packages/kbn-es", - "@kbn/es-archiver": "link:bazel-bin/packages/kbn-es-archiver", - "@kbn/eslint-config": "link:bazel-bin/packages/kbn-eslint-config", - "@kbn/eslint-plugin-disable": "link:bazel-bin/packages/kbn-eslint-plugin-disable", - "@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint", - "@kbn/eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports", - "@kbn/expect": "link:bazel-bin/packages/kbn-expect", - "@kbn/failed-test-reporter-cli": "link:bazel-bin/packages/kbn-failed-test-reporter-cli", - "@kbn/find-used-node-modules": "link:bazel-bin/packages/kbn-find-used-node-modules", - "@kbn/ftr-common-functional-services": "link:bazel-bin/packages/kbn-ftr-common-functional-services", - "@kbn/ftr-screenshot-filename": "link:bazel-bin/packages/kbn-ftr-screenshot-filename", - "@kbn/generate": "link:bazel-bin/packages/kbn-generate", - "@kbn/get-repo-files": "link:bazel-bin/packages/kbn-get-repo-files", - "@kbn/import-resolver": "link:bazel-bin/packages/kbn-import-resolver", - "@kbn/jest-serializers": "link:bazel-bin/packages/kbn-jest-serializers", - "@kbn/journeys": "link:bazel-bin/packages/kbn-journeys", - "@kbn/kibana-manifest-schema": "link:bazel-bin/packages/kbn-kibana-manifest-schema", - "@kbn/managed-vscode-config": "link:bazel-bin/packages/kbn-managed-vscode-config", - "@kbn/managed-vscode-config-cli": "link:bazel-bin/packages/kbn-managed-vscode-config-cli", - "@kbn/optimizer": "link:bazel-bin/packages/kbn-optimizer", - "@kbn/optimizer-webpack-helpers": "link:bazel-bin/packages/kbn-optimizer-webpack-helpers", - "@kbn/peggy": "link:bazel-bin/packages/kbn-peggy", - "@kbn/peggy-loader": "link:bazel-bin/packages/kbn-peggy-loader", - "@kbn/performance-testing-dataset-extractor": "link:bazel-bin/packages/kbn-performance-testing-dataset-extractor", - "@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator", - "@kbn/plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers", - "@kbn/repo-source-classifier": "link:bazel-bin/packages/kbn-repo-source-classifier", - "@kbn/repo-source-classifier-cli": "link:bazel-bin/packages/kbn-repo-source-classifier-cli", - "@kbn/some-dev-log": "link:bazel-bin/packages/kbn-some-dev-log", - "@kbn/sort-package-json": "link:bazel-bin/packages/kbn-sort-package-json", - "@kbn/spec-to-console": "link:bazel-bin/packages/kbn-spec-to-console", - "@kbn/stdio-dev-helpers": "link:bazel-bin/packages/kbn-stdio-dev-helpers", - "@kbn/storybook": "link:bazel-bin/packages/kbn-storybook", - "@kbn/synthetic-package-map": "link:bazel-bin/packages/kbn-synthetic-package-map", - "@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools", - "@kbn/test": "link:bazel-bin/packages/kbn-test", - "@kbn/test-jest-helpers": "link:bazel-bin/packages/kbn-test-jest-helpers", - "@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector", - "@kbn/tooling-log": "link:bazel-bin/packages/kbn-tooling-log", - "@kbn/type-summarizer": "link:bazel-bin/packages/kbn-type-summarizer", - "@kbn/type-summarizer-cli": "link:bazel-bin/packages/kbn-type-summarizer-cli", - "@kbn/type-summarizer-core": "link:bazel-bin/packages/kbn-type-summarizer-core", - "@kbn/yarn-lock-validator": "link:bazel-bin/packages/kbn-yarn-lock-validator", + "@kbn/ambient-common-types": "link:packages/kbn-ambient-common-types", + "@kbn/ambient-ftr-types": "link:packages/kbn-ambient-ftr-types", + "@kbn/ambient-storybook-types": "link:packages/kbn-ambient-storybook-types", + "@kbn/ambient-ui-types": "link:packages/kbn-ambient-ui-types", + "@kbn/apm-synthtrace": "link:packages/kbn-apm-synthtrace", + "@kbn/axe-config": "link:packages/kbn-axe-config", + "@kbn/babel-plugin-package-imports": "link:packages/kbn-babel-plugin-package-imports", + "@kbn/babel-preset": "link:packages/kbn-babel-preset", + "@kbn/babel-register": "link:packages/kbn-babel-register", + "@kbn/babel-transform": "link:packages/kbn-babel-transform", + "@kbn/bazel-packages": "link:packages/kbn-bazel-packages", + "@kbn/bazel-runner": "link:packages/kbn-bazel-runner", + "@kbn/ci-stats-core": "link:packages/kbn-ci-stats-core", + "@kbn/ci-stats-performance-metrics": "link:packages/kbn-ci-stats-performance-metrics", + "@kbn/ci-stats-reporter": "link:packages/kbn-ci-stats-reporter", + "@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode", + "@kbn/core-test-helpers-kbn-server": "link:packages/core/test-helpers/core-test-helpers-kbn-server", + "@kbn/cypress-config": "link:packages/kbn-cypress-config", + "@kbn/dev-cli-errors": "link:packages/kbn-dev-cli-errors", + "@kbn/dev-cli-runner": "link:packages/kbn-dev-cli-runner", + "@kbn/dev-proc-runner": "link:packages/kbn-dev-proc-runner", + "@kbn/dev-utils": "link:packages/kbn-dev-utils", + "@kbn/docs-utils": "link:packages/kbn-docs-utils", + "@kbn/es": "link:packages/kbn-es", + "@kbn/es-archiver": "link:packages/kbn-es-archiver", + "@kbn/eslint-config": "link:packages/kbn-eslint-config", + "@kbn/eslint-plugin-disable": "link:packages/kbn-eslint-plugin-disable", + "@kbn/eslint-plugin-eslint": "link:packages/kbn-eslint-plugin-eslint", + "@kbn/eslint-plugin-imports": "link:packages/kbn-eslint-plugin-imports", + "@kbn/expect": "link:packages/kbn-expect", + "@kbn/failed-test-reporter-cli": "link:packages/kbn-failed-test-reporter-cli", + "@kbn/find-used-node-modules": "link:packages/kbn-find-used-node-modules", + "@kbn/ftr-common-functional-services": "link:packages/kbn-ftr-common-functional-services", + "@kbn/ftr-screenshot-filename": "link:packages/kbn-ftr-screenshot-filename", + "@kbn/generate": "link:packages/kbn-generate", + "@kbn/get-repo-files": "link:packages/kbn-get-repo-files", + "@kbn/import-resolver": "link:packages/kbn-import-resolver", + "@kbn/jest-serializers": "link:packages/kbn-jest-serializers", + "@kbn/journeys": "link:packages/kbn-journeys", + "@kbn/kibana-manifest-schema": "link:packages/kbn-kibana-manifest-schema", + "@kbn/managed-vscode-config": "link:packages/kbn-managed-vscode-config", + "@kbn/managed-vscode-config-cli": "link:packages/kbn-managed-vscode-config-cli", + "@kbn/optimizer": "link:packages/kbn-optimizer", + "@kbn/optimizer-webpack-helpers": "link:packages/kbn-optimizer-webpack-helpers", + "@kbn/package-map": "link:packages/kbn-package-map", + "@kbn/peggy": "link:packages/kbn-peggy", + "@kbn/peggy-loader": "link:packages/kbn-peggy-loader", + "@kbn/performance-testing-dataset-extractor": "link:packages/kbn-performance-testing-dataset-extractor", + "@kbn/plugin-generator": "link:packages/kbn-plugin-generator", + "@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers", + "@kbn/repo-path": "link:packages/kbn-repo-path", + "@kbn/repo-source-classifier": "link:packages/kbn-repo-source-classifier", + "@kbn/repo-source-classifier-cli": "link:packages/kbn-repo-source-classifier-cli", + "@kbn/some-dev-log": "link:packages/kbn-some-dev-log", + "@kbn/sort-package-json": "link:packages/kbn-sort-package-json", + "@kbn/spec-to-console": "link:packages/kbn-spec-to-console", + "@kbn/stdio-dev-helpers": "link:packages/kbn-stdio-dev-helpers", + "@kbn/storybook": "link:packages/kbn-storybook", + "@kbn/telemetry-tools": "link:packages/kbn-telemetry-tools", + "@kbn/test": "link:packages/kbn-test", + "@kbn/test-jest-helpers": "link:packages/kbn-test-jest-helpers", + "@kbn/test-subj-selector": "link:packages/kbn-test-subj-selector", + "@kbn/tooling-log": "link:packages/kbn-tooling-log", + "@kbn/ts-project-linter": "link:packages/kbn-ts-project-linter", + "@kbn/ts-project-linter-cli": "link:packages/kbn-ts-project-linter-cli", + "@kbn/ts-projects": "link:packages/kbn-ts-projects", + "@kbn/ts-type-check-cli": "link:packages/kbn-ts-type-check-cli", + "@kbn/web-worker-stub": "link:packages/kbn-web-worker-stub", + "@kbn/yarn-lock-validator": "link:packages/kbn-yarn-lock-validator", "@loaders.gl/polyfills": "^2.3.5", "@mapbox/vector-tile": "1.3.1", "@octokit/rest": "^16.35.0", @@ -824,12 +829,14 @@ "@testing-library/react": "^12.1.5", "@testing-library/react-hooks": "^8.0.1", "@testing-library/user-event": "^13.5.0", + "@types/adm-zip": "^0.5.0", "@types/archiver": "^5.3.1", "@types/async": "^3.2.3", "@types/babel__core": "^7.1.20", "@types/babel__generator": "^7.6.4", "@types/babel__helper-plugin-utils": "^7.10.0", "@types/base64-js": "^1.2.5", + "@types/byte-size": "^8.1.0", "@types/chance": "^1.0.0", "@types/chroma-js": "^1.4.2", "@types/chromedriver": "^81.0.1", @@ -1134,7 +1141,6 @@ "terser-webpack-plugin": "^4.2.3", "tough-cookie": "^4.1.2", "tree-kill": "^1.2.2", - "ts-loader": "^7.0.5", "ts-morph": "^13.0.2", "tsd": "^0.20.0", "typescript": "4.6.3", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel deleted file mode 100644 index f30be8be4606..000000000000 --- a/packages/BUILD.bazel +++ /dev/null @@ -1,748 +0,0 @@ -################ -################ -## This file is automatically generated, to create a new package use `node scripts/generate package --help` or run -## `node scripts/generate packages_build_manifest` to regenerate it from the current state of the repo -################ -################ - -# It will build all declared code packages -filegroup( - name = "build_pkg_code", - srcs = [ - "//packages/analytics/client:build", - "//packages/analytics/shippers/elastic_v3/browser:build", - "//packages/analytics/shippers/elastic_v3/common:build", - "//packages/analytics/shippers/elastic_v3/server:build", - "//packages/analytics/shippers/fullstory:build", - "//packages/analytics/shippers/gainsight:build", - "//packages/content-management/content_editor:build", - "//packages/content-management/table_list:build", - "//packages/core/analytics/core-analytics-browser:build", - "//packages/core/analytics/core-analytics-browser-internal:build", - "//packages/core/analytics/core-analytics-browser-mocks:build", - "//packages/core/analytics/core-analytics-server:build", - "//packages/core/analytics/core-analytics-server-internal:build", - "//packages/core/analytics/core-analytics-server-mocks:build", - "//packages/core/application/core-application-browser:build", - "//packages/core/application/core-application-browser-internal:build", - "//packages/core/application/core-application-browser-mocks:build", - "//packages/core/application/core-application-common:build", - "//packages/core/apps/core-apps-browser-internal:build", - "//packages/core/apps/core-apps-browser-mocks:build", - "//packages/core/apps/core-apps-server-internal:build", - "//packages/core/base/core-base-browser-internal:build", - "//packages/core/base/core-base-browser-mocks:build", - "//packages/core/base/core-base-common:build", - "//packages/core/base/core-base-common-internal:build", - "//packages/core/base/core-base-server-internal:build", - "//packages/core/base/core-base-server-mocks:build", - "//packages/core/capabilities/core-capabilities-browser-internal:build", - "//packages/core/capabilities/core-capabilities-browser-mocks:build", - "//packages/core/capabilities/core-capabilities-common:build", - "//packages/core/capabilities/core-capabilities-server:build", - "//packages/core/capabilities/core-capabilities-server-internal:build", - "//packages/core/capabilities/core-capabilities-server-mocks:build", - "//packages/core/chrome/core-chrome-browser:build", - "//packages/core/chrome/core-chrome-browser-internal:build", - "//packages/core/chrome/core-chrome-browser-mocks:build", - "//packages/core/config/core-config-server-internal:build", - "//packages/core/deprecations/core-deprecations-browser:build", - "//packages/core/deprecations/core-deprecations-browser-internal:build", - "//packages/core/deprecations/core-deprecations-browser-mocks:build", - "//packages/core/deprecations/core-deprecations-common:build", - "//packages/core/deprecations/core-deprecations-server:build", - "//packages/core/deprecations/core-deprecations-server-internal:build", - "//packages/core/deprecations/core-deprecations-server-mocks:build", - "//packages/core/doc-links/core-doc-links-browser:build", - "//packages/core/doc-links/core-doc-links-browser-internal:build", - "//packages/core/doc-links/core-doc-links-browser-mocks:build", - "//packages/core/doc-links/core-doc-links-server:build", - "//packages/core/doc-links/core-doc-links-server-internal:build", - "//packages/core/doc-links/core-doc-links-server-mocks:build", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:build", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:build", - "//packages/core/elasticsearch/core-elasticsearch-server:build", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:build", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks:build", - "//packages/core/environment/core-environment-server-internal:build", - "//packages/core/environment/core-environment-server-mocks:build", - "//packages/core/execution-context/core-execution-context-browser:build", - "//packages/core/execution-context/core-execution-context-browser-internal:build", - "//packages/core/execution-context/core-execution-context-browser-mocks:build", - "//packages/core/execution-context/core-execution-context-common:build", - "//packages/core/execution-context/core-execution-context-server:build", - "//packages/core/execution-context/core-execution-context-server-internal:build", - "//packages/core/execution-context/core-execution-context-server-mocks:build", - "//packages/core/fatal-errors/core-fatal-errors-browser:build", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal:build", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks:build", - "//packages/core/http/core-http-browser:build", - "//packages/core/http/core-http-browser-internal:build", - "//packages/core/http/core-http-browser-mocks:build", - "//packages/core/http/core-http-common:build", - "//packages/core/http/core-http-context-server-internal:build", - "//packages/core/http/core-http-context-server-mocks:build", - "//packages/core/http/core-http-request-handler-context-server:build", - "//packages/core/http/core-http-request-handler-context-server-internal:build", - "//packages/core/http/core-http-resources-server:build", - "//packages/core/http/core-http-resources-server-internal:build", - "//packages/core/http/core-http-resources-server-mocks:build", - "//packages/core/http/core-http-router-server-internal:build", - "//packages/core/http/core-http-router-server-mocks:build", - "//packages/core/http/core-http-server:build", - "//packages/core/http/core-http-server-internal:build", - "//packages/core/http/core-http-server-mocks:build", - "//packages/core/i18n/core-i18n-browser:build", - "//packages/core/i18n/core-i18n-browser-internal:build", - "//packages/core/i18n/core-i18n-browser-mocks:build", - "//packages/core/i18n/core-i18n-server:build", - "//packages/core/i18n/core-i18n-server-internal:build", - "//packages/core/i18n/core-i18n-server-mocks:build", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:build", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:build", - "//packages/core/injected-metadata/core-injected-metadata-common-internal:build", - "//packages/core/integrations/core-integrations-browser-internal:build", - "//packages/core/integrations/core-integrations-browser-mocks:build", - "//packages/core/lifecycle/core-lifecycle-browser:build", - "//packages/core/lifecycle/core-lifecycle-browser-internal:build", - "//packages/core/lifecycle/core-lifecycle-browser-mocks:build", - "//packages/core/lifecycle/core-lifecycle-server:build", - "//packages/core/lifecycle/core-lifecycle-server-internal:build", - "//packages/core/lifecycle/core-lifecycle-server-mocks:build", - "//packages/core/logging/core-logging-browser-internal:build", - "//packages/core/logging/core-logging-browser-mocks:build", - "//packages/core/logging/core-logging-common-internal:build", - "//packages/core/logging/core-logging-server:build", - "//packages/core/logging/core-logging-server-internal:build", - "//packages/core/logging/core-logging-server-mocks:build", - "//packages/core/metrics/core-metrics-collectors-server-internal:build", - "//packages/core/metrics/core-metrics-collectors-server-mocks:build", - "//packages/core/metrics/core-metrics-server:build", - "//packages/core/metrics/core-metrics-server-internal:build", - "//packages/core/metrics/core-metrics-server-mocks:build", - "//packages/core/mount-utils/core-mount-utils-browser:build", - "//packages/core/mount-utils/core-mount-utils-browser-internal:build", - "//packages/core/node/core-node-server:build", - "//packages/core/node/core-node-server-internal:build", - "//packages/core/node/core-node-server-mocks:build", - "//packages/core/notifications/core-notifications-browser:build", - "//packages/core/notifications/core-notifications-browser-internal:build", - "//packages/core/notifications/core-notifications-browser-mocks:build", - "//packages/core/overlays/core-overlays-browser:build", - "//packages/core/overlays/core-overlays-browser-internal:build", - "//packages/core/overlays/core-overlays-browser-mocks:build", - "//packages/core/plugins/core-plugins-base-server-internal:build", - "//packages/core/plugins/core-plugins-browser:build", - "//packages/core/plugins/core-plugins-browser-internal:build", - "//packages/core/plugins/core-plugins-browser-mocks:build", - "//packages/core/plugins/core-plugins-server:build", - "//packages/core/plugins/core-plugins-server-internal:build", - "//packages/core/plugins/core-plugins-server-mocks:build", - "//packages/core/preboot/core-preboot-server:build", - "//packages/core/preboot/core-preboot-server-internal:build", - "//packages/core/preboot/core-preboot-server-mocks:build", - "//packages/core/rendering/core-rendering-browser-internal:build", - "//packages/core/rendering/core-rendering-browser-mocks:build", - "//packages/core/rendering/core-rendering-server-internal:build", - "//packages/core/rendering/core-rendering-server-mocks:build", - "//packages/core/root/core-root-browser-internal:build", - "//packages/core/root/core-root-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-api-browser:build", - "//packages/core/saved-objects/core-saved-objects-api-server:build", - "//packages/core/saved-objects/core-saved-objects-api-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks:build", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks:build", - "//packages/core/saved-objects/core-saved-objects-browser:build", - "//packages/core/saved-objects/core-saved-objects-browser-internal:build", - "//packages/core/saved-objects/core-saved-objects-browser-mocks:build", - "//packages/core/saved-objects/core-saved-objects-common:build", - "//packages/core/saved-objects/core-saved-objects-import-export-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-import-export-server-mocks:build", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-migration-server-mocks:build", - "//packages/core/saved-objects/core-saved-objects-server:build", - "//packages/core/saved-objects/core-saved-objects-server-internal:build", - "//packages/core/saved-objects/core-saved-objects-server-mocks:build", - "//packages/core/saved-objects/core-saved-objects-utils-server:build", - "//packages/core/status/core-status-common:build", - "//packages/core/status/core-status-common-internal:build", - "//packages/core/status/core-status-server:build", - "//packages/core/status/core-status-server-internal:build", - "//packages/core/status/core-status-server-mocks:build", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters:build", - "//packages/core/test-helpers/core-test-helpers-http-setup-browser:build", - "//packages/core/test-helpers/core-test-helpers-kbn-server:build", - "//packages/core/test-helpers/core-test-helpers-so-type-serializer:build", - "//packages/core/test-helpers/core-test-helpers-test-utils:build", - "//packages/core/theme/core-theme-browser:build", - "//packages/core/theme/core-theme-browser-internal:build", - "//packages/core/theme/core-theme-browser-mocks:build", - "//packages/core/ui-settings/core-ui-settings-browser:build", - "//packages/core/ui-settings/core-ui-settings-browser-internal:build", - "//packages/core/ui-settings/core-ui-settings-browser-mocks:build", - "//packages/core/ui-settings/core-ui-settings-common:build", - "//packages/core/ui-settings/core-ui-settings-server:build", - "//packages/core/ui-settings/core-ui-settings-server-internal:build", - "//packages/core/ui-settings/core-ui-settings-server-mocks:build", - "//packages/core/usage-data/core-usage-data-base-server-internal:build", - "//packages/core/usage-data/core-usage-data-server:build", - "//packages/core/usage-data/core-usage-data-server-internal:build", - "//packages/core/usage-data/core-usage-data-server-mocks:build", - "//packages/home/sample_data_card:build", - "//packages/home/sample_data_tab:build", - "//packages/home/sample_data_types:build", - "//packages/kbn-ace:build", - "//packages/kbn-alerts:build", - "//packages/kbn-ambient-common-types:build", - "//packages/kbn-ambient-ftr-types:build", - "//packages/kbn-ambient-storybook-types:build", - "//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", - "//packages/kbn-babel-preset:build", - "//packages/kbn-bazel-packages:build", - "//packages/kbn-bazel-runner:build", - "//packages/kbn-cases-components:build", - "//packages/kbn-chart-icons:build", - "//packages/kbn-ci-stats-core:build", - "//packages/kbn-ci-stats-performance-metrics:build", - "//packages/kbn-ci-stats-reporter:build", - "//packages/kbn-cli-dev-mode:build", - "//packages/kbn-coloring:build", - "//packages/kbn-config:build", - "//packages/kbn-config-mocks:build", - "//packages/kbn-config-schema:build", - "//packages/kbn-crypto:build", - "//packages/kbn-crypto-browser:build", - "//packages/kbn-datemath:build", - "//packages/kbn-dev-cli-errors:build", - "//packages/kbn-dev-cli-runner:build", - "//packages/kbn-dev-proc-runner:build", - "//packages/kbn-dev-utils:build", - "//packages/kbn-doc-links:build", - "//packages/kbn-docs-utils:build", - "//packages/kbn-ebt-tools:build", - "//packages/kbn-ecs:build", - "//packages/kbn-es:build", - "//packages/kbn-es-archiver:build", - "//packages/kbn-es-errors:build", - "//packages/kbn-es-query:build", - "//packages/kbn-es-types:build", - "//packages/kbn-eslint-config:build", - "//packages/kbn-eslint-plugin-disable:build", - "//packages/kbn-eslint-plugin-eslint:build", - "//packages/kbn-eslint-plugin-imports:build", - "//packages/kbn-expect:build", - "//packages/kbn-failed-test-reporter-cli:build", - "//packages/kbn-field-types:build", - "//packages/kbn-find-used-node-modules:build", - "//packages/kbn-flot-charts:build", - "//packages/kbn-ftr-common-functional-services:build", - "//packages/kbn-ftr-screenshot-filename:build", - "//packages/kbn-generate:build", - "//packages/kbn-get-repo-files:build", - "//packages/kbn-guided-onboarding:build", - "//packages/kbn-handlebars:build", - "//packages/kbn-hapi-mocks:build", - "//packages/kbn-health-gateway-server:build", - "//packages/kbn-i18n:build", - "//packages/kbn-i18n-react:build", - "//packages/kbn-import-resolver:build", - "//packages/kbn-interpreter:build", - "//packages/kbn-io-ts-utils:build", - "//packages/kbn-jest-serializers:build", - "//packages/kbn-journeys:build", - "//packages/kbn-kibana-manifest-schema:build", - "//packages/kbn-language-documentation-popover:build", - "//packages/kbn-logging:build", - "//packages/kbn-logging-mocks:build", - "//packages/kbn-managed-vscode-config:build", - "//packages/kbn-managed-vscode-config-cli:build", - "//packages/kbn-mapbox-gl:build", - "//packages/kbn-monaco:build", - "//packages/kbn-optimizer:build", - "//packages/kbn-optimizer-webpack-helpers:build", - "//packages/kbn-osquery-io-ts-types:build", - "//packages/kbn-peggy:build", - "//packages/kbn-peggy-loader:build", - "//packages/kbn-performance-testing-dataset-extractor:build", - "//packages/kbn-plugin-discovery:build", - "//packages/kbn-plugin-generator:build", - "//packages/kbn-plugin-helpers:build", - "//packages/kbn-react-field:build", - "//packages/kbn-repo-source-classifier:build", - "//packages/kbn-repo-source-classifier-cli:build", - "//packages/kbn-rison: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-exception-list-components:build", - "//packages/kbn-securitysolution-hook-utils:build", - "//packages/kbn-securitysolution-io-ts-alerting-types:build", - "//packages/kbn-securitysolution-io-ts-list-types:build", - "//packages/kbn-securitysolution-io-ts-types:build", - "//packages/kbn-securitysolution-io-ts-utils:build", - "//packages/kbn-securitysolution-list-api:build", - "//packages/kbn-securitysolution-list-constants:build", - "//packages/kbn-securitysolution-list-hooks:build", - "//packages/kbn-securitysolution-list-utils:build", - "//packages/kbn-securitysolution-rules:build", - "//packages/kbn-securitysolution-t-grid:build", - "//packages/kbn-securitysolution-utils:build", - "//packages/kbn-server-http-tools:build", - "//packages/kbn-server-route-repository:build", - "//packages/kbn-shared-svg:build", - "//packages/kbn-shared-ux-utility:build", - "//packages/kbn-some-dev-log:build", - "//packages/kbn-sort-package-json:build", - "//packages/kbn-spec-to-console:build", - "//packages/kbn-std:build", - "//packages/kbn-stdio-dev-helpers:build", - "//packages/kbn-storybook:build", - "//packages/kbn-synthetic-package-map:build", - "//packages/kbn-telemetry-tools:build", - "//packages/kbn-test:build", - "//packages/kbn-test-jest-helpers:build", - "//packages/kbn-test-subj-selector:build", - "//packages/kbn-timelion-grammar:build", - "//packages/kbn-tinymath:build", - "//packages/kbn-tooling-log:build", - "//packages/kbn-type-summarizer:build", - "//packages/kbn-type-summarizer-cli:build", - "//packages/kbn-type-summarizer-core:build", - "//packages/kbn-typed-react-router-config:build", - "//packages/kbn-ui-framework:build", - "//packages/kbn-ui-shared-deps-npm:build", - "//packages/kbn-ui-shared-deps-src:build", - "//packages/kbn-ui-theme:build", - "//packages/kbn-user-profile-components:build", - "//packages/kbn-utility-types:build", - "//packages/kbn-utility-types-jest:build", - "//packages/kbn-utils:build", - "//packages/kbn-yarn-lock-validator:build", - "//packages/shared-ux/avatar/solution:build", - "//packages/shared-ux/avatar/user_profile/impl:build", - "//packages/shared-ux/button_toolbar:build", - "//packages/shared-ux/button/exit_full_screen/impl:build", - "//packages/shared-ux/button/exit_full_screen/mocks:build", - "//packages/shared-ux/button/exit_full_screen/types:build", - "//packages/shared-ux/card/no_data/impl:build", - "//packages/shared-ux/card/no_data/mocks:build", - "//packages/shared-ux/card/no_data/types:build", - "//packages/shared-ux/file/context:build", - "//packages/shared-ux/file/file_picker/impl:build", - "//packages/shared-ux/file/file_upload/impl:build", - "//packages/shared-ux/file/image/impl:build", - "//packages/shared-ux/file/image/mocks:build", - "//packages/shared-ux/file/mocks:build", - "//packages/shared-ux/file/types:build", - "//packages/shared-ux/file/util:build", - "//packages/shared-ux/link/redirect_app/impl:build", - "//packages/shared-ux/link/redirect_app/mocks:build", - "//packages/shared-ux/link/redirect_app/types:build", - "//packages/shared-ux/markdown/impl:build", - "//packages/shared-ux/markdown/mocks:build", - "//packages/shared-ux/markdown/types:build", - "//packages/shared-ux/page/analytics_no_data/impl:build", - "//packages/shared-ux/page/analytics_no_data/mocks:build", - "//packages/shared-ux/page/analytics_no_data/types:build", - "//packages/shared-ux/page/kibana_no_data/impl:build", - "//packages/shared-ux/page/kibana_no_data/mocks:build", - "//packages/shared-ux/page/kibana_no_data/types:build", - "//packages/shared-ux/page/kibana_template/impl:build", - "//packages/shared-ux/page/kibana_template/mocks:build", - "//packages/shared-ux/page/kibana_template/types:build", - "//packages/shared-ux/page/no_data_config/impl:build", - "//packages/shared-ux/page/no_data_config/mocks:build", - "//packages/shared-ux/page/no_data_config/types:build", - "//packages/shared-ux/page/no_data/impl:build", - "//packages/shared-ux/page/no_data/mocks:build", - "//packages/shared-ux/page/no_data/types:build", - "//packages/shared-ux/page/solution_nav:build", - "//packages/shared-ux/prompt/no_data_views/impl:build", - "//packages/shared-ux/prompt/no_data_views/mocks:build", - "//packages/shared-ux/prompt/no_data_views/types:build", - "//packages/shared-ux/prompt/not_found:build", - "//packages/shared-ux/router/impl:build", - "//packages/shared-ux/router/mocks:build", - "//packages/shared-ux/router/types:build", - "//packages/shared-ux/storybook/config:build", - "//packages/shared-ux/storybook/mock:build", - "//x-pack/packages/ml/agg_utils:build", - "//x-pack/packages/ml/aiops_components:build", - "//x-pack/packages/ml/aiops_utils:build", - "//x-pack/packages/ml/is_populated_object:build", - "//x-pack/packages/ml/string_hash:build", - ], -) - -# It will build all declared package types -filegroup( - name = "build_pkg_types", - srcs = [ - "//packages/analytics/client:build_types", - "//packages/analytics/shippers/elastic_v3/browser:build_types", - "//packages/analytics/shippers/elastic_v3/common:build_types", - "//packages/analytics/shippers/elastic_v3/server:build_types", - "//packages/analytics/shippers/fullstory:build_types", - "//packages/analytics/shippers/gainsight:build_types", - "//packages/content-management/content_editor:build_types", - "//packages/content-management/table_list:build_types", - "//packages/core/analytics/core-analytics-browser:build_types", - "//packages/core/analytics/core-analytics-browser-internal:build_types", - "//packages/core/analytics/core-analytics-browser-mocks:build_types", - "//packages/core/analytics/core-analytics-server:build_types", - "//packages/core/analytics/core-analytics-server-internal:build_types", - "//packages/core/analytics/core-analytics-server-mocks:build_types", - "//packages/core/application/core-application-browser:build_types", - "//packages/core/application/core-application-browser-internal:build_types", - "//packages/core/application/core-application-browser-mocks:build_types", - "//packages/core/application/core-application-common:build_types", - "//packages/core/apps/core-apps-browser-internal:build_types", - "//packages/core/apps/core-apps-browser-mocks:build_types", - "//packages/core/apps/core-apps-server-internal:build_types", - "//packages/core/base/core-base-browser-internal:build_types", - "//packages/core/base/core-base-browser-mocks:build_types", - "//packages/core/base/core-base-common:build_types", - "//packages/core/base/core-base-common-internal:build_types", - "//packages/core/base/core-base-server-internal:build_types", - "//packages/core/base/core-base-server-mocks:build_types", - "//packages/core/capabilities/core-capabilities-browser-internal:build_types", - "//packages/core/capabilities/core-capabilities-browser-mocks:build_types", - "//packages/core/capabilities/core-capabilities-common:build_types", - "//packages/core/capabilities/core-capabilities-server:build_types", - "//packages/core/capabilities/core-capabilities-server-internal:build_types", - "//packages/core/capabilities/core-capabilities-server-mocks:build_types", - "//packages/core/chrome/core-chrome-browser:build_types", - "//packages/core/chrome/core-chrome-browser-internal:build_types", - "//packages/core/chrome/core-chrome-browser-mocks:build_types", - "//packages/core/config/core-config-server-internal:build_types", - "//packages/core/deprecations/core-deprecations-browser:build_types", - "//packages/core/deprecations/core-deprecations-browser-internal:build_types", - "//packages/core/deprecations/core-deprecations-browser-mocks:build_types", - "//packages/core/deprecations/core-deprecations-common:build_types", - "//packages/core/deprecations/core-deprecations-server:build_types", - "//packages/core/deprecations/core-deprecations-server-internal:build_types", - "//packages/core/deprecations/core-deprecations-server-mocks:build_types", - "//packages/core/doc-links/core-doc-links-browser:build_types", - "//packages/core/doc-links/core-doc-links-browser-internal:build_types", - "//packages/core/doc-links/core-doc-links-browser-mocks:build_types", - "//packages/core/doc-links/core-doc-links-server:build_types", - "//packages/core/doc-links/core-doc-links-server-internal:build_types", - "//packages/core/doc-links/core-doc-links-server-mocks:build_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:build_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:build_types", - "//packages/core/elasticsearch/core-elasticsearch-server:build_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:build_types", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks:build_types", - "//packages/core/environment/core-environment-server-internal:build_types", - "//packages/core/environment/core-environment-server-mocks:build_types", - "//packages/core/execution-context/core-execution-context-browser:build_types", - "//packages/core/execution-context/core-execution-context-browser-internal:build_types", - "//packages/core/execution-context/core-execution-context-browser-mocks:build_types", - "//packages/core/execution-context/core-execution-context-common:build_types", - "//packages/core/execution-context/core-execution-context-server:build_types", - "//packages/core/execution-context/core-execution-context-server-internal:build_types", - "//packages/core/execution-context/core-execution-context-server-mocks:build_types", - "//packages/core/fatal-errors/core-fatal-errors-browser:build_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal:build_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks:build_types", - "//packages/core/http/core-http-browser:build_types", - "//packages/core/http/core-http-browser-internal:build_types", - "//packages/core/http/core-http-browser-mocks:build_types", - "//packages/core/http/core-http-common:build_types", - "//packages/core/http/core-http-context-server-internal:build_types", - "//packages/core/http/core-http-context-server-mocks:build_types", - "//packages/core/http/core-http-request-handler-context-server:build_types", - "//packages/core/http/core-http-request-handler-context-server-internal:build_types", - "//packages/core/http/core-http-resources-server:build_types", - "//packages/core/http/core-http-resources-server-internal:build_types", - "//packages/core/http/core-http-resources-server-mocks:build_types", - "//packages/core/http/core-http-router-server-internal:build_types", - "//packages/core/http/core-http-router-server-mocks:build_types", - "//packages/core/http/core-http-server:build_types", - "//packages/core/http/core-http-server-internal:build_types", - "//packages/core/http/core-http-server-mocks:build_types", - "//packages/core/i18n/core-i18n-browser:build_types", - "//packages/core/i18n/core-i18n-browser-internal:build_types", - "//packages/core/i18n/core-i18n-browser-mocks:build_types", - "//packages/core/i18n/core-i18n-server:build_types", - "//packages/core/i18n/core-i18n-server-internal:build_types", - "//packages/core/i18n/core-i18n-server-mocks:build_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:build_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:build_types", - "//packages/core/injected-metadata/core-injected-metadata-common-internal:build_types", - "//packages/core/integrations/core-integrations-browser-internal:build_types", - "//packages/core/integrations/core-integrations-browser-mocks:build_types", - "//packages/core/lifecycle/core-lifecycle-browser:build_types", - "//packages/core/lifecycle/core-lifecycle-browser-internal:build_types", - "//packages/core/lifecycle/core-lifecycle-browser-mocks:build_types", - "//packages/core/lifecycle/core-lifecycle-server:build_types", - "//packages/core/lifecycle/core-lifecycle-server-internal:build_types", - "//packages/core/lifecycle/core-lifecycle-server-mocks:build_types", - "//packages/core/logging/core-logging-browser-internal:build_types", - "//packages/core/logging/core-logging-browser-mocks:build_types", - "//packages/core/logging/core-logging-common-internal:build_types", - "//packages/core/logging/core-logging-server:build_types", - "//packages/core/logging/core-logging-server-internal:build_types", - "//packages/core/logging/core-logging-server-mocks:build_types", - "//packages/core/metrics/core-metrics-collectors-server-internal:build_types", - "//packages/core/metrics/core-metrics-collectors-server-mocks:build_types", - "//packages/core/metrics/core-metrics-server:build_types", - "//packages/core/metrics/core-metrics-server-internal:build_types", - "//packages/core/metrics/core-metrics-server-mocks:build_types", - "//packages/core/mount-utils/core-mount-utils-browser:build_types", - "//packages/core/mount-utils/core-mount-utils-browser-internal:build_types", - "//packages/core/node/core-node-server:build_types", - "//packages/core/node/core-node-server-internal:build_types", - "//packages/core/node/core-node-server-mocks:build_types", - "//packages/core/notifications/core-notifications-browser:build_types", - "//packages/core/notifications/core-notifications-browser-internal:build_types", - "//packages/core/notifications/core-notifications-browser-mocks:build_types", - "//packages/core/overlays/core-overlays-browser:build_types", - "//packages/core/overlays/core-overlays-browser-internal:build_types", - "//packages/core/overlays/core-overlays-browser-mocks:build_types", - "//packages/core/plugins/core-plugins-base-server-internal:build_types", - "//packages/core/plugins/core-plugins-browser:build_types", - "//packages/core/plugins/core-plugins-browser-internal:build_types", - "//packages/core/plugins/core-plugins-browser-mocks:build_types", - "//packages/core/plugins/core-plugins-server:build_types", - "//packages/core/plugins/core-plugins-server-internal:build_types", - "//packages/core/plugins/core-plugins-server-mocks:build_types", - "//packages/core/preboot/core-preboot-server:build_types", - "//packages/core/preboot/core-preboot-server-internal:build_types", - "//packages/core/preboot/core-preboot-server-mocks:build_types", - "//packages/core/rendering/core-rendering-browser-internal:build_types", - "//packages/core/rendering/core-rendering-browser-mocks:build_types", - "//packages/core/rendering/core-rendering-server-internal:build_types", - "//packages/core/rendering/core-rendering-server-mocks:build_types", - "//packages/core/root/core-root-browser-internal:build_types", - "//packages/core/root/core-root-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-api-browser:build_types", - "//packages/core/saved-objects/core-saved-objects-api-server:build_types", - "//packages/core/saved-objects/core-saved-objects-api-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-browser:build_types", - "//packages/core/saved-objects/core-saved-objects-browser-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-browser-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-common:build_types", - "//packages/core/saved-objects/core-saved-objects-import-export-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-import-export-server-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-migration-server-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-server:build_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:build_types", - "//packages/core/saved-objects/core-saved-objects-server-mocks:build_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:build_types", - "//packages/core/status/core-status-common:build_types", - "//packages/core/status/core-status-common-internal:build_types", - "//packages/core/status/core-status-server:build_types", - "//packages/core/status/core-status-server-internal:build_types", - "//packages/core/status/core-status-server-mocks:build_types", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters:build_types", - "//packages/core/test-helpers/core-test-helpers-http-setup-browser:build_types", - "//packages/core/test-helpers/core-test-helpers-kbn-server:build_types", - "//packages/core/test-helpers/core-test-helpers-so-type-serializer:build_types", - "//packages/core/test-helpers/core-test-helpers-test-utils:build_types", - "//packages/core/theme/core-theme-browser:build_types", - "//packages/core/theme/core-theme-browser-internal:build_types", - "//packages/core/theme/core-theme-browser-mocks:build_types", - "//packages/core/ui-settings/core-ui-settings-browser:build_types", - "//packages/core/ui-settings/core-ui-settings-browser-internal:build_types", - "//packages/core/ui-settings/core-ui-settings-browser-mocks:build_types", - "//packages/core/ui-settings/core-ui-settings-common:build_types", - "//packages/core/ui-settings/core-ui-settings-server:build_types", - "//packages/core/ui-settings/core-ui-settings-server-internal:build_types", - "//packages/core/ui-settings/core-ui-settings-server-mocks:build_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:build_types", - "//packages/core/usage-data/core-usage-data-server:build_types", - "//packages/core/usage-data/core-usage-data-server-internal:build_types", - "//packages/core/usage-data/core-usage-data-server-mocks: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", - "//packages/kbn-bazel-runner:build_types", - "//packages/kbn-cases-components:build_types", - "//packages/kbn-chart-icons:build_types", - "//packages/kbn-ci-stats-core:build_types", - "//packages/kbn-ci-stats-performance-metrics:build_types", - "//packages/kbn-ci-stats-reporter:build_types", - "//packages/kbn-cli-dev-mode:build_types", - "//packages/kbn-coloring:build_types", - "//packages/kbn-config:build_types", - "//packages/kbn-config-mocks:build_types", - "//packages/kbn-config-schema:build_types", - "//packages/kbn-crypto:build_types", - "//packages/kbn-crypto-browser:build_types", - "//packages/kbn-datemath:build_types", - "//packages/kbn-dev-cli-errors:build_types", - "//packages/kbn-dev-cli-runner:build_types", - "//packages/kbn-dev-proc-runner:build_types", - "//packages/kbn-dev-utils:build_types", - "//packages/kbn-doc-links:build_types", - "//packages/kbn-docs-utils:build_types", - "//packages/kbn-ebt-tools:build_types", - "//packages/kbn-ecs:build_types", - "//packages/kbn-es-archiver:build_types", - "//packages/kbn-es-errors:build_types", - "//packages/kbn-es-query:build_types", - "//packages/kbn-es-types:build_types", - "//packages/kbn-eslint-plugin-disable:build_types", - "//packages/kbn-eslint-plugin-imports:build_types", - "//packages/kbn-failed-test-reporter-cli:build_types", - "//packages/kbn-field-types:build_types", - "//packages/kbn-find-used-node-modules:build_types", - "//packages/kbn-ftr-common-functional-services:build_types", - "//packages/kbn-ftr-screenshot-filename:build_types", - "//packages/kbn-generate:build_types", - "//packages/kbn-get-repo-files:build_types", - "//packages/kbn-guided-onboarding:build_types", - "//packages/kbn-handlebars:build_types", - "//packages/kbn-hapi-mocks:build_types", - "//packages/kbn-health-gateway-server:build_types", - "//packages/kbn-i18n:build_types", - "//packages/kbn-i18n-react:build_types", - "//packages/kbn-import-resolver:build_types", - "//packages/kbn-interpreter:build_types", - "//packages/kbn-io-ts-utils:build_types", - "//packages/kbn-jest-serializers:build_types", - "//packages/kbn-journeys:build_types", - "//packages/kbn-kibana-manifest-schema:build_types", - "//packages/kbn-language-documentation-popover:build_types", - "//packages/kbn-logging:build_types", - "//packages/kbn-logging-mocks:build_types", - "//packages/kbn-managed-vscode-config:build_types", - "//packages/kbn-managed-vscode-config-cli:build_types", - "//packages/kbn-mapbox-gl:build_types", - "//packages/kbn-monaco:build_types", - "//packages/kbn-optimizer:build_types", - "//packages/kbn-optimizer-webpack-helpers:build_types", - "//packages/kbn-osquery-io-ts-types:build_types", - "//packages/kbn-peggy:build_types", - "//packages/kbn-peggy-loader:build_types", - "//packages/kbn-performance-testing-dataset-extractor:build_types", - "//packages/kbn-plugin-discovery:build_types", - "//packages/kbn-plugin-generator:build_types", - "//packages/kbn-plugin-helpers:build_types", - "//packages/kbn-react-field:build_types", - "//packages/kbn-repo-source-classifier:build_types", - "//packages/kbn-repo-source-classifier-cli:build_types", - "//packages/kbn-rison: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-exception-list-components:build_types", - "//packages/kbn-securitysolution-hook-utils:build_types", - "//packages/kbn-securitysolution-io-ts-alerting-types:build_types", - "//packages/kbn-securitysolution-io-ts-list-types:build_types", - "//packages/kbn-securitysolution-io-ts-types:build_types", - "//packages/kbn-securitysolution-io-ts-utils:build_types", - "//packages/kbn-securitysolution-list-api:build_types", - "//packages/kbn-securitysolution-list-constants:build_types", - "//packages/kbn-securitysolution-list-hooks:build_types", - "//packages/kbn-securitysolution-list-utils:build_types", - "//packages/kbn-securitysolution-rules:build_types", - "//packages/kbn-securitysolution-t-grid:build_types", - "//packages/kbn-securitysolution-utils:build_types", - "//packages/kbn-server-http-tools:build_types", - "//packages/kbn-server-route-repository:build_types", - "//packages/kbn-shared-svg:build_types", - "//packages/kbn-shared-ux-utility:build_types", - "//packages/kbn-some-dev-log:build_types", - "//packages/kbn-sort-package-json:build_types", - "//packages/kbn-std:build_types", - "//packages/kbn-stdio-dev-helpers:build_types", - "//packages/kbn-storybook:build_types", - "//packages/kbn-telemetry-tools:build_types", - "//packages/kbn-test:build_types", - "//packages/kbn-test-jest-helpers:build_types", - "//packages/kbn-test-subj-selector:build_types", - "//packages/kbn-tooling-log:build_types", - "//packages/kbn-type-summarizer:build_types", - "//packages/kbn-type-summarizer-cli:build_types", - "//packages/kbn-type-summarizer-core:build_types", - "//packages/kbn-typed-react-router-config:build_types", - "//packages/kbn-ui-shared-deps-npm:build_types", - "//packages/kbn-ui-shared-deps-src:build_types", - "//packages/kbn-ui-theme:build_types", - "//packages/kbn-user-profile-components:build_types", - "//packages/kbn-utility-types:build_types", - "//packages/kbn-utility-types-jest:build_types", - "//packages/kbn-utils:build_types", - "//packages/kbn-yarn-lock-validator:build_types", - "//packages/shared-ux/avatar/solution:build_types", - "//packages/shared-ux/avatar/user_profile/impl:build_types", - "//packages/shared-ux/button_toolbar:build_types", - "//packages/shared-ux/button/exit_full_screen/impl:build_types", - "//packages/shared-ux/button/exit_full_screen/mocks:build_types", - "//packages/shared-ux/card/no_data/impl:build_types", - "//packages/shared-ux/card/no_data/mocks:build_types", - "//packages/shared-ux/file/context:build_types", - "//packages/shared-ux/file/file_picker/impl:build_types", - "//packages/shared-ux/file/file_upload/impl:build_types", - "//packages/shared-ux/file/image/impl:build_types", - "//packages/shared-ux/file/image/mocks:build_types", - "//packages/shared-ux/file/mocks:build_types", - "//packages/shared-ux/file/util:build_types", - "//packages/shared-ux/link/redirect_app/impl:build_types", - "//packages/shared-ux/link/redirect_app/mocks:build_types", - "//packages/shared-ux/markdown/impl:build_types", - "//packages/shared-ux/markdown/mocks:build_types", - "//packages/shared-ux/markdown/types:build_types", - "//packages/shared-ux/page/analytics_no_data/impl:build_types", - "//packages/shared-ux/page/analytics_no_data/mocks:build_types", - "//packages/shared-ux/page/kibana_no_data/impl:build_types", - "//packages/shared-ux/page/kibana_no_data/mocks:build_types", - "//packages/shared-ux/page/kibana_template/impl:build_types", - "//packages/shared-ux/page/kibana_template/mocks:build_types", - "//packages/shared-ux/page/no_data_config/impl:build_types", - "//packages/shared-ux/page/no_data_config/mocks:build_types", - "//packages/shared-ux/page/no_data/impl:build_types", - "//packages/shared-ux/page/no_data/mocks:build_types", - "//packages/shared-ux/page/solution_nav:build_types", - "//packages/shared-ux/prompt/no_data_views/impl:build_types", - "//packages/shared-ux/prompt/no_data_views/mocks:build_types", - "//packages/shared-ux/prompt/not_found:build_types", - "//packages/shared-ux/router/impl:build_types", - "//packages/shared-ux/router/mocks:build_types", - "//packages/shared-ux/storybook/config:build_types", - "//packages/shared-ux/storybook/mock:build_types", - "//x-pack/packages/ml/agg_utils:build_types", - "//x-pack/packages/ml/aiops_components:build_types", - "//x-pack/packages/ml/aiops_utils:build_types", - "//x-pack/packages/ml/is_populated_object:build_types", - "//x-pack/packages/ml/string_hash:build_types", - ], -) - -# Grouping target to call all underlying packages js builds -filegroup( - name = "build", - srcs = [ - ":build_pkg_code" - ], -) - -# Grouping target to call all underlying packages ts builds -filegroup( - name = "build_types", - srcs = [ - ":build_pkg_types" - ], -) diff --git a/packages/analytics/client/BUILD.bazel b/packages/analytics/client/BUILD.bazel deleted file mode 100644 index cc9cf69242b8..000000000000 --- a/packages/analytics/client/BUILD.bazel +++ /dev/null @@ -1,137 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "client" -PKG_REQUIRE_NAME = "@kbn/analytics-client" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//fp-ts", - "@npm//io-ts", - "@npm//rxjs", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//rxjs", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/client/kibana.jsonc b/packages/analytics/client/kibana.jsonc index 5f5aa11feb99..a027e7ee866b 100644 --- a/packages/analytics/client/kibana.jsonc +++ b/packages/analytics/client/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics-client", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/client/package.json b/packages/analytics/client/package.json index 247d642adf6d..6db911a1bac8 100644 --- a/packages/analytics/client/package.json +++ b/packages/analytics/client/package.json @@ -2,9 +2,6 @@ "name": "@kbn/analytics-client", "private": true, "version": "1.0.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/client/tsconfig.json b/packages/analytics/client/tsconfig.json index cc7ee1b2ebd6..b5bb1c1f7c01 100644 --- a/packages/analytics/client/tsconfig.json +++ b/packages/analytics/client/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/logging-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel b/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel deleted file mode 100644 index 790079da9d8f..000000000000 --- a/packages/analytics/shippers/elastic_v3/browser/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "browser" -PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/analytics/client", - "//packages/analytics/shippers/elastic_v3/common", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/analytics/client:npm_module_types", - "//packages/analytics/shippers/elastic_v3/common:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/shippers/elastic_v3/browser/kibana.jsonc b/packages/analytics/shippers/elastic_v3/browser/kibana.jsonc index cefab4152c99..a54bd23df252 100644 --- a/packages/analytics/shippers/elastic_v3/browser/kibana.jsonc +++ b/packages/analytics/shippers/elastic_v3/browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics-shippers-elastic-v3-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/shippers/elastic_v3/browser/package.json b/packages/analytics/shippers/elastic_v3/browser/package.json index 59c2e7e9fa5b..88d42d1fd184 100644 --- a/packages/analytics/shippers/elastic_v3/browser/package.json +++ b/packages/analytics/shippers/elastic_v3/browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/analytics-shippers-elastic-v3-browser", "private": true, "version": "1.0.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/shippers/elastic_v3/browser/tsconfig.json b/packages/analytics/shippers/elastic_v3/browser/tsconfig.json index 6d893e10d8cc..7808dee7058f 100644 --- a/packages/analytics/shippers/elastic_v3/browser/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/analytics-shippers-elastic-v3-common", + "@kbn/logging-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/analytics/shippers/elastic_v3/common/BUILD.bazel b/packages/analytics/shippers/elastic_v3/common/BUILD.bazel deleted file mode 100644 index bb38300b9730..000000000000 --- a/packages/analytics/shippers/elastic_v3/common/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "common" -PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/analytics/client:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/shippers/elastic_v3/common/kibana.jsonc b/packages/analytics/shippers/elastic_v3/common/kibana.jsonc index c347233693ff..30c723c2b521 100644 --- a/packages/analytics/shippers/elastic_v3/common/kibana.jsonc +++ b/packages/analytics/shippers/elastic_v3/common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics-shippers-elastic-v3-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/shippers/elastic_v3/common/package.json b/packages/analytics/shippers/elastic_v3/common/package.json index 9e9c8f305409..4e1caaf0d6a2 100644 --- a/packages/analytics/shippers/elastic_v3/common/package.json +++ b/packages/analytics/shippers/elastic_v3/common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/analytics-shippers-elastic-v3-common", "private": true, "version": "1.0.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/shippers/elastic_v3/common/tsconfig.json b/packages/analytics/shippers/elastic_v3/common/tsconfig.json index 6d893e10d8cc..698191a0c381 100644 --- a/packages/analytics/shippers/elastic_v3/common/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/analytics/shippers/elastic_v3/server/BUILD.bazel b/packages/analytics/shippers/elastic_v3/server/BUILD.bazel deleted file mode 100644 index 8f78c9a9c1a7..000000000000 --- a/packages/analytics/shippers/elastic_v3/server/BUILD.bazel +++ /dev/null @@ -1,131 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "server" -PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//node-fetch", - "@npm//rxjs", - "//packages/analytics/client", - "//packages/analytics/shippers/elastic_v3/common", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/node-fetch", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/analytics/client:npm_module_types", - "//packages/analytics/shippers/elastic_v3/common:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/shippers/elastic_v3/server/kibana.jsonc b/packages/analytics/shippers/elastic_v3/server/kibana.jsonc index 11c29924f3c2..a516db1bbf30 100644 --- a/packages/analytics/shippers/elastic_v3/server/kibana.jsonc +++ b/packages/analytics/shippers/elastic_v3/server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics-shippers-elastic-v3-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/shippers/elastic_v3/server/package.json b/packages/analytics/shippers/elastic_v3/server/package.json index 9b05193e3aec..3fcbd5062d35 100644 --- a/packages/analytics/shippers/elastic_v3/server/package.json +++ b/packages/analytics/shippers/elastic_v3/server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/analytics-shippers-elastic-v3-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/shippers/elastic_v3/server/tsconfig.json b/packages/analytics/shippers/elastic_v3/server/tsconfig.json index 6d893e10d8cc..7808dee7058f 100644 --- a/packages/analytics/shippers/elastic_v3/server/tsconfig.json +++ b/packages/analytics/shippers/elastic_v3/server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/analytics-shippers-elastic-v3-common", + "@kbn/logging-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/analytics/shippers/fullstory/BUILD.bazel b/packages/analytics/shippers/fullstory/BUILD.bazel deleted file mode 100644 index b949d085e5d8..000000000000 --- a/packages/analytics/shippers/fullstory/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "fullstory" -PKG_REQUIRE_NAME = "@kbn/analytics-shippers-fullstory" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//moment", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "//packages/analytics/client:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/shippers/fullstory/kibana.jsonc b/packages/analytics/shippers/fullstory/kibana.jsonc index 5d8720fa7486..d2848e7b3c45 100644 --- a/packages/analytics/shippers/fullstory/kibana.jsonc +++ b/packages/analytics/shippers/fullstory/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics-shippers-fullstory", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/shippers/fullstory/package.json b/packages/analytics/shippers/fullstory/package.json index 8b8f09163ceb..4eca1476236a 100644 --- a/packages/analytics/shippers/fullstory/package.json +++ b/packages/analytics/shippers/fullstory/package.json @@ -2,9 +2,6 @@ "name": "@kbn/analytics-shippers-fullstory", "private": true, "version": "1.0.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/shippers/fullstory/tsconfig.json b/packages/analytics/shippers/fullstory/tsconfig.json index ef521586433c..f3b62b9be125 100644 --- a/packages/analytics/shippers/fullstory/tsconfig.json +++ b/packages/analytics/shippers/fullstory/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/logging-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/analytics/shippers/gainsight/BUILD.bazel b/packages/analytics/shippers/gainsight/BUILD.bazel deleted file mode 100644 index 12a1890e8add..000000000000 --- a/packages/analytics/shippers/gainsight/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "gainsight" -PKG_REQUIRE_NAME = "@kbn/analytics-shippers-gainsight" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//moment", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "//packages/analytics/client:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/analytics/shippers/gainsight/kibana.jsonc b/packages/analytics/shippers/gainsight/kibana.jsonc index bd490542f9dd..3731f34d34ad 100644 --- a/packages/analytics/shippers/gainsight/kibana.jsonc +++ b/packages/analytics/shippers/gainsight/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-browser", "id": "@kbn/analytics-shippers-gainsight", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/analytics/shippers/gainsight/package.json b/packages/analytics/shippers/gainsight/package.json index bd15dac62c11..8b68459c29bf 100644 --- a/packages/analytics/shippers/gainsight/package.json +++ b/packages/analytics/shippers/gainsight/package.json @@ -2,9 +2,6 @@ "name": "@kbn/analytics-shippers-gainsight", "private": true, "version": "1.0.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/analytics/shippers/gainsight/tsconfig.json b/packages/analytics/shippers/gainsight/tsconfig.json index ef521586433c..f3b62b9be125 100644 --- a/packages/analytics/shippers/gainsight/tsconfig.json +++ b/packages/analytics/shippers/gainsight/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/logging-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/content-management/content_editor/BUILD.bazel b/packages/content-management/content_editor/BUILD.bazel deleted file mode 100644 index 4239f1b51466..000000000000 --- a/packages/content-management/content_editor/BUILD.bazel +++ /dev/null @@ -1,149 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "content_editor" -PKG_REQUIRE_NAME = "@kbn/content-management-content-editor" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/core/mount-utils/core-mount-utils-browser", - "//packages/core/overlays/core-overlays-browser", - "@npm//@elastic/eui", - "@npm//@emotion/react", - "@npm//react", - "@npm//@emotion/css" -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-ambient-storybook-types", - "//packages/kbn-ambient-ui-types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@elastic/eui", - "@npm//rxjs" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/content-management/content_editor/kibana.jsonc b/packages/content-management/content_editor/kibana.jsonc index c462cd7103cb..ebb0d3e59f63 100644 --- a/packages/content-management/content_editor/kibana.jsonc +++ b/packages/content-management/content_editor/kibana.jsonc @@ -2,6 +2,4 @@ "type": "shared-common", "id": "@kbn/content-management-content-editor", "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [], } diff --git a/packages/content-management/content_editor/package.json b/packages/content-management/content_editor/package.json index 7f09d1faa2f8..fb804da89fef 100644 --- a/packages/content-management/content_editor/package.json +++ b/packages/content-management/content_editor/package.json @@ -2,8 +2,5 @@ "name": "@kbn/content-management-content-editor", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/content-management/content_editor/tsconfig.json b/packages/content-management/content_editor/tsconfig.json index 695a24957687..c5ee5594be9f 100644 --- a/packages/content-management/content_editor/tsconfig.json +++ b/packages/content-management/content_editor/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", + "jsx": "react", + "esModuleInterop": true, "types": [ "jest", "node", @@ -16,5 +16,15 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-mount-utils-browser", + "@kbn/core-overlays-browser", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/content-management/table_list/BUILD.bazel b/packages/content-management/table_list/BUILD.bazel deleted file mode 100644 index b8758eb21314..000000000000 --- a/packages/content-management/table_list/BUILD.bazel +++ /dev/null @@ -1,164 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "table_list" -PKG_REQUIRE_NAME = "@kbn/content-management-table-list" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/content-management/content_editor", - "//packages/core/http/core-http-browser", - "//packages/core/theme/core-theme-browser", - "//packages/kbn-safer-lodash-set", - "//packages/shared-ux/page/kibana_template/impl", - "@npm//@elastic/eui", - "@npm//@emotion/react", - "@npm//@emotion/css", - "@npm//lodash", - "@npm//moment", - "@npm//react-use", - "@npm//react", - "@npm//rxjs", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/content-management/content_editor:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/kbn-ambient-storybook-types", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/shared-ux/page/kibana_template/impl:npm_module_types", - "//packages/shared-ux/page/kibana_template/types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/react", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@elastic/eui", - "@npm//react-use", - "@npm//rxjs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/content-management/table_list/kibana.jsonc b/packages/content-management/table_list/kibana.jsonc index 080819563987..1837c97e9d2a 100644 --- a/packages/content-management/table_list/kibana.jsonc +++ b/packages/content-management/table_list/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/content-management-table-list", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/content-management/table_list/package.json b/packages/content-management/table_list/package.json index 2df98754b022..b387c8a466b5 100644 --- a/packages/content-management/table_list/package.json +++ b/packages/content-management/table_list/package.json @@ -2,8 +2,5 @@ "name": "@kbn/content-management-table-list", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/content-management/table_list/tsconfig.json b/packages/content-management/table_list/tsconfig.json index 695a24957687..16a8a6b1a6de 100644 --- a/packages/content-management/table_list/tsconfig.json +++ b/packages/content-management/table_list/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -16,5 +14,19 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/content-management-content-editor", + "@kbn/core-http-browser", + "@kbn/core-mount-utils-browser", + "@kbn/core-overlays-browser", + "@kbn/shared-ux-page-kibana-template", + "@kbn/shared-ux-link-redirect-app", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel b/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel deleted file mode 100644 index 3413eaf4fdda..000000000000 --- a/packages/core/analytics/core-analytics-browser-internal/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-analytics-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//uuid", - "//packages/analytics/client", - "//packages/kbn-ebt-tools", - "//packages/core/base/core-base-browser-mocks", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//rxjs", - "//packages/kbn-logging:npm_module_types", - "//packages/analytics/client:npm_module_types", - "//packages/kbn-ebt-tools:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/analytics/core-analytics-browser:npm_module_types", - "//packages/core/base/core-base-browser-mocks:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-browser-internal/kibana.jsonc b/packages/core/analytics/core-analytics-browser-internal/kibana.jsonc index 45bd5d5bc041..459e71b2c0e5 100644 --- a/packages/core/analytics/core-analytics-browser-internal/kibana.jsonc +++ b/packages/core/analytics/core-analytics-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-browser-internal/package.json b/packages/core/analytics/core-analytics-browser-internal/package.json index f40589e37d19..cf034acaaa1e 100644 --- a/packages/core/analytics/core-analytics-browser-internal/package.json +++ b/packages/core/analytics/core-analytics-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-analytics-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-browser-internal/tsconfig.json b/packages/core/analytics/core-analytics-browser-internal/tsconfig.json index ef521586433c..4c2daa18d079 100644 --- a/packages/core/analytics/core-analytics-browser-internal/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/analytics-client", + "@kbn/ebt-tools", + "@kbn/core-base-browser-internal", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-analytics-browser", + "@kbn/core-base-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel b/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel deleted file mode 100644 index d80d2a8feae2..000000000000 --- a/packages/core/analytics/core-analytics-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-analytics-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/analytics/core-analytics-browser:npm_module_types", - "//packages/core/analytics/core-analytics-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-browser-mocks/kibana.jsonc b/packages/core/analytics/core-analytics-browser-mocks/kibana.jsonc index 2c3ce58f95d6..93bbc23fbbb7 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/kibana.jsonc +++ b/packages/core/analytics/core-analytics-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-browser-mocks/package.json b/packages/core/analytics/core-analytics-browser-mocks/package.json index b8dd2d03bad6..fefe7e0c5f04 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/package.json +++ b/packages/core/analytics/core-analytics-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-analytics-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json b/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json index ef521586433c..6a1a1a6244c7 100644 --- a/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-analytics-browser", + "@kbn/core-analytics-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-browser/BUILD.bazel b/packages/core/analytics/core-analytics-browser/BUILD.bazel deleted file mode 100644 index 2dbf3c4791bb..000000000000 --- a/packages/core/analytics/core-analytics-browser/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-browser" -PKG_REQUIRE_NAME = "@kbn/core-analytics-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/analytics/client:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-browser/kibana.jsonc b/packages/core/analytics/core-analytics-browser/kibana.jsonc index a17a1e5d5e94..a82e9d1c78f3 100644 --- a/packages/core/analytics/core-analytics-browser/kibana.jsonc +++ b/packages/core/analytics/core-analytics-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-browser/package.json b/packages/core/analytics/core-analytics-browser/package.json index 4ef1d65780ab..1df304c1fb38 100644 --- a/packages/core/analytics/core-analytics-browser/package.json +++ b/packages/core/analytics/core-analytics-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-analytics-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-browser/tsconfig.json b/packages/core/analytics/core-analytics-browser/tsconfig.json index ef521586433c..9c3a721a57e2 100644 --- a/packages/core/analytics/core-analytics-browser/tsconfig.json +++ b/packages/core/analytics/core-analytics-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-server-internal/BUILD.bazel b/packages/core/analytics/core-analytics-server-internal/BUILD.bazel deleted file mode 100644 index 1a507d0a065c..000000000000 --- a/packages/core/analytics/core-analytics-server-internal/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-analytics-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/analytics/client", - "//packages/kbn-ebt-tools", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/analytics/client:npm_module_types", - "//packages/kbn-ebt-tools:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-server-internal/kibana.jsonc b/packages/core/analytics/core-analytics-server-internal/kibana.jsonc index 1ae2d06e0fa7..3d660a39be14 100644 --- a/packages/core/analytics/core-analytics-server-internal/kibana.jsonc +++ b/packages/core/analytics/core-analytics-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-server-internal/package.json b/packages/core/analytics/core-analytics-server-internal/package.json index 742c092fa58f..142cc8ffa98d 100644 --- a/packages/core/analytics/core-analytics-server-internal/package.json +++ b/packages/core/analytics/core-analytics-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-analytics-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts b/packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts index 3d98cf439292..a3bd814f1e32 100644 --- a/packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts +++ b/packages/core/analytics/core-analytics-server-internal/src/analytics_service.test.mocks.ts @@ -18,6 +18,7 @@ export const analyticsClientMock: jest.Mocked = { registerShipper: jest.fn(), telemetryCounter$: new Subject(), shutdown: jest.fn(), + flush: jest.fn(), }; jest.doMock('@kbn/analytics-client', () => ({ diff --git a/packages/core/analytics/core-analytics-server-internal/tsconfig.json b/packages/core/analytics/core-analytics-server-internal/tsconfig.json index ef521586433c..56292065f7af 100644 --- a/packages/core/analytics/core-analytics-server-internal/tsconfig.json +++ b/packages/core/analytics/core-analytics-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/ebt-tools", + "@kbn/core-base-server-internal", + "@kbn/core-analytics-server", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel b/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel deleted file mode 100644 index cfcf0175d52d..000000000000 --- a/packages/core/analytics/core-analytics-server-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-analytics-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/analytics/core-analytics-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-server-mocks/kibana.jsonc b/packages/core/analytics/core-analytics-server-mocks/kibana.jsonc index 9c49235144c4..319fec0506fe 100644 --- a/packages/core/analytics/core-analytics-server-mocks/kibana.jsonc +++ b/packages/core/analytics/core-analytics-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-server-mocks/package.json b/packages/core/analytics/core-analytics-server-mocks/package.json index 864715f79524..90a3c4fa6be2 100644 --- a/packages/core/analytics/core-analytics-server-mocks/package.json +++ b/packages/core/analytics/core-analytics-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-analytics-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-server-mocks/tsconfig.json b/packages/core/analytics/core-analytics-server-mocks/tsconfig.json index ef521586433c..14613f5e0931 100644 --- a/packages/core/analytics/core-analytics-server-mocks/tsconfig.json +++ b/packages/core/analytics/core-analytics-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-analytics-server", + "@kbn/core-analytics-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/analytics/core-analytics-server/BUILD.bazel b/packages/core/analytics/core-analytics-server/BUILD.bazel deleted file mode 100644 index 7cb5e329e0ff..000000000000 --- a/packages/core/analytics/core-analytics-server/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-analytics-server" -PKG_REQUIRE_NAME = "@kbn/core-analytics-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/analytics/client:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/analytics/core-analytics-server/kibana.jsonc b/packages/core/analytics/core-analytics-server/kibana.jsonc index d8faa138efc7..ab497b22d0c9 100644 --- a/packages/core/analytics/core-analytics-server/kibana.jsonc +++ b/packages/core/analytics/core-analytics-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-analytics-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/analytics/core-analytics-server/package.json b/packages/core/analytics/core-analytics-server/package.json index 0b5d1fce5638..cacde75dd8b6 100644 --- a/packages/core/analytics/core-analytics-server/package.json +++ b/packages/core/analytics/core-analytics-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-analytics-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/analytics/core-analytics-server/tsconfig.json b/packages/core/analytics/core-analytics-server/tsconfig.json index ef521586433c..9c3a721a57e2 100644 --- a/packages/core/analytics/core-analytics-server/tsconfig.json +++ b/packages/core/analytics/core-analytics-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/application/core-application-browser-internal/BUILD.bazel b/packages/core/application/core-application-browser-internal/BUILD.bazel deleted file mode 100644 index 3232dfc677af..000000000000 --- a/packages/core/application/core-application-browser-internal/BUILD.bazel +++ /dev/null @@ -1,148 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-application-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-application-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-router-dom", - "@npm//react-use", - "@npm//enzyme", - "@npm//rxjs", - "@npm//history", - "@npm//@elastic/eui", - "//packages/kbn-std", - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/core/application/core-application-common", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/enzyme", - "@npm//@types/react", - "@npm//@types/react-router-dom", - "@npm//react-use", - "@npm//@types/history", - "@npm//rxjs", - "@npm//@elastic/eui", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/capabilities/core-capabilities-browser-internal:npm_module_types", - "//packages/core/application/core-application-common:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/application/core-application-browser-internal/kibana.jsonc b/packages/core/application/core-application-browser-internal/kibana.jsonc index 5ebb9290df11..2c21e932f1cc 100644 --- a/packages/core/application/core-application-browser-internal/kibana.jsonc +++ b/packages/core/application/core-application-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-application-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/application/core-application-browser-internal/package.json b/packages/core/application/core-application-browser-internal/package.json index 4ded58a99f55..cfcd138706d3 100644 --- a/packages/core/application/core-application-browser-internal/package.json +++ b/packages/core/application/core-application-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-application-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/application/core-application-browser-internal/src/application_service.tsx b/packages/core/application/core-application-browser-internal/src/application_service.tsx index 28c7dd1b6ebb..54e4c98dd241 100644 --- a/packages/core/application/core-application-browser-internal/src/application_service.tsx +++ b/packages/core/application/core-application-browser-internal/src/application_service.tsx @@ -36,14 +36,14 @@ import { getLeaveAction, isConfirmAction } from './application_leave'; import { getUserConfirmationHandler } from './navigation_confirm'; import { appendAppPath, parseAppUrl, relativeToAbsolute, getAppInfo } from './utils'; -interface SetupDeps { +export interface SetupDeps { http: HttpSetup; history?: History; /** Used to redirect to external urls */ redirectTo?: (path: string) => void; } -interface StartDeps { +export interface StartDeps { http: HttpStart; theme: ThemeServiceStart; overlays: OverlayStart; diff --git a/packages/core/application/core-application-browser-internal/tsconfig.json b/packages/core/application/core-application-browser-internal/tsconfig.json index c561d9f22012..e6bff7c88eb4 100644 --- a/packages/core/application/core-application-browser-internal/tsconfig.json +++ b/packages/core/application/core-application-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,28 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/std", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-base-common", + "@kbn/core-http-browser", + "@kbn/core-capabilities-common", + "@kbn/core-theme-browser", + "@kbn/core-overlays-browser", + "@kbn/core-mount-utils-browser", + "@kbn/core-capabilities-browser-internal", + "@kbn/core-application-common", + "@kbn/core-application-browser", + "@kbn/core-capabilities-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-http-browser-internal", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/application/core-application-browser-mocks/BUILD.bazel b/packages/core/application/core-application-browser-mocks/BUILD.bazel deleted file mode 100644 index 979cc8d11021..000000000000 --- a/packages/core/application/core-application-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-application-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-application-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", - "//packages/core/capabilities/core-capabilities-browser-mocks" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/history", - "@npm//rxjs", - "//packages/kbn-std:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/capabilities/core-capabilities-browser-mocks:npm_module_types", - "//packages/core/theme/core-theme-browser-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/application/core-application-browser-mocks/kibana.jsonc b/packages/core/application/core-application-browser-mocks/kibana.jsonc index bdbeafdcc265..35714d9df41d 100644 --- a/packages/core/application/core-application-browser-mocks/kibana.jsonc +++ b/packages/core/application/core-application-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-application-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/application/core-application-browser-mocks/package.json b/packages/core/application/core-application-browser-mocks/package.json index 925c02bcbb09..530be8622ac2 100644 --- a/packages/core/application/core-application-browser-mocks/package.json +++ b/packages/core/application/core-application-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-application-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/application/core-application-browser-mocks/tsconfig.json b/packages/core/application/core-application-browser-mocks/tsconfig.json index 37f8e83d0d7a..aac8040ebe3e 100644 --- a/packages/core/application/core-application-browser-mocks/tsconfig.json +++ b/packages/core/application/core-application-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,16 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-mount-utils-browser", + "@kbn/core-application-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-capabilities-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/application/core-application-browser/BUILD.bazel b/packages/core/application/core-application-browser/BUILD.bazel deleted file mode 100644 index b2e1184ef03e..000000000000 --- a/packages/core/application/core-application-browser/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-application-browser" -PKG_REQUIRE_NAME = "@kbn/core-application-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/history", - "@npm//@elastic/eui", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types", - "//packages/core/application/core-application-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/application/core-application-browser/kibana.jsonc b/packages/core/application/core-application-browser/kibana.jsonc index 6a8931fa36f7..6d8428610bba 100644 --- a/packages/core/application/core-application-browser/kibana.jsonc +++ b/packages/core/application/core-application-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-application-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/application/core-application-browser/package.json b/packages/core/application/core-application-browser/package.json index 3626396a9eff..4ff030fb4b9e 100644 --- a/packages/core/application/core-application-browser/package.json +++ b/packages/core/application/core-application-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-application-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/application/core-application-browser/tsconfig.json b/packages/core/application/core-application-browser/tsconfig.json index 48df8f295724..3a15995e0a00 100644 --- a/packages/core/application/core-application-browser/tsconfig.json +++ b/packages/core/application/core-application-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,15 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-theme-browser", + "@kbn/core-mount-utils-browser", + "@kbn/core-capabilities-common", + "@kbn/core-application-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/application/core-application-common/BUILD.bazel b/packages/core/application/core-application-common/BUILD.bazel deleted file mode 100644 index 43edda698fa0..000000000000 --- a/packages/core/application/core-application-common/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-application-common" -PKG_REQUIRE_NAME = "@kbn/core-application-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "//packages/kbn-i18n", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-i18n:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/application/core-application-common/kibana.jsonc b/packages/core/application/core-application-common/kibana.jsonc index da1cc4d8f7d9..762e4f62119e 100644 --- a/packages/core/application/core-application-common/kibana.jsonc +++ b/packages/core/application/core-application-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-application-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/application/core-application-common/package.json b/packages/core/application/core-application-common/package.json index 22b9a3e452f1..6a402e1ad15d 100644 --- a/packages/core/application/core-application-common/package.json +++ b/packages/core/application/core-application-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-application-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/application/core-application-common/tsconfig.json b/packages/core/application/core-application-common/tsconfig.json index 48df8f295724..648faae82941 100644 --- a/packages/core/application/core-application-common/tsconfig.json +++ b/packages/core/application/core-application-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/apps/core-apps-browser-internal/BUILD.bazel b/packages/core/apps/core-apps-browser-internal/BUILD.bazel deleted file mode 100644 index 941b011104ba..000000000000 --- a/packages/core/apps/core-apps-browser-internal/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-apps-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-apps-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//history", - "@npm//@elastic/eui", - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/core/mount-utils/core-mount-utils-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-dom", - "@npm//@types/history", - "@npm//@elastic/eui", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", - "//packages/core/notifications/core-notifications-browser:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser-internal:npm_module_types", - "//packages/core/status/core-status-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/apps/core-apps-browser-internal/kibana.jsonc b/packages/core/apps/core-apps-browser-internal/kibana.jsonc index 552de143ce1d..29b64390ec54 100644 --- a/packages/core/apps/core-apps-browser-internal/kibana.jsonc +++ b/packages/core/apps/core-apps-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-apps-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/apps/core-apps-browser-internal/package.json b/packages/core/apps/core-apps-browser-internal/package.json index 04029a6f91fb..f5ff325da6c5 100644 --- a/packages/core/apps/core-apps-browser-internal/package.json +++ b/packages/core/apps/core-apps-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-apps-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/apps/core-apps-browser-internal/tsconfig.json b/packages/core/apps/core-apps-browser-internal/tsconfig.json index 37f8e83d0d7a..f824f9f63821 100644 --- a/packages/core/apps/core-apps-browser-internal/tsconfig.json +++ b/packages/core/apps/core-apps-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,32 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-base-browser-internal", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-doc-links-browser", + "@kbn/core-http-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-notifications-browser", + "@kbn/core-application-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-theme-browser-internal", + "@kbn/core-mount-utils-browser-internal", + "@kbn/core-status-common-internal", + "@kbn/core-http-browser-internal", + "@kbn/core-application-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-metrics-collectors-server-mocks", + "@kbn/core-status-common", + "@kbn/core-doc-links-browser-mocks", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/apps/core-apps-browser-mocks/BUILD.bazel b/packages/core/apps/core-apps-browser-mocks/BUILD.bazel deleted file mode 100644 index 65ce563a97d9..000000000000 --- a/packages/core/apps/core-apps-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-apps-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-apps-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/apps/core-apps-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/apps/core-apps-browser-mocks/kibana.jsonc b/packages/core/apps/core-apps-browser-mocks/kibana.jsonc index 074993f2bd62..970d9411462a 100644 --- a/packages/core/apps/core-apps-browser-mocks/kibana.jsonc +++ b/packages/core/apps/core-apps-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-apps-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/apps/core-apps-browser-mocks/package.json b/packages/core/apps/core-apps-browser-mocks/package.json index 690d50dc3a1c..af2cd7b1027b 100644 --- a/packages/core/apps/core-apps-browser-mocks/package.json +++ b/packages/core/apps/core-apps-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-apps-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/apps/core-apps-browser-mocks/tsconfig.json b/packages/core/apps/core-apps-browser-mocks/tsconfig.json index 741519055e98..8b74f6d511cc 100644 --- a/packages/core/apps/core-apps-browser-mocks/tsconfig.json +++ b/packages/core/apps/core-apps-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-apps-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/apps/core-apps-server-internal/BUILD.bazel b/packages/core/apps/core-apps-server-internal/BUILD.bazel deleted file mode 100644 index 94f52482c27d..000000000000 --- a/packages/core/apps/core-apps-server-internal/BUILD.bazel +++ /dev/null @@ -1,141 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-apps-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-apps-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -ASSETS = glob(["assets/**/*"]) - -filegroup( - name = "assets", - srcs = ASSETS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - ":assets" -] - -RUNTIME_DEPS = [ - "@npm//elastic-apm-node", - "@npm//lru-cache", - "@npm//mime-types", - "//packages/kbn-config", - "//packages/kbn-config-schema", - "//packages/kbn-utils", - "//packages/kbn-logging", - "//packages/kbn-ui-shared-deps-npm", - "//packages/kbn-ui-shared-deps-src", - "//packages/core/base/core-base-server-internal", - "//packages/core/lifecycle/core-lifecycle-server-internal", - "//packages/core/plugins/core-plugins-base-server-internal", -] - -TYPES_DEPS = [ - "@npm//elastic-apm-node", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lru-cache", - "@npm//@types/mime-types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-ui-shared-deps-src:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-resources-server:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", - "//packages/core/plugins/core-plugins-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/apps/core-apps-server-internal/kibana.jsonc b/packages/core/apps/core-apps-server-internal/kibana.jsonc index 976f82a69e7c..8c73dfc0752d 100644 --- a/packages/core/apps/core-apps-server-internal/kibana.jsonc +++ b/packages/core/apps/core-apps-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-apps-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/apps/core-apps-server-internal/package.json b/packages/core/apps/core-apps-server-internal/package.json index 04c52e856bf2..0a91a8809246 100644 --- a/packages/core/apps/core-apps-server-internal/package.json +++ b/packages/core/apps/core-apps-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-apps-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts index 218fee67289a..c5937886ad3e 100644 --- a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.mocks.ts @@ -18,3 +18,7 @@ jest.doMock('@kbn/ui-shared-deps-src', () => ({ jest.doMock('@kbn/ui-shared-deps-npm', () => ({ distDir: 'uiSharedDepsNpmDistDir', })); + +jest.doMock('@kbn/monaco/server', () => ({ + bundleDir: 'kbnMonacoBundleDir', +})); diff --git a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts index 6ec560313734..249d3880c07d 100644 --- a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.test.ts @@ -56,7 +56,7 @@ describe('registerBundleRoutes', () => { uiPlugins: createUiPlugins(), }); - expect(registerRouteForBundleMock).toHaveBeenCalledTimes(3); + expect(registerRouteForBundleMock).toHaveBeenCalledTimes(4); expect(registerRouteForBundleMock).toHaveBeenCalledWith(router, { fileHashCache: expect.any(FileHashCache), @@ -81,6 +81,14 @@ describe('registerBundleRoutes', () => { publicPath: '/server-base-path/42/bundles/core/', routePath: '/42/bundles/core/', }); + + expect(registerRouteForBundleMock).toHaveBeenCalledWith(router, { + fileHashCache: expect.any(FileHashCache), + isDist: true, + bundlesPath: 'kbnMonacoBundleDir', + publicPath: '/server-base-path/42/bundles/kbn-monaco/', + routePath: '/42/bundles/kbn-monaco/', + }); }); it('registers plugin bundles', () => { @@ -91,7 +99,7 @@ describe('registerBundleRoutes', () => { uiPlugins: createUiPlugins('plugin-a', 'plugin-b'), }); - expect(registerRouteForBundleMock).toHaveBeenCalledTimes(5); + expect(registerRouteForBundleMock).toHaveBeenCalledTimes(6); expect(registerRouteForBundleMock).toHaveBeenCalledWith(router, { fileHashCache: expect.any(FileHashCache), diff --git a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts index d0b5094edf94..ad1008c5ac1e 100644 --- a/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts +++ b/packages/core/apps/core-apps-server-internal/src/bundle_routes/register_bundle_routes.ts @@ -8,9 +8,10 @@ import { join } from 'path'; import type { PackageInfo } from '@kbn/config'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import UiSharedDepsNpm from '@kbn/ui-shared-deps-npm'; import { distDir as UiSharedDepsSrcDistDir } from '@kbn/ui-shared-deps-src'; +import * as KbnMonaco from '@kbn/monaco/server'; import type { IRouter } from '@kbn/core-http-server'; import type { UiPlugins } from '@kbn/core-plugins-base-server-internal'; import { FileHashCache } from './file_hash_cache'; @@ -64,6 +65,13 @@ export function registerBundleRoutes({ fileHashCache, isDist, }); + registerRouteForBundle(router, { + publicPath: `${serverBasePath}/${buildNum}/bundles/kbn-monaco/`, + routePath: `/${buildNum}/bundles/kbn-monaco/`, + bundlesPath: KbnMonaco.bundleDir, + fileHashCache, + isDist, + }); [...uiPlugins.internal.entries()].forEach(([id, { publicTargetDir, version }]) => { registerRouteForBundle(router, { diff --git a/packages/core/apps/core-apps-server-internal/src/core_app.ts b/packages/core/apps/core-apps-server-internal/src/core_app.ts index 3e094fab889a..872f3761b327 100644 --- a/packages/core/apps/core-apps-server-internal/src/core_app.ts +++ b/packages/core/apps/core-apps-server-internal/src/core_app.ts @@ -9,7 +9,7 @@ import { stringify } from 'querystring'; import { Env } from '@kbn/config'; import { schema } from '@kbn/config-schema'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import type { Logger } from '@kbn/logging'; import type { CoreContext } from '@kbn/core-base-server-internal'; import type { diff --git a/packages/core/apps/core-apps-server-internal/tsconfig.json b/packages/core/apps/core-apps-server-internal/tsconfig.json index ff48529c6f30..36ecc68c7cbc 100644 --- a/packages/core/apps/core-apps-server-internal/tsconfig.json +++ b/packages/core/apps/core-apps-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -12,5 +10,30 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/ui-shared-deps-npm", + "@kbn/ui-shared-deps-src", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-http-resources-server", + "@kbn/core-http-server", + "@kbn/core-lifecycle-server-internal", + "@kbn/core-plugins-base-server-internal", + "@kbn/repo-info", + "@kbn/core-base-server-mocks", + "@kbn/core-http-router-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-http-resources-server-mocks", + "@kbn/core-base-common", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-lifecycle-server-mocks", + "@kbn/core-ui-settings-server", + "@kbn/monaco", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-browser-internal/BUILD.bazel b/packages/core/base/core-base-browser-internal/BUILD.bazel deleted file mode 100644 index 02e0c8567863..000000000000 --- a/packages/core/base/core-base-browser-internal/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-base-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/core/base/core-base-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-browser-internal/kibana.jsonc b/packages/core/base/core-base-browser-internal/kibana.jsonc index 7254343b42c5..e264f079717e 100644 --- a/packages/core/base/core-base-browser-internal/kibana.jsonc +++ b/packages/core/base/core-base-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-browser-internal/package.json b/packages/core/base/core-base-browser-internal/package.json index dc3cbe0f4fd5..cda835503362 100644 --- a/packages/core/base/core-base-browser-internal/package.json +++ b/packages/core/base/core-base-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-base-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-browser-internal/tsconfig.json b/packages/core/base/core-base-browser-internal/tsconfig.json index 3cdea36de9ea..a3e5d5fc950b 100644 --- a/packages/core/base/core-base-browser-internal/tsconfig.json +++ b/packages/core/base/core-base-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/config", + "@kbn/core-base-common-internal", + "@kbn/logging", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-browser-mocks/BUILD.bazel b/packages/core/base/core-base-browser-mocks/BUILD.bazel deleted file mode 100644 index 4eefc6034407..000000000000 --- a/packages/core/base/core-base-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-base-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-browser-mocks/kibana.jsonc b/packages/core/base/core-base-browser-mocks/kibana.jsonc index 5911ba33ca9d..48c6b95d3afb 100644 --- a/packages/core/base/core-base-browser-mocks/kibana.jsonc +++ b/packages/core/base/core-base-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-browser-mocks/package.json b/packages/core/base/core-base-browser-mocks/package.json index b0e8f7612cbc..a6c7560e4ccc 100644 --- a/packages/core/base/core-base-browser-mocks/package.json +++ b/packages/core/base/core-base-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-base-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-browser-mocks/tsconfig.json b/packages/core/base/core-base-browser-mocks/tsconfig.json index ef521586433c..c55b005c3a57 100644 --- a/packages/core/base/core-base-browser-mocks/tsconfig.json +++ b/packages/core/base/core-base-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging-mocks", + "@kbn/core-base-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-common-internal/BUILD.bazel b/packages/core/base/core-base-common-internal/BUILD.bazel deleted file mode 100644 index 06e7daca4fa3..000000000000 --- a/packages/core/base/core-base-common-internal/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-common-internal" -PKG_REQUIRE_NAME = "@kbn/core-base-common-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-common-internal/kibana.jsonc b/packages/core/base/core-base-common-internal/kibana.jsonc index 61abd6d9a872..8f2083119d1b 100644 --- a/packages/core/base/core-base-common-internal/kibana.jsonc +++ b/packages/core/base/core-base-common-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-common-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-common-internal/package.json b/packages/core/base/core-base-common-internal/package.json index ea555dbf17a7..aa0d19ac4689 100644 --- a/packages/core/base/core-base-common-internal/package.json +++ b/packages/core/base/core-base-common-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-base-common-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-common-internal/tsconfig.json b/packages/core/base/core-base-common-internal/tsconfig.json index 3cdea36de9ea..0f16c2b9311d 100644 --- a/packages/core/base/core-base-common-internal/tsconfig.json +++ b/packages/core/base/core-base-common-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-common/BUILD.bazel b/packages/core/base/core-base-common/BUILD.bazel deleted file mode 100644 index 4a5b48d3aaeb..000000000000 --- a/packages/core/base/core-base-common/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-common" -PKG_REQUIRE_NAME = "@kbn/core-base-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-config:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-common/kibana.jsonc b/packages/core/base/core-base-common/kibana.jsonc index d72d5da919f1..5a9691ad80c4 100644 --- a/packages/core/base/core-base-common/kibana.jsonc +++ b/packages/core/base/core-base-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-common/package.json b/packages/core/base/core-base-common/package.json index 6eb5ea8f82bc..6d794b679b3c 100644 --- a/packages/core/base/core-base-common/package.json +++ b/packages/core/base/core-base-common/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-base-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-common/tsconfig.json b/packages/core/base/core-base-common/tsconfig.json index ef521586433c..40ac62b671e0 100644 --- a/packages/core/base/core-base-common/tsconfig.json +++ b/packages/core/base/core-base-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-server-internal/BUILD.bazel b/packages/core/base/core-base-server-internal/BUILD.bazel deleted file mode 100644 index b30d20874ae1..000000000000 --- a/packages/core/base/core-base-server-internal/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-base-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/base/core-base-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-server-internal/kibana.jsonc b/packages/core/base/core-base-server-internal/kibana.jsonc index 0a21a2b7e638..569148c437dd 100644 --- a/packages/core/base/core-base-server-internal/kibana.jsonc +++ b/packages/core/base/core-base-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-server-internal/package.json b/packages/core/base/core-base-server-internal/package.json index 88348d974ae7..1b35ac29d27e 100644 --- a/packages/core/base/core-base-server-internal/package.json +++ b/packages/core/base/core-base-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-base-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-server-internal/tsconfig.json b/packages/core/base/core-base-server-internal/tsconfig.json index ef521586433c..fa2b8ec8c8cb 100644 --- a/packages/core/base/core-base-server-internal/tsconfig.json +++ b/packages/core/base/core-base-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/utility-types", + "@kbn/core-base-common-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/base/core-base-server-mocks/BUILD.bazel b/packages/core/base/core-base-server-mocks/BUILD.bazel deleted file mode 100644 index 164c71eade84..000000000000 --- a/packages/core/base/core-base-server-mocks/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-base-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-base-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-utils", - "//packages/kbn-config", - "//packages/kbn-logging-mocks", - "//packages/kbn-config-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/base/core-base-server-mocks/kibana.jsonc b/packages/core/base/core-base-server-mocks/kibana.jsonc index 762615e557b8..438181d91775 100644 --- a/packages/core/base/core-base-server-mocks/kibana.jsonc +++ b/packages/core/base/core-base-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-base-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/base/core-base-server-mocks/package.json b/packages/core/base/core-base-server-mocks/package.json index 99b8d1823c03..88bd6628ffd8 100644 --- a/packages/core/base/core-base-server-mocks/package.json +++ b/packages/core/base/core-base-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-base-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/base/core-base-server-mocks/src/core_context.mock.ts b/packages/core/base/core-base-server-mocks/src/core_context.mock.ts index 6a0ed511a97b..ca9cb0a654a9 100644 --- a/packages/core/base/core-base-server-mocks/src/core_context.mock.ts +++ b/packages/core/base/core-base-server-mocks/src/core_context.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import { Env, IConfigService } from '@kbn/config'; import type { LoggerFactory } from '@kbn/logging'; diff --git a/packages/core/base/core-base-server-mocks/tsconfig.json b/packages/core/base/core-base-server-mocks/tsconfig.json index ef521586433c..55ec929a987a 100644 --- a/packages/core/base/core-base-server-mocks/tsconfig.json +++ b/packages/core/base/core-base-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,17 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types-jest", + "@kbn/config", + "@kbn/config-mocks", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/core-base-server-internal", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel b/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel deleted file mode 100644 index ae1ae63ce727..000000000000 --- a/packages/core/capabilities/core-capabilities-browser-internal/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", - ### test dependencies - "//packages/core/http/core-http-browser-mocks" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-browser-internal/kibana.jsonc b/packages/core/capabilities/core-capabilities-browser-internal/kibana.jsonc index 48f55a81a7a6..4986d1386610 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-browser-internal/package.json b/packages/core/capabilities/core-capabilities-browser-internal/package.json index db4629195370..6734b2b73493 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/package.json +++ b/packages/core/capabilities/core-capabilities-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-capabilities-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json b/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json index 48df8f295724..258f96a51d15 100644 --- a/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,6 +9,16 @@ }, "include": [ "**/*.ts", - "**/*.tsx", + "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/std", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + "@kbn/core-capabilities-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel b/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel deleted file mode 100644 index bed02693f0b2..000000000000 --- a/packages/core/capabilities/core-capabilities-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/capabilities/core-capabilities-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/kibana.jsonc b/packages/core/capabilities/core-capabilities-browser-mocks/kibana.jsonc index 5e6ddff3a428..ab693c53daa3 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/package.json b/packages/core/capabilities/core-capabilities-browser-mocks/package.json index c278de75213c..848ca72a3449 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/package.json +++ b/packages/core/capabilities/core-capabilities-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-capabilities-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json b/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json index 48df8f295724..d281d8f8d1eb 100644 --- a/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/std", + "@kbn/utility-types", + "@kbn/core-capabilities-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-common/BUILD.bazel b/packages/core/capabilities/core-capabilities-common/BUILD.bazel deleted file mode 100644 index 1cb1470f2c4e..000000000000 --- a/packages/core/capabilities/core-capabilities-common/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-common" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-common/kibana.jsonc b/packages/core/capabilities/core-capabilities-common/kibana.jsonc index 5349e81ad362..87bb4d2977a3 100644 --- a/packages/core/capabilities/core-capabilities-common/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-common/package.json b/packages/core/capabilities/core-capabilities-common/package.json index c0454d5a5e73..160b66ad7ecf 100644 --- a/packages/core/capabilities/core-capabilities-common/package.json +++ b/packages/core/capabilities/core-capabilities-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-capabilities-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-common/tsconfig.json b/packages/core/capabilities/core-capabilities-common/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/capabilities/core-capabilities-common/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel b/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel deleted file mode 100644 index 2c99ea26797a..000000000000 --- a/packages/core/capabilities/core-capabilities-server-internal/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "//packages/kbn-config-schema", - "//packages/kbn-apm-utils", - ### test dependencies - "//packages/core/base/core-base-server-mocks", - "//packages/core/http/core-http-router-server-mocks", - "//packages/core/http/core-http-server-mocks", - -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "//packages/kbn-apm-utils:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types", - "//packages/core/capabilities/core-capabilities-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-server-internal/kibana.jsonc b/packages/core/capabilities/core-capabilities-server-internal/kibana.jsonc index 3c464af07ea4..89591227f254 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-server-internal/package.json b/packages/core/capabilities/core-capabilities-server-internal/package.json index c5d445c4ae52..9637e88808e2 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/package.json +++ b/packages/core/capabilities/core-capabilities-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-capabilities-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json b/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json index ef521586433c..64ee048df391 100644 --- a/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,21 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/apm-utils", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-capabilities-common", + "@kbn/core-capabilities-server", + "@kbn/core-base-server-mocks", + "@kbn/core-http-router-server-mocks", + "@kbn/core-http-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel b/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel deleted file mode 100644 index 1666555ef5f3..000000000000 --- a/packages/core/capabilities/core-capabilities-server-mocks/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types", - "//packages/core/capabilities/core-capabilities-server:npm_module_types", - "//packages/core/capabilities/core-capabilities-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-server-mocks/kibana.jsonc b/packages/core/capabilities/core-capabilities-server-mocks/kibana.jsonc index 5404ed714a6e..68739c985d15 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-server-mocks/package.json b/packages/core/capabilities/core-capabilities-server-mocks/package.json index 0c82d3de94e5..edd5860d2136 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/package.json +++ b/packages/core/capabilities/core-capabilities-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-capabilities-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json b/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json index ef521586433c..a8fa17426573 100644 --- a/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-capabilities-common", + "@kbn/core-capabilities-server", + "@kbn/core-capabilities-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/capabilities/core-capabilities-server/BUILD.bazel b/packages/core/capabilities/core-capabilities-server/BUILD.bazel deleted file mode 100644 index f52df2ffaec0..000000000000 --- a/packages/core/capabilities/core-capabilities-server/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-capabilities-server" -PKG_REQUIRE_NAME = "@kbn/core-capabilities-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/capabilities/core-capabilities-common:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/capabilities/core-capabilities-server/kibana.jsonc b/packages/core/capabilities/core-capabilities-server/kibana.jsonc index dc6e6ac3c127..cfa34dba13ad 100644 --- a/packages/core/capabilities/core-capabilities-server/kibana.jsonc +++ b/packages/core/capabilities/core-capabilities-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-capabilities-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/capabilities/core-capabilities-server/package.json b/packages/core/capabilities/core-capabilities-server/package.json index 013a8a5e8fa3..d0aaa1541461 100644 --- a/packages/core/capabilities/core-capabilities-server/package.json +++ b/packages/core/capabilities/core-capabilities-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-capabilities-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/capabilities/core-capabilities-server/tsconfig.json b/packages/core/capabilities/core-capabilities-server/tsconfig.json index ef521586433c..1bb52580bb4d 100644 --- a/packages/core/capabilities/core-capabilities-server/tsconfig.json +++ b/packages/core/capabilities/core-capabilities-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-http-server", + "@kbn/core-capabilities-common", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel b/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel deleted file mode 100644 index 7399951064bf..000000000000 --- a/packages/core/chrome/core-chrome-browser-internal/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-chrome-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-chrome-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//lodash", - "@npm//rxjs", - "@npm//classnames", - "@npm//react-use", - "@npm//@elastic/eui", - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/core/mount-utils/core-mount-utils-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/classnames", - "@npm//react-use", - "@npm//lodash", - "@npm//rxjs", - "@npm//@elastic/eui", - "//packages/kbn-crypto-browser:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/notifications/core-notifications-browser:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser-internal:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/chrome/core-chrome-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ] -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/chrome/core-chrome-browser-internal/kibana.jsonc b/packages/core/chrome/core-chrome-browser-internal/kibana.jsonc index 2d0a7bada7bb..84db611a0b34 100644 --- a/packages/core/chrome/core-chrome-browser-internal/kibana.jsonc +++ b/packages/core/chrome/core-chrome-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-chrome-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/chrome/core-chrome-browser-internal/package.json b/packages/core/chrome/core-chrome-browser-internal/package.json index 121dce5d9fe6..51108d8d2502 100644 --- a/packages/core/chrome/core-chrome-browser-internal/package.json +++ b/packages/core/chrome/core-chrome-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-chrome-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json index c561d9f22012..d55e52c906a0 100644 --- a/packages/core/chrome/core-chrome-browser-internal/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,30 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/crypto-browser", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-doc-links-browser", + "@kbn/core-http-browser", + "@kbn/core-notifications-browser", + "@kbn/core-mount-utils-browser-internal", + "@kbn/core-application-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-chrome-browser", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-doc-links-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/test-jest-helpers", + "@kbn/core-application-common", + "@kbn/core-mount-utils-browser", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel b/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel deleted file mode 100644 index 4a45606503f6..000000000000 --- a/packages/core/chrome/core-chrome-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,117 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-chrome-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-chrome-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/core/chrome/core-chrome-browser:npm_module_types", - "//packages/core/chrome/core-chrome-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/chrome/core-chrome-browser-mocks/kibana.jsonc b/packages/core/chrome/core-chrome-browser-mocks/kibana.jsonc index 5968ce1224da..e9283e5dab60 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/kibana.jsonc +++ b/packages/core/chrome/core-chrome-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-chrome-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/chrome/core-chrome-browser-mocks/package.json b/packages/core/chrome/core-chrome-browser-mocks/package.json index bd5b73194a52..f73bd5dba44f 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/package.json +++ b/packages/core/chrome/core-chrome-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-chrome-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json b/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json index 741519055e98..46d416acc55c 100644 --- a/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,14 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/utility-types-jest", + "@kbn/core-chrome-browser", + "@kbn/core-chrome-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/chrome/core-chrome-browser/BUILD.bazel b/packages/core/chrome/core-chrome-browser/BUILD.bazel deleted file mode 100644 index 00e46c761498..000000000000 --- a/packages/core/chrome/core-chrome-browser/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-chrome-browser" -PKG_REQUIRE_NAME = "@kbn/core-chrome-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "@npm//rxjs", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types", - "//packages/core/application/core-application-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/chrome/core-chrome-browser/kibana.jsonc b/packages/core/chrome/core-chrome-browser/kibana.jsonc index 64eba0644450..ea1cb4638d0f 100644 --- a/packages/core/chrome/core-chrome-browser/kibana.jsonc +++ b/packages/core/chrome/core-chrome-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-chrome-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/chrome/core-chrome-browser/package.json b/packages/core/chrome/core-chrome-browser/package.json index 42854ddcca13..ac747187f137 100644 --- a/packages/core/chrome/core-chrome-browser/package.json +++ b/packages/core/chrome/core-chrome-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-chrome-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/chrome/core-chrome-browser/tsconfig.json b/packages/core/chrome/core-chrome-browser/tsconfig.json index 741519055e98..281389cd0927 100644 --- a/packages/core/chrome/core-chrome-browser/tsconfig.json +++ b/packages/core/chrome/core-chrome-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-mount-utils-browser", + "@kbn/core-application-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/config/core-config-server-internal/BUILD.bazel b/packages/core/config/core-config-server-internal/BUILD.bazel deleted file mode 100644 index 2b4ef85f0484..000000000000 --- a/packages/core/config/core-config-server-internal/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-config-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-config-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-safer-lodash-set", - "//packages/kbn-config", - "//packages/core/base/core-base-server-internal", - "//packages/kbn-config-mocks", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//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", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/config/core-config-server-internal/kibana.jsonc b/packages/core/config/core-config-server-internal/kibana.jsonc index a6ba80afe959..7b1e11349fc7 100644 --- a/packages/core/config/core-config-server-internal/kibana.jsonc +++ b/packages/core/config/core-config-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-config-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/config/core-config-server-internal/package.json b/packages/core/config/core-config-server-internal/package.json index 504824cb9613..a3864186c5f4 100644 --- a/packages/core/config/core-config-server-internal/package.json +++ b/packages/core/config/core-config-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-config-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/config/core-config-server-internal/tsconfig.json b/packages/core/config/core-config-server-internal/tsconfig.json index ef521586433c..23a51196a73c 100644 --- a/packages/core/config/core-config-server-internal/tsconfig.json +++ b/packages/core/config/core-config-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-mocks", + "@kbn/core-base-server-internal", + "@kbn/core-test-helpers-deprecations-getters" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel deleted file mode 100644 index 799d368a5a66..000000000000 --- a/packages/core/deprecations/core-deprecations-browser-internal/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "//packages/core/http/core-http-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-i18n:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/http/core-http-browser-mocks:npm_module_types", - "//packages/core/deprecations/core-deprecations-common:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-browser-internal/kibana.jsonc b/packages/core/deprecations/core-deprecations-browser-internal/kibana.jsonc index c5bf07aa7052..7db30fcf0517 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-browser-internal/package.json b/packages/core/deprecations/core-deprecations-browser-internal/package.json index 5778e7fa149a..014cadb77f35 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/package.json +++ b/packages/core/deprecations/core-deprecations-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-deprecations-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json b/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json index ef521586433c..8c7dde1c84e0 100644 --- a/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/core-base-browser-internal", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + "@kbn/core-deprecations-common", + "@kbn/core-deprecations-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel deleted file mode 100644 index bea9231acf84..000000000000 --- a/packages/core/deprecations/core-deprecations-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/deprecations/core-deprecations-browser-internal" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/kibana.jsonc b/packages/core/deprecations/core-deprecations-browser-mocks/kibana.jsonc index 28424208cd58..464f09cb0edd 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/package.json b/packages/core/deprecations/core-deprecations-browser-mocks/package.json index cd9f1986ad14..3c01322543a1 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/package.json +++ b/packages/core/deprecations/core-deprecations-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-deprecations-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json b/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json index ef521586433c..db74de14068d 100644 --- a/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-deprecations-browser", + "@kbn/core-deprecations-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-browser/BUILD.bazel b/packages/core/deprecations/core-deprecations-browser/BUILD.bazel deleted file mode 100644 index 98367818f616..000000000000 --- a/packages/core/deprecations/core-deprecations-browser/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-browser" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/core/deprecations/core-deprecations-common:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-browser/kibana.jsonc b/packages/core/deprecations/core-deprecations-browser/kibana.jsonc index 3e708f34935b..624ce8f9a24c 100644 --- a/packages/core/deprecations/core-deprecations-browser/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-browser/package.json b/packages/core/deprecations/core-deprecations-browser/package.json index 410b55d4d175..cade193e602d 100644 --- a/packages/core/deprecations/core-deprecations-browser/package.json +++ b/packages/core/deprecations/core-deprecations-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-deprecations-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-browser/tsconfig.json b/packages/core/deprecations/core-deprecations-browser/tsconfig.json index ef521586433c..60c79345dd69 100644 --- a/packages/core/deprecations/core-deprecations-browser/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-deprecations-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-common/BUILD.bazel b/packages/core/deprecations/core-deprecations-common/BUILD.bazel deleted file mode 100644 index 0a21fa19ef49..000000000000 --- a/packages/core/deprecations/core-deprecations-common/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-common" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-common/kibana.jsonc b/packages/core/deprecations/core-deprecations-common/kibana.jsonc index 60494dec2502..81fc008124c7 100644 --- a/packages/core/deprecations/core-deprecations-common/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-common/package.json b/packages/core/deprecations/core-deprecations-common/package.json index 511e4a942f32..cd3ba57b35d0 100644 --- a/packages/core/deprecations/core-deprecations-common/package.json +++ b/packages/core/deprecations/core-deprecations-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-deprecations-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-common/tsconfig.json b/packages/core/deprecations/core-deprecations-common/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/deprecations/core-deprecations-common/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel b/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel deleted file mode 100644 index 336bda22def7..000000000000 --- a/packages/core/deprecations/core-deprecations-server-internal/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/kbn-i18n", - "//packages/kbn-std", - ### test dependencies - "//packages/kbn-logging-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-common:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-server-internal/kibana.jsonc b/packages/core/deprecations/core-deprecations-server-internal/kibana.jsonc index 367adb98a89b..7c9e02b525c0 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-server-internal/package.json b/packages/core/deprecations/core-deprecations-server-internal/package.json index 4dca63aa1661..a022cfdf8373 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/package.json +++ b/packages/core/deprecations/core-deprecations-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-deprecations-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json b/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json index 4582562d6c9b..ba06a3e9ec2f 100644 --- a/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,32 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/std", + "@kbn/i18n", + "@kbn/logging", + "@kbn/config", + "@kbn/core-base-server-internal", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-deprecations-common", + "@kbn/core-deprecations-server", + "@kbn/logging-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/config-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-http-server", + "@kbn/core-elasticsearch-client-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel b/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel deleted file mode 100644 index ab178fad79f1..000000000000 --- a/packages/core/deprecations/core-deprecations-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", - "//packages/core/deprecations/core-deprecations-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-server-mocks/kibana.jsonc b/packages/core/deprecations/core-deprecations-server-mocks/kibana.jsonc index fc56bc34368f..f897a7c512b9 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-server-mocks/package.json b/packages/core/deprecations/core-deprecations-server-mocks/package.json index 15318700c494..9b429d07ee72 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/package.json +++ b/packages/core/deprecations/core-deprecations-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-deprecations-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json b/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json index 4582562d6c9b..84627ac21e20 100644 --- a/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-deprecations-server", + "@kbn/core-deprecations-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/deprecations/core-deprecations-server/BUILD.bazel b/packages/core/deprecations/core-deprecations-server/BUILD.bazel deleted file mode 100644 index 27f711ff83b4..000000000000 --- a/packages/core/deprecations/core-deprecations-server/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-deprecations-server" -PKG_REQUIRE_NAME = "@kbn/core-deprecations-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/deprecations/core-deprecations-common:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/deprecations/core-deprecations-server/kibana.jsonc b/packages/core/deprecations/core-deprecations-server/kibana.jsonc index 96270007d4ad..6747cae83686 100644 --- a/packages/core/deprecations/core-deprecations-server/kibana.jsonc +++ b/packages/core/deprecations/core-deprecations-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-deprecations-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/deprecations/core-deprecations-server/package.json b/packages/core/deprecations/core-deprecations-server/package.json index 68882ca7ba6d..e21b001ee932 100644 --- a/packages/core/deprecations/core-deprecations-server/package.json +++ b/packages/core/deprecations/core-deprecations-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-deprecations-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/deprecations/core-deprecations-server/tsconfig.json b/packages/core/deprecations/core-deprecations-server/tsconfig.json index 4582562d6c9b..fa09534af0b9 100644 --- a/packages/core/deprecations/core-deprecations-server/tsconfig.json +++ b/packages/core/deprecations/core-deprecations-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-deprecations-common", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-api-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel deleted file mode 100644 index b0a8cea7da17..000000000000 --- a/packages/core/doc-links/core-doc-links-browser-internal/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-doc-links:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-browser-internal/kibana.jsonc b/packages/core/doc-links/core-doc-links-browser-internal/kibana.jsonc index b72ad3a17021..8b54adc77684 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-browser-internal/package.json b/packages/core/doc-links/core-doc-links-browser-internal/package.json index 00bfad1514cc..26b93132d397 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/package.json +++ b/packages/core/doc-links/core-doc-links-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-doc-links-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json b/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json index ef521586433c..dda4c975120d 100644 --- a/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/doc-links", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-doc-links-browser", + "@kbn/core-injected-metadata-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel deleted file mode 100644 index 67d4cf29a1e4..000000000000 --- a/packages/core/doc-links/core-doc-links-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "//packages/core/doc-links/core-doc-links-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/kibana.jsonc b/packages/core/doc-links/core-doc-links-browser-mocks/kibana.jsonc index d1c5b7af2839..c081dab3fdb6 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/package.json b/packages/core/doc-links/core-doc-links-browser-mocks/package.json index d2085b6c9908..e83064509f12 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/package.json +++ b/packages/core/doc-links/core-doc-links-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-doc-links-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json b/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json index ef521586433c..473ae750e67e 100644 --- a/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-doc-links-browser", + "@kbn/core-doc-links-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-browser/BUILD.bazel b/packages/core/doc-links/core-doc-links-browser/BUILD.bazel deleted file mode 100644 index 564858b40c5a..000000000000 --- a/packages/core/doc-links/core-doc-links-browser/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-browser" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-doc-links:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-browser/kibana.jsonc b/packages/core/doc-links/core-doc-links-browser/kibana.jsonc index 68ed9f30aff6..e21e71f26fbe 100644 --- a/packages/core/doc-links/core-doc-links-browser/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-browser/package.json b/packages/core/doc-links/core-doc-links-browser/package.json index 91d8b643949d..af280c55ade6 100644 --- a/packages/core/doc-links/core-doc-links-browser/package.json +++ b/packages/core/doc-links/core-doc-links-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-doc-links-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-browser/tsconfig.json b/packages/core/doc-links/core-doc-links-browser/tsconfig.json index ef521586433c..68b5d3d0d019 100644 --- a/packages/core/doc-links/core-doc-links-browser/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/doc-links" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel b/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel deleted file mode 100644 index 911d177dd40b..000000000000 --- a/packages/core/doc-links/core-doc-links-server-internal/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/base/core-base-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-doc-links:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/base/core-base-server-mocks:npm_module_types", - "//packages/core/doc-links/core-doc-links-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-server-internal/kibana.jsonc b/packages/core/doc-links/core-doc-links-server-internal/kibana.jsonc index f2158ec01820..2e8ef46d85c8 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-server-internal/package.json b/packages/core/doc-links/core-doc-links-server-internal/package.json index 1c5ee24849e2..675462eb9661 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/package.json +++ b/packages/core/doc-links/core-doc-links-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-doc-links-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json b/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json index ef521586433c..2cbc824289c1 100644 --- a/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/doc-links", + "@kbn/core-base-server-internal", + "@kbn/core-base-server-mocks", + "@kbn/core-doc-links-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel b/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel deleted file mode 100644 index 546564f9f581..000000000000 --- a/packages/core/doc-links/core-doc-links-server-mocks/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-doc-links", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-doc-links:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:npm_module_types", - "//packages/core/doc-links/core-doc-links-server:npm_module_types", - "//packages/core/doc-links/core-doc-links-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-server-mocks/kibana.jsonc b/packages/core/doc-links/core-doc-links-server-mocks/kibana.jsonc index 5d61cf066d31..76c59c8f5b31 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-server-mocks/package.json b/packages/core/doc-links/core-doc-links-server-mocks/package.json index 7d15b2ecb0a7..b3a6f1f05aa1 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/package.json +++ b/packages/core/doc-links/core-doc-links-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-doc-links-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json b/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json index ef521586433c..7ffdec8e985d 100644 --- a/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/doc-links", + "@kbn/core-doc-links-server", + "@kbn/core-doc-links-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/doc-links/core-doc-links-server/BUILD.bazel b/packages/core/doc-links/core-doc-links-server/BUILD.bazel deleted file mode 100644 index b670b86f3b41..000000000000 --- a/packages/core/doc-links/core-doc-links-server/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-doc-links-server" -PKG_REQUIRE_NAME = "@kbn/core-doc-links-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-doc-links:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/doc-links/core-doc-links-server/kibana.jsonc b/packages/core/doc-links/core-doc-links-server/kibana.jsonc index e0460f4da99b..74063c462a4b 100644 --- a/packages/core/doc-links/core-doc-links-server/kibana.jsonc +++ b/packages/core/doc-links/core-doc-links-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-doc-links-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/doc-links/core-doc-links-server/package.json b/packages/core/doc-links/core-doc-links-server/package.json index 98e82071c1af..891b6e625ec7 100644 --- a/packages/core/doc-links/core-doc-links-server/package.json +++ b/packages/core/doc-links/core-doc-links-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-doc-links-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/doc-links/core-doc-links-server/tsconfig.json b/packages/core/doc-links/core-doc-links-server/tsconfig.json index ef521586433c..68b5d3d0d019 100644 --- a/packages/core/doc-links/core-doc-links-server/tsconfig.json +++ b/packages/core/doc-links/core-doc-links-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/doc-links" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel deleted file mode 100644 index af435dff173a..000000000000 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-elasticsearch-client-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-client-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//moment", - "@npm//@elastic/elasticsearch", - "@npm//@elastic/numeral", - "//packages/kbn-std", - "//packages/kbn-es-errors", - "//packages/core/http/core-http-router-server-internal", - ### test dependencies - "//packages/core/logging/core-logging-server-mocks", - "//packages/core/http/core-http-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "@npm//@elastic/elasticsearch", - "@npm//@elastic/numeral", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-es-errors:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-router-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/kibana.jsonc b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/kibana.jsonc index e2393e888d5d..064e503803d9 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/kibana.jsonc +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-elasticsearch-client-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json index 26a5453f7deb..393f1c5418ff 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-elasticsearch-client-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json index ef521586433c..d43e5bcbe630 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,20 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/std", + "@kbn/es-errors", + "@kbn/logging", + "@kbn/core-http-server", + "@kbn/core-http-router-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/logging-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-http-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel deleted file mode 100644 index 903df3a4bf66..000000000000 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-elasticsearch-client-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-client-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/elasticsearch", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/kibana.jsonc b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/kibana.jsonc index ae267b45ddc1..234f583289e7 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/kibana.jsonc +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-elasticsearch-client-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json index 2e40a2411c6f..481aeec61ba6 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-elasticsearch-client-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json index ef521586433c..961653f7e4c0 100644 --- a/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-client-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel deleted file mode 100644 index a609d040b08f..000000000000 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/BUILD.bazel +++ /dev/null @@ -1,140 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-elasticsearch-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//semver", - "@npm//moment", - "@npm//@elastic/elasticsearch", - "//packages/kbn-std", - "//packages/kbn-i18n", - "//packages/kbn-crypto", - "//packages/kbn-config-schema", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", - ### test dependencies - "//packages/kbn-config-mocks", - "//packages/core/logging/core-logging-server-mocks", - "//packages/core/analytics/core-analytics-server-mocks", - "//packages/core/execution-context/core-execution-context-server-mocks", - "//packages/core/http/core-http-server-mocks", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", - "//packages/core/config/core-config-server-internal", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//@types/semver", - "@npm//moment", - "@npm//@elastic/elasticsearch", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-crypto:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", - "//packages/core/test-helpers/core-test-helpers-deprecations-getters:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/kibana.jsonc b/packages/core/elasticsearch/core-elasticsearch-server-internal/kibana.jsonc index 34ea515ba045..d7d99fa587f4 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/kibana.jsonc +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-elasticsearch-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json index 7da243a2ddd9..01035adcda8b 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-elasticsearch-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts index ecd364b4283c..f523cfe8c4a8 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/src/elasticsearch_service.test.ts @@ -21,7 +21,7 @@ import { MockClusterClient, isScriptingEnabledMock } from './elasticsearch_servi import type { NodesVersionCompatibility } from './version_check/ensure_es_version'; import { BehaviorSubject, firstValueFrom } from 'rxjs'; import { first, concatMap } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { configServiceMock, getEnvOptions } from '@kbn/config-mocks'; import type { CoreContext } from '@kbn/core-base-server-internal'; diff --git a/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json index ef521586433c..7b444c90f62c 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,33 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/std", + "@kbn/logging", + "@kbn/i18n", + "@kbn/crypto", + "@kbn/config-schema", + "@kbn/core-base-server-internal", + "@kbn/core-status-common", + "@kbn/core-analytics-server", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-execution-context-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/core-test-helpers-deprecations-getters", + "@kbn/config", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-analytics-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/repo-info", + "@kbn/config-mocks", + "@kbn/core-execution-context-server-mocks", + "@kbn/core-http-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel deleted file mode 100644 index bfc62c14edd0..000000000000 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/BUILD.bazel +++ /dev/null @@ -1,109 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-elasticsearch-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/kibana.jsonc b/packages/core/elasticsearch/core-elasticsearch-server-mocks/kibana.jsonc index d08d5d04cbb3..07c507160e1b 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/kibana.jsonc +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-elasticsearch-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json index 4bfdb9ae4350..8e5774d75f6a 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-elasticsearch-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json index ef521586433c..ee0d179f2201 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-status-common", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-elasticsearch-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel b/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel deleted file mode 100644 index b21a8c7febbb..000000000000 --- a/packages/core/elasticsearch/core-elasticsearch-server/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-elasticsearch-server" -PKG_REQUIRE_NAME = "@kbn/core-elasticsearch-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "@npm//@elastic/elasticsearch", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-es-errors:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/elasticsearch/core-elasticsearch-server/kibana.jsonc b/packages/core/elasticsearch/core-elasticsearch-server/kibana.jsonc index 5bf72319cc41..0cc1c07fa2b3 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/kibana.jsonc +++ b/packages/core/elasticsearch/core-elasticsearch-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-elasticsearch-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/elasticsearch/core-elasticsearch-server/package.json b/packages/core/elasticsearch/core-elasticsearch-server/package.json index 3c922fc3fff6..db40eec90146 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/package.json +++ b/packages/core/elasticsearch/core-elasticsearch-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-elasticsearch-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json index ef521586433c..88e18c12e41e 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json +++ b/packages/core/elasticsearch/core-elasticsearch-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/es-errors", + "@kbn/core-http-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/environment/core-environment-server-internal/BUILD.bazel b/packages/core/environment/core-environment-server-internal/BUILD.bazel deleted file mode 100644 index 02787bec3ad6..000000000000 --- a/packages/core/environment/core-environment-server-internal/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-environment-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-environment-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//lodash", - "@npm//uuid", - "//packages/core/base/core-base-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//rxjs", - "@npm//lodash", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/logging/core-logging-server-mocks:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/environment/core-environment-server-internal/kibana.jsonc b/packages/core/environment/core-environment-server-internal/kibana.jsonc index 9d8de1124ce0..c25c03c1a433 100644 --- a/packages/core/environment/core-environment-server-internal/kibana.jsonc +++ b/packages/core/environment/core-environment-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-environment-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/environment/core-environment-server-internal/package.json b/packages/core/environment/core-environment-server-internal/package.json index 4be8f11e12fc..698f7c88923e 100644 --- a/packages/core/environment/core-environment-server-internal/package.json +++ b/packages/core/environment/core-environment-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-environment-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/environment/core-environment-server-internal/tsconfig.json b/packages/core/environment/core-environment-server-internal/tsconfig.json index ef521586433c..b1853e14a9ea 100644 --- a/packages/core/environment/core-environment-server-internal/tsconfig.json +++ b/packages/core/environment/core-environment-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,20 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utils", + "@kbn/logging", + "@kbn/config", + "@kbn/core-base-server-internal", + "@kbn/core-analytics-server", + "@kbn/core-logging-server-mocks", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-analytics-server-mocks", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/environment/core-environment-server-mocks/BUILD.bazel b/packages/core/environment/core-environment-server-mocks/BUILD.bazel deleted file mode 100644 index 99bb5420b568..000000000000 --- a/packages/core/environment/core-environment-server-mocks/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-environment-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-environment-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/environment/core-environment-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/environment/core-environment-server-mocks/kibana.jsonc b/packages/core/environment/core-environment-server-mocks/kibana.jsonc index 6644816727a7..6905db81b1d9 100644 --- a/packages/core/environment/core-environment-server-mocks/kibana.jsonc +++ b/packages/core/environment/core-environment-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-environment-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/environment/core-environment-server-mocks/package.json b/packages/core/environment/core-environment-server-mocks/package.json index c8de3e7c69ac..3d8c7cb8525c 100644 --- a/packages/core/environment/core-environment-server-mocks/package.json +++ b/packages/core/environment/core-environment-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-environment-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/environment/core-environment-server-mocks/tsconfig.json b/packages/core/environment/core-environment-server-mocks/tsconfig.json index ef521586433c..a3529d5cdb9f 100644 --- a/packages/core/environment/core-environment-server-mocks/tsconfig.json +++ b/packages/core/environment/core-environment-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-environment-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel deleted file mode 100644 index 5dafaa8a707c..000000000000 --- a/packages/core/execution-context/core-execution-context-browser-internal/BUILD.bazel +++ /dev/null @@ -1,117 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "//packages/core/analytics/core-analytics-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/analytics/core-analytics-browser:npm_module_types", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-browser-internal/kibana.jsonc b/packages/core/execution-context/core-execution-context-browser-internal/kibana.jsonc index 1771d94a14b8..36f56a25426a 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-browser-internal/package.json b/packages/core/execution-context/core-execution-context-browser-internal/package.json index 448610f80f57..601ce7cce3ec 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/package.json +++ b/packages/core/execution-context/core-execution-context-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-execution-context-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json b/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json index ef521586433c..a8301ada1eaa 100644 --- a/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-base-browser-internal", + "@kbn/core-analytics-browser", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-execution-context-common", + "@kbn/core-execution-context-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel deleted file mode 100644 index f47b874438a3..000000000000 --- a/packages/core/execution-context/core-execution-context-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/kibana.jsonc b/packages/core/execution-context/core-execution-context-browser-mocks/kibana.jsonc index 8d27a9ec919d..63963af90bdf 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/package.json b/packages/core/execution-context/core-execution-context-browser-mocks/package.json index e6e278b62aec..79332249636a 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/package.json +++ b/packages/core/execution-context/core-execution-context-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-execution-context-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json b/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json index ef521586433c..39e9576ba62e 100644 --- a/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-execution-context-browser", + "@kbn/core-execution-context-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-browser/BUILD.bazel b/packages/core/execution-context/core-execution-context-browser/BUILD.bazel deleted file mode 100644 index bd66cba6f771..000000000000 --- a/packages/core/execution-context/core-execution-context-browser/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-browser" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-browser/kibana.jsonc b/packages/core/execution-context/core-execution-context-browser/kibana.jsonc index 550d63fc67de..ee8dd2fad5eb 100644 --- a/packages/core/execution-context/core-execution-context-browser/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-browser/package.json b/packages/core/execution-context/core-execution-context-browser/package.json index fe065da833ba..c45034545871 100644 --- a/packages/core/execution-context/core-execution-context-browser/package.json +++ b/packages/core/execution-context/core-execution-context-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-execution-context-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-browser/tsconfig.json b/packages/core/execution-context/core-execution-context-browser/tsconfig.json index ef521586433c..b240bd7f5bc8 100644 --- a/packages/core/execution-context/core-execution-context-browser/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-execution-context-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-common/BUILD.bazel b/packages/core/execution-context/core-execution-context-common/BUILD.bazel deleted file mode 100644 index 2346a268246e..000000000000 --- a/packages/core/execution-context/core-execution-context-common/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-common" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-common/kibana.jsonc b/packages/core/execution-context/core-execution-context-common/kibana.jsonc index d3cf33be164d..4775632a026b 100644 --- a/packages/core/execution-context/core-execution-context-common/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-common/package.json b/packages/core/execution-context/core-execution-context-common/package.json index 8811373e3843..e8bc5a341ca8 100644 --- a/packages/core/execution-context/core-execution-context-common/package.json +++ b/packages/core/execution-context/core-execution-context-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-execution-context-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-common/tsconfig.json b/packages/core/execution-context/core-execution-context-common/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/execution-context/core-execution-context-common/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel b/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel deleted file mode 100644 index bc44df8b7520..000000000000 --- a/packages/core/execution-context/core-execution-context-server-internal/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "//packages/kbn-config-schema", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//rxjs", - "@npm//elastic-apm-node", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", - "//packages/core/execution-context/core-execution-context-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-server-internal/kibana.jsonc b/packages/core/execution-context/core-execution-context-server-internal/kibana.jsonc index d344f53f34f5..7da11bd3d457 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-server-internal/package.json b/packages/core/execution-context/core-execution-context-server-internal/package.json index 40e2e6b7d1a2..aceeec16d11e 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/package.json +++ b/packages/core/execution-context/core-execution-context-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-execution-context-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json b/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json index ef521586433c..ecaf9eb98cc5 100644 --- a/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,17 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-execution-context-common", + "@kbn/core-execution-context-server", + "@kbn/core-base-server-mocks", + "@kbn/core-logging-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel b/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel deleted file mode 100644 index 4f20c479b8de..000000000000 --- a/packages/core/execution-context/core-execution-context-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", - "//packages/core/execution-context/core-execution-context-server:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-server-mocks/kibana.jsonc b/packages/core/execution-context/core-execution-context-server-mocks/kibana.jsonc index e73d0b4f9b21..05ebf05ec64b 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-server-mocks/package.json b/packages/core/execution-context/core-execution-context-server-mocks/package.json index 398a5984a456..1b5660f4ba2c 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/package.json +++ b/packages/core/execution-context/core-execution-context-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-execution-context-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json b/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json index ef521586433c..3b28753beb43 100644 --- a/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-execution-context-common", + "@kbn/core-execution-context-server", + "@kbn/core-execution-context-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/execution-context/core-execution-context-server/BUILD.bazel b/packages/core/execution-context/core-execution-context-server/BUILD.bazel deleted file mode 100644 index 8b50d3351a8c..000000000000 --- a/packages/core/execution-context/core-execution-context-server/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-execution-context-server" -PKG_REQUIRE_NAME = "@kbn/core-execution-context-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//elastic-apm-node", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/execution-context/core-execution-context-server/kibana.jsonc b/packages/core/execution-context/core-execution-context-server/kibana.jsonc index 5de7baaaccb3..3249180ad327 100644 --- a/packages/core/execution-context/core-execution-context-server/kibana.jsonc +++ b/packages/core/execution-context/core-execution-context-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-execution-context-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/execution-context/core-execution-context-server/package.json b/packages/core/execution-context/core-execution-context-server/package.json index 898c44da57f1..84e77a89939d 100644 --- a/packages/core/execution-context/core-execution-context-server/package.json +++ b/packages/core/execution-context/core-execution-context-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-execution-context-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/execution-context/core-execution-context-server/tsconfig.json b/packages/core/execution-context/core-execution-context-server/tsconfig.json index ef521586433c..b240bd7f5bc8 100644 --- a/packages/core/execution-context/core-execution-context-server/tsconfig.json +++ b/packages/core/execution-context/core-execution-context-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-execution-context-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel deleted file mode 100644 index bd1cf9b24002..000000000000 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-fatal-errors-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-fatal-errors-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//rxjs", - "@npm//@elastic/eui", - "//packages/core/theme/core-theme-browser-internal", - "//packages/core/theme/core-theme-browser-mocks", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "//packages/kbn-i18n-react", - "//packages/kbn-test-jest-helpers", - "//packages/kbn-test-subj-selector", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-dom", - "@npm//rxjs", - "@npm//@elastic/eui", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-test-jest-helpers", - "//packages/kbn-test-subj-selector", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/kibana.jsonc b/packages/core/fatal-errors/core-fatal-errors-browser-internal/kibana.jsonc index 76752593fd00..5b5b044518d5 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/kibana.jsonc +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-fatal-errors-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json b/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json index 327573f65a50..aa45271c86bb 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-fatal-errors-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json index c561d9f22012..0e892d0a955e 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,20 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-theme-browser", + "@kbn/core-theme-browser-internal", + "@kbn/core-i18n-browser", + "@kbn/core-fatal-errors-browser", + "@kbn/i18n-react", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/test-subj-selector", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel deleted file mode 100644 index cc6407d5d9e3..000000000000 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-fatal-errors-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-fatal-errors-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal:npm_module_types", - "//packages/kbn-utility-types:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/kibana.jsonc b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/kibana.jsonc index 6109111801eb..61cb6496a241 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/kibana.jsonc +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-fatal-errors-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json index edc9e1832b14..906b532c1fb9 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-fatal-errors-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json index 3cdea36de9ea..ee791562dfd8 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-fatal-errors-browser", + "@kbn/core-fatal-errors-browser-internal", + "@kbn/utility-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel b/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel deleted file mode 100644 index 680205ac2db2..000000000000 --- a/packages/core/fatal-errors/core-fatal-errors-browser/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-fatal-errors-browser" -PKG_REQUIRE_NAME = "@kbn/core-fatal-errors-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//rxjs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/kibana.jsonc b/packages/core/fatal-errors/core-fatal-errors-browser/kibana.jsonc index 95423568bca9..a8e767039230 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/kibana.jsonc +++ b/packages/core/fatal-errors/core-fatal-errors-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-fatal-errors-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/package.json b/packages/core/fatal-errors/core-fatal-errors-browser/package.json index 880780bb73c0..4e40d1aa3edd 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/package.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-fatal-errors-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json b/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json index 3cdea36de9ea..0f16c2b9311d 100644 --- a/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json +++ b/packages/core/fatal-errors/core-fatal-errors-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-browser-internal/BUILD.bazel b/packages/core/http/core-http-browser-internal/BUILD.bazel deleted file mode 100644 index 5f46ac65c2c2..000000000000 --- a/packages/core/http/core-http-browser-internal/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "//packages/core/execution-context/core-execution-context-browser-internal", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "//packages/kbn-crypto-browser", - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/http/core-http-common:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/kbn-crypto-browser:npm_module_types", - "//packages/kbn-std:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-browser-internal/kibana.jsonc b/packages/core/http/core-http-browser-internal/kibana.jsonc index d5855d71ca17..aca4d4765668 100644 --- a/packages/core/http/core-http-browser-internal/kibana.jsonc +++ b/packages/core/http/core-http-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-browser-internal/package.json b/packages/core/http/core-http-browser-internal/package.json index f61b71cc8d6e..e2558c9cf2ae 100644 --- a/packages/core/http/core-http-browser-internal/package.json +++ b/packages/core/http/core-http-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-http-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-browser-internal/tsconfig.json b/packages/core/http/core-http-browser-internal/tsconfig.json index ef521586433c..382c591951eb 100644 --- a/packages/core/http/core-http-browser-internal/tsconfig.json +++ b/packages/core/http/core-http-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,23 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-base-browser-internal", + "@kbn/core-http-browser", + "@kbn/core-http-common", + "@kbn/core-execution-context-browser-internal", + "@kbn/core-execution-context-browser", + "@kbn/core-fatal-errors-browser", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/crypto-browser", + "@kbn/std", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-browser-mocks/BUILD.bazel b/packages/core/http/core-http-browser-mocks/BUILD.bazel deleted file mode 100644 index f951d30645a7..000000000000 --- a/packages/core/http/core-http-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-http-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/http/core-http-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/http/core-http-browser-internal:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-browser-mocks/kibana.jsonc b/packages/core/http/core-http-browser-mocks/kibana.jsonc index 9819977cb419..929adb25ee47 100644 --- a/packages/core/http/core-http-browser-mocks/kibana.jsonc +++ b/packages/core/http/core-http-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-browser-mocks/package.json b/packages/core/http/core-http-browser-mocks/package.json index 85d397fcb301..2f6d39a345de 100644 --- a/packages/core/http/core-http-browser-mocks/package.json +++ b/packages/core/http/core-http-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-http-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-browser-mocks/tsconfig.json b/packages/core/http/core-http-browser-mocks/tsconfig.json index ef521586433c..e370c748ef29 100644 --- a/packages/core/http/core-http-browser-mocks/tsconfig.json +++ b/packages/core/http/core-http-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-http-browser-internal", + "@kbn/core-http-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-browser/BUILD.bazel b/packages/core/http/core-http-browser/BUILD.bazel deleted file mode 100644 index f0566749a620..000000000000 --- a/packages/core/http/core-http-browser/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-browser" -PKG_REQUIRE_NAME = "@kbn/core-http-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/execution-context/core-execution-context-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-browser/kibana.jsonc b/packages/core/http/core-http-browser/kibana.jsonc index 87510d65336e..8c1fdee8d329 100644 --- a/packages/core/http/core-http-browser/kibana.jsonc +++ b/packages/core/http/core-http-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-browser/package.json b/packages/core/http/core-http-browser/package.json index 6124448731b9..0c1dd7495fb9 100644 --- a/packages/core/http/core-http-browser/package.json +++ b/packages/core/http/core-http-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-http-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-browser/tsconfig.json b/packages/core/http/core-http-browser/tsconfig.json index ef521586433c..ae85ff081604 100644 --- a/packages/core/http/core-http-browser/tsconfig.json +++ b/packages/core/http/core-http-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-execution-context-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-common/BUILD.bazel b/packages/core/http/core-http-common/BUILD.bazel deleted file mode 100644 index 4852f4c69dcb..000000000000 --- a/packages/core/http/core-http-common/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-common" -PKG_REQUIRE_NAME = "@kbn/core-http-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-common/kibana.jsonc b/packages/core/http/core-http-common/kibana.jsonc index bdf00df353c6..372eaf2d892a 100644 --- a/packages/core/http/core-http-common/kibana.jsonc +++ b/packages/core/http/core-http-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-common/package.json b/packages/core/http/core-http-common/package.json index 42a7a24c829e..83275f6a576c 100644 --- a/packages/core/http/core-http-common/package.json +++ b/packages/core/http/core-http-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-http-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-common/tsconfig.json b/packages/core/http/core-http-common/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/http/core-http-common/tsconfig.json +++ b/packages/core/http/core-http-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-context-server-internal/BUILD.bazel b/packages/core/http/core-http-context-server-internal/BUILD.bazel deleted file mode 100644 index 93229dd4f2ee..000000000000 --- a/packages/core/http/core-http-context-server-internal/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-context-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-context-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.mocks.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-common-internal:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-context-server-internal/kibana.jsonc b/packages/core/http/core-http-context-server-internal/kibana.jsonc index 18f306d72175..434d1c305567 100644 --- a/packages/core/http/core-http-context-server-internal/kibana.jsonc +++ b/packages/core/http/core-http-context-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-context-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-context-server-internal/package.json b/packages/core/http/core-http-context-server-internal/package.json index 3c43287f8131..58171795a82c 100644 --- a/packages/core/http/core-http-context-server-internal/package.json +++ b/packages/core/http/core-http-context-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-context-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-context-server-internal/tsconfig.json b/packages/core/http/core-http-context-server-internal/tsconfig.json index ef521586433c..0caeb0d5e009 100644 --- a/packages/core/http/core-http-context-server-internal/tsconfig.json +++ b/packages/core/http/core-http-context-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-base-common", + "@kbn/core-base-common-internal", + "@kbn/core-base-server-internal", + "@kbn/core-http-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-context-server-mocks/BUILD.bazel b/packages/core/http/core-http-context-server-mocks/BUILD.bazel deleted file mode 100644 index e6deb74b09ab..000000000000 --- a/packages/core/http/core-http-context-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-context-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-http-context-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-context-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-context-server-mocks/kibana.jsonc b/packages/core/http/core-http-context-server-mocks/kibana.jsonc index 323d78350596..aee5e424e6d3 100644 --- a/packages/core/http/core-http-context-server-mocks/kibana.jsonc +++ b/packages/core/http/core-http-context-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-context-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-context-server-mocks/package.json b/packages/core/http/core-http-context-server-mocks/package.json index a45376bd7c46..b04f6ca97de7 100644 --- a/packages/core/http/core-http-context-server-mocks/package.json +++ b/packages/core/http/core-http-context-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-context-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-context-server-mocks/tsconfig.json b/packages/core/http/core-http-context-server-mocks/tsconfig.json index ef521586433c..a47257e63f05 100644 --- a/packages/core/http/core-http-context-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-context-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-http-server", + "@kbn/core-http-context-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel b/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel deleted file mode 100644 index af501978f324..000000000000 --- a/packages/core/http/core-http-request-handler-context-server-internal/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-request-handler-context-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-request-handler-context-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/elasticsearch/core-elasticsearch-server-internal", - "//packages/core/saved-objects/core-saved-objects-server-internal", - "//packages/core/deprecations/core-deprecations-server-internal", - "//packages/core/ui-settings/core-ui-settings-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-server-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-request-handler-context-server-internal/kibana.jsonc b/packages/core/http/core-http-request-handler-context-server-internal/kibana.jsonc index 98b452aec0d9..5e5099ff6933 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/kibana.jsonc +++ b/packages/core/http/core-http-request-handler-context-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-request-handler-context-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-request-handler-context-server-internal/package.json b/packages/core/http/core-http-request-handler-context-server-internal/package.json index 15efa6e69096..4569a702d999 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/package.json +++ b/packages/core/http/core-http-request-handler-context-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-request-handler-context-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json b/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json index 4582562d6c9b..5a15616fd2e5 100644 --- a/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json +++ b/packages/core/http/core-http-request-handler-context-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,22 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-http-server", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-deprecations-server-internal", + "@kbn/core-ui-settings-server", + "@kbn/core-ui-settings-server-internal", + "@kbn/core-http-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/core-deprecations-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-request-handler-context-server/BUILD.bazel b/packages/core/http/core-http-request-handler-context-server/BUILD.bazel deleted file mode 100644 index 6ca6411dbfbd..000000000000 --- a/packages/core/http/core-http-request-handler-context-server/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-request-handler-context-server" -PKG_REQUIRE_NAME = "@kbn/core-http-request-handler-context-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-request-handler-context-server/kibana.jsonc b/packages/core/http/core-http-request-handler-context-server/kibana.jsonc index 3fba38b6444e..488812d9ae1f 100644 --- a/packages/core/http/core-http-request-handler-context-server/kibana.jsonc +++ b/packages/core/http/core-http-request-handler-context-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-request-handler-context-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-request-handler-context-server/package.json b/packages/core/http/core-http-request-handler-context-server/package.json index 665e4f309631..fb9273711078 100644 --- a/packages/core/http/core-http-request-handler-context-server/package.json +++ b/packages/core/http/core-http-request-handler-context-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-request-handler-context-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-request-handler-context-server/tsconfig.json b/packages/core/http/core-http-request-handler-context-server/tsconfig.json index 4582562d6c9b..64112effbcc1 100644 --- a/packages/core/http/core-http-request-handler-context-server/tsconfig.json +++ b/packages/core/http/core-http-request-handler-context-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-http-server", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-server", + "@kbn/core-deprecations-server", + "@kbn/core-ui-settings-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-resources-server-internal/BUILD.bazel b/packages/core/http/core-http-resources-server-internal/BUILD.bazel deleted file mode 100644 index 3c299b5442eb..000000000000 --- a/packages/core/http/core-http-resources-server-internal/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-resources-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-resources-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//elastic-apm-node", - "//packages/kbn-logging", - "//packages/kbn-apm-config-loader", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//elastic-apm-node", - "//packages/kbn-apm-config-loader:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-resources-server:npm_module_types", - "//packages/core/rendering/core-rendering-server-internal:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-resources-server-internal/kibana.jsonc b/packages/core/http/core-http-resources-server-internal/kibana.jsonc index bea96a4a6084..5aaa476b2b77 100644 --- a/packages/core/http/core-http-resources-server-internal/kibana.jsonc +++ b/packages/core/http/core-http-resources-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-resources-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-resources-server-internal/package.json b/packages/core/http/core-http-resources-server-internal/package.json index 70144170ed0b..d491c4940f81 100644 --- a/packages/core/http/core-http-resources-server-internal/package.json +++ b/packages/core/http/core-http-resources-server-internal/package.json @@ -2,7 +2,5 @@ "name": "@kbn/core-http-resources-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-resources-server-internal/tsconfig.json b/packages/core/http/core-http-resources-server-internal/tsconfig.json index 4582562d6c9b..446edf289417 100644 --- a/packages/core/http/core-http-resources-server-internal/tsconfig.json +++ b/packages/core/http/core-http-resources-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,22 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/apm-config-loader", + "@kbn/logging", + "@kbn/core-http-server", + "@kbn/core-http-resources-server", + "@kbn/core-rendering-server-internal", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-http-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-rendering-server-mocks", + "@kbn/core-base-server-internal", + "@kbn/core-http-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-resources-server-mocks/BUILD.bazel b/packages/core/http/core-http-resources-server-mocks/BUILD.bazel deleted file mode 100644 index 5060511ec65e..000000000000 --- a/packages/core/http/core-http-resources-server-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-resources-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-http-resources-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/http/core-http-server-mocks", - "//packages/core/http/core-http-resources-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/http/core-http-server-mocks:npm_module_types", - "//packages/core/http/core-http-resources-server:npm_module_types", - "//packages/core/http/core-http-resources-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-resources-server-mocks/kibana.jsonc b/packages/core/http/core-http-resources-server-mocks/kibana.jsonc index e8703bdd42aa..fee811ff5d48 100644 --- a/packages/core/http/core-http-resources-server-mocks/kibana.jsonc +++ b/packages/core/http/core-http-resources-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-resources-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-resources-server-mocks/package.json b/packages/core/http/core-http-resources-server-mocks/package.json index 7a264c389f64..cbc4795106a1 100644 --- a/packages/core/http/core-http-resources-server-mocks/package.json +++ b/packages/core/http/core-http-resources-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-resources-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-resources-server-mocks/tsconfig.json b/packages/core/http/core-http-resources-server-mocks/tsconfig.json index 4582562d6c9b..d4b986317e6a 100644 --- a/packages/core/http/core-http-resources-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-resources-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-http-server-mocks", + "@kbn/core-http-resources-server", + "@kbn/core-http-resources-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-resources-server/BUILD.bazel b/packages/core/http/core-http-resources-server/BUILD.bazel deleted file mode 100644 index a17973e8d5e6..000000000000 --- a/packages/core/http/core-http-resources-server/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-resources-server" -PKG_REQUIRE_NAME = "@kbn/core-http-resources-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-resources-server/kibana.jsonc b/packages/core/http/core-http-resources-server/kibana.jsonc index a05c1223a781..dd204cfcd25e 100644 --- a/packages/core/http/core-http-resources-server/kibana.jsonc +++ b/packages/core/http/core-http-resources-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-resources-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-resources-server/package.json b/packages/core/http/core-http-resources-server/package.json index ecf7f2691ae9..43b494116cf5 100644 --- a/packages/core/http/core-http-resources-server/package.json +++ b/packages/core/http/core-http-resources-server/package.json @@ -2,7 +2,5 @@ "name": "@kbn/core-http-resources-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-resources-server/tsconfig.json b/packages/core/http/core-http-resources-server/tsconfig.json index 4582562d6c9b..3f8e3b88aece 100644 --- a/packages/core/http/core-http-resources-server/tsconfig.json +++ b/packages/core/http/core-http-resources-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-http-server", + "@kbn/core-http-request-handler-context-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-router-server-internal/BUILD.bazel b/packages/core/http/core-http-router-server-internal/BUILD.bazel deleted file mode 100644 index 511f84695274..000000000000 --- a/packages/core/http/core-http-router-server-internal/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-router-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-router-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//@hapi/boom", - "@npm//uuid", - "@npm//rxjs", - "@npm//type-detect", - "//packages/kbn-config-schema", - "//packages/kbn-es-errors", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//type-detect", - "@npm//@hapi/hapi", - "@npm//@types/hapi__hapi", - "@npm//@hapi/boom", - "@npm//rxjs", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-es-errors:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-router-server-internal/kibana.jsonc b/packages/core/http/core-http-router-server-internal/kibana.jsonc index 5f7482d9fa06..329d03a5490c 100644 --- a/packages/core/http/core-http-router-server-internal/kibana.jsonc +++ b/packages/core/http/core-http-router-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-router-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-router-server-internal/package.json b/packages/core/http/core-http-router-server-internal/package.json index 6bf05d2b0d2c..b93c901bae3d 100644 --- a/packages/core/http/core-http-router-server-internal/package.json +++ b/packages/core/http/core-http-router-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-router-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-router-server-internal/tsconfig.json b/packages/core/http/core-http-router-server-internal/tsconfig.json index ef521586433c..347f4b416226 100644 --- a/packages/core/http/core-http-router-server-internal/tsconfig.json +++ b/packages/core/http/core-http-router-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/std", + "@kbn/utility-types", + "@kbn/config-schema", + "@kbn/es-errors", + "@kbn/core-http-server", + "@kbn/hapi-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/logging", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-router-server-mocks/BUILD.bazel b/packages/core/http/core-http-router-server-mocks/BUILD.bazel deleted file mode 100644 index 867785d47170..000000000000 --- a/packages/core/http/core-http-router-server-mocks/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-router-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-http-router-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//query-string", - "//packages/kbn-hapi-mocks", - "//packages/kbn-config-schema", - "//packages/core/http/core-http-router-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//query-string", - "//packages/kbn-hapi-mocks:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-router-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-router-server-mocks/kibana.jsonc b/packages/core/http/core-http-router-server-mocks/kibana.jsonc index a1883a9c92ff..a00b5ef3bdf1 100644 --- a/packages/core/http/core-http-router-server-mocks/kibana.jsonc +++ b/packages/core/http/core-http-router-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-router-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-router-server-mocks/package.json b/packages/core/http/core-http-router-server-mocks/package.json index 578109fa9e5b..679793dab805 100644 --- a/packages/core/http/core-http-router-server-mocks/package.json +++ b/packages/core/http/core-http-router-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-router-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-router-server-mocks/tsconfig.json b/packages/core/http/core-http-router-server-mocks/tsconfig.json index ef521586433c..4504850612be 100644 --- a/packages/core/http/core-http-router-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-router-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/hapi-mocks", + "@kbn/config-schema", + "@kbn/core-http-server", + "@kbn/core-http-router-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-server-internal/BUILD.bazel b/packages/core/http/core-http-server-internal/BUILD.bazel deleted file mode 100644 index a5457aca25e0..000000000000 --- a/packages/core/http/core-http-server-internal/BUILD.bazel +++ /dev/null @@ -1,153 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-http-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "@npm//uuid", - "@npm//moment", - "@npm//@elastic/numeral", - "@npm//@hapi/boom", - "@npm//@hapi/cookie", - "@npm//@hapi/inert", - "@npm//elastic-apm-node", - "@npm//brok", - "//packages/kbn-utils", - "//packages/kbn-std", - "//packages/kbn-config-schema", - "//packages/kbn-logging", - "//packages/kbn-crypto", - "//packages/kbn-server-http-tools", - "//packages/core/http/core-http-router-server-internal", - ### test dependencies - "@npm//supertest", - "@npm//chance", - "//packages/kbn-hapi-mocks", - "//packages/core/http/core-http-router-server-mocks", - "//packages/core/logging/core-logging-server-mocks", - "//packages/core/http/core-http-context-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//rxjs", - "@npm//moment", - "@npm//@elastic/numeral", - "@npm//lodash", - "@npm//brok", - "@npm//@hapi/hapi", - "@npm//@hapi/boom", - "@npm//@hapi/cookie", - "@npm//@hapi/inert", - "@npm//@types/hapi__hapi", - "@npm//@types/hapi__cookie", - "@npm//@types/hapi__inert", - "@npm//elastic-apm-node", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-server-http-tools:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-crypto:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", - "//packages/core/http/core-http-common:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-context-server-internal:npm_module_types", - "//packages/core/http/core-http-router-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-server-internal/kibana.jsonc b/packages/core/http/core-http-server-internal/kibana.jsonc index 0d1d5b04eaae..984aaa761f17 100644 --- a/packages/core/http/core-http-server-internal/kibana.jsonc +++ b/packages/core/http/core-http-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-server-internal/package.json b/packages/core/http/core-http-server-internal/package.json index 10e06bebc484..7ce5acd43b67 100644 --- a/packages/core/http/core-http-server-internal/package.json +++ b/packages/core/http/core-http-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-server-internal/src/http_service.test.ts b/packages/core/http/core-http-server-internal/src/http_service.test.ts index 8201560c935d..6fe180536e61 100644 --- a/packages/core/http/core-http-server-internal/src/http_service.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_service.test.ts @@ -10,7 +10,7 @@ import { mockHttpServer } from './http_service.test.mocks'; import { noop } from 'lodash'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { hapiMocks } from '@kbn/hapi-mocks'; import { ConfigService, Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; diff --git a/packages/core/http/core-http-server-internal/tsconfig.json b/packages/core/http/core-http-server-internal/tsconfig.json index ef521586433c..e163741c21c7 100644 --- a/packages/core/http/core-http-server-internal/tsconfig.json +++ b/packages/core/http/core-http-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,32 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/std", + "@kbn/server-http-tools", + "@kbn/logging", + "@kbn/config-schema", + "@kbn/crypto", + "@kbn/core-base-common", + "@kbn/core-base-server-internal", + "@kbn/core-execution-context-server-internal", + "@kbn/core-http-common", + "@kbn/core-http-server", + "@kbn/core-http-context-server-internal", + "@kbn/core-http-router-server-internal", + "@kbn/core-http-router-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/dev-utils", + "@kbn/config", + "@kbn/repo-info", + "@kbn/hapi-mocks", + "@kbn/config-mocks", + "@kbn/core-execution-context-server-mocks", + "@kbn/core-http-context-server-mocks", + "@kbn/logging-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-server-mocks/BUILD.bazel b/packages/core/http/core-http-server-mocks/BUILD.bazel deleted file mode 100644 index e5f898bd4f63..000000000000 --- a/packages/core/http/core-http-server-mocks/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-http-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//moment", - "//packages/kbn-hapi-mocks", - "//packages/kbn-config-schema", - "//packages/kbn-config-mocks", - "//packages/core/logging/core-logging-server-mocks", - "//packages/core/http/core-http-router-server-mocks", - "//packages/core/http/core-http-router-server-internal", - "//packages/core/http/core-http-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//moment", - "@npm//@hapi/hapi", - "@npm//@types/hapi__hapi", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-hapi-mocks:npm_module_types", - "//packages/core/logging/core-logging-server-mocks:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-router-server-mocks:npm_module_types", - "//packages/core/http/core-http-router-server-internal:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-server-mocks/kibana.jsonc b/packages/core/http/core-http-server-mocks/kibana.jsonc index 598898176f62..6964e15f6ab8 100644 --- a/packages/core/http/core-http-server-mocks/kibana.jsonc +++ b/packages/core/http/core-http-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-server-mocks/package.json b/packages/core/http/core-http-server-mocks/package.json index e1d3718cfc70..a04777e75202 100644 --- a/packages/core/http/core-http-server-mocks/package.json +++ b/packages/core/http/core-http-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-server-mocks/src/test_utils.ts b/packages/core/http/core-http-server-mocks/src/test_utils.ts index 18e6a21ed2db..17b493e96b86 100644 --- a/packages/core/http/core-http-server-mocks/src/test_utils.ts +++ b/packages/core/http/core-http-server-mocks/src/test_utils.ts @@ -8,7 +8,7 @@ import { BehaviorSubject } from 'rxjs'; import moment from 'moment'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ByteSizeValue } from '@kbn/config-schema'; import { Env } from '@kbn/config'; import { getEnvOptions, configServiceMock } from '@kbn/config-mocks'; diff --git a/packages/core/http/core-http-server-mocks/tsconfig.json b/packages/core/http/core-http-server-mocks/tsconfig.json index ef521586433c..e039916845bb 100644 --- a/packages/core/http/core-http-server-mocks/tsconfig.json +++ b/packages/core/http/core-http-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,21 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/config-mocks", + "@kbn/config-schema", + "@kbn/hapi-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-http-server", + "@kbn/core-http-router-server-mocks", + "@kbn/core-http-server-internal", + "@kbn/repo-info", + "@kbn/config", + "@kbn/core-base-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/http/core-http-server/BUILD.bazel b/packages/core/http/core-http-server/BUILD.bazel deleted file mode 100644 index 128d466207ed..000000000000 --- a/packages/core/http/core-http-server/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-http-server" -PKG_REQUIRE_NAME = "@kbn/core-http-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-config-schema", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//@hapi/hapi", - "@npm//@types/hapi__hapi", - "@npm//@hapi/boom", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/http/core-http-common:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/http/core-http-server/kibana.jsonc b/packages/core/http/core-http-server/kibana.jsonc index da671fec6aae..6ff36f0dea0d 100644 --- a/packages/core/http/core-http-server/kibana.jsonc +++ b/packages/core/http/core-http-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-http-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/http/core-http-server/package.json b/packages/core/http/core-http-server/package.json index 17ad2086c603..5a4cdcaf5fdc 100644 --- a/packages/core/http/core-http-server/package.json +++ b/packages/core/http/core-http-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-http-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/http/core-http-server/tsconfig.json b/packages/core/http/core-http-server/tsconfig.json index ef521586433c..737c4e54906f 100644 --- a/packages/core/http/core-http-server/tsconfig.json +++ b/packages/core/http/core-http-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/core-base-common", + "@kbn/core-http-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel b/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel deleted file mode 100644 index fbfe5f0d565a..000000000000 --- a/packages/core/i18n/core-i18n-browser-internal/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-i18n-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - '//packages/kbn-i18n-react' -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-browser-internal/kibana.jsonc b/packages/core/i18n/core-i18n-browser-internal/kibana.jsonc index 424e9d3dcdbc..40d9d2ffbb86 100644 --- a/packages/core/i18n/core-i18n-browser-internal/kibana.jsonc +++ b/packages/core/i18n/core-i18n-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-browser-internal/package.json b/packages/core/i18n/core-i18n-browser-internal/package.json index b2a27795b466..ca12ff980fb5 100644 --- a/packages/core/i18n/core-i18n-browser-internal/package.json +++ b/packages/core/i18n/core-i18n-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-i18n-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-browser-internal/tsconfig.json b/packages/core/i18n/core-i18n-browser-internal/tsconfig.json index 741519055e98..fe90039b6811 100644 --- a/packages/core/i18n/core-i18n-browser-internal/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-i18n-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel b/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel deleted file mode 100644 index 024b03ca186e..000000000000 --- a/packages/core/i18n/core-i18n-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-i18n-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "//packages/core/i18n/core-i18n-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/i18n/core-i18n-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-browser-mocks/kibana.jsonc b/packages/core/i18n/core-i18n-browser-mocks/kibana.jsonc index 0f5b73ed3b45..b53670e4d626 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/kibana.jsonc +++ b/packages/core/i18n/core-i18n-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-browser-mocks/package.json b/packages/core/i18n/core-i18n-browser-mocks/package.json index b04b9ab71bc6..dd4e0ccb9db5 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/package.json +++ b/packages/core/i18n/core-i18n-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-i18n-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json b/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json index ef521586433c..e7888be88e12 100644 --- a/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-i18n-browser", + "@kbn/core-i18n-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-browser/BUILD.bazel b/packages/core/i18n/core-i18n-browser/BUILD.bazel deleted file mode 100644 index be675f43567f..000000000000 --- a/packages/core/i18n/core-i18n-browser/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-browser" -PKG_REQUIRE_NAME = "@kbn/core-i18n-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-i18n:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-browser/kibana.jsonc b/packages/core/i18n/core-i18n-browser/kibana.jsonc index dcbf951b201f..ef5cba0b357e 100644 --- a/packages/core/i18n/core-i18n-browser/kibana.jsonc +++ b/packages/core/i18n/core-i18n-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-browser/package.json b/packages/core/i18n/core-i18n-browser/package.json index cb97be2e54d9..aa13430095ff 100644 --- a/packages/core/i18n/core-i18n-browser/package.json +++ b/packages/core/i18n/core-i18n-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-i18n-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-browser/tsconfig.json b/packages/core/i18n/core-i18n-browser/tsconfig.json index ef521586433c..6f535b8372d5 100644 --- a/packages/core/i18n/core-i18n-browser/tsconfig.json +++ b/packages/core/i18n/core-i18n-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,10 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-server-internal/BUILD.bazel b/packages/core/i18n/core-i18n-server-internal/BUILD.bazel deleted file mode 100644 index d1885f2ff09c..000000000000 --- a/packages/core/i18n/core-i18n-server-internal/BUILD.bazel +++ /dev/null @@ -1,128 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-i18n-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//json-stable-stringify", - "@npm//globby", - "@npm//rxjs", - "//packages/kbn-config-schema", - "//packages/core/base/core-base-common", - "//packages/kbn-i18n", - "//packages/kbn-utils", - "//packages/kbn-config-mocks", - "//packages/kbn-utility-types", - "//packages/core/base/core-base-server-mocks", - "//packages/core/http/core-http-server-mocks" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/json-stable-stringify", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/deprecations/core-deprecations-common:npm_module_types", - "//packages/core/i18n/core-i18n-server:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-server-internal/kibana.jsonc b/packages/core/i18n/core-i18n-server-internal/kibana.jsonc index 3b89a42976bb..fe63ef9f53f9 100644 --- a/packages/core/i18n/core-i18n-server-internal/kibana.jsonc +++ b/packages/core/i18n/core-i18n-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-server-internal/package.json b/packages/core/i18n/core-i18n-server-internal/package.json index eeee098fa934..752cf62a4f32 100644 --- a/packages/core/i18n/core-i18n-server-internal/package.json +++ b/packages/core/i18n/core-i18n-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-i18n-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.test.ts b/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.test.ts index 89a03c35d66a..76c8ba7c0280 100644 --- a/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.test.ts +++ b/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.test.ts @@ -14,7 +14,7 @@ const mockGetTranslationPaths = getTranslationPaths as jest.Mock; jest.mock('./get_translation_paths', () => ({ getTranslationPaths: jest.fn().mockResolvedValue([]), })); -jest.mock('@kbn/utils', () => ({ +jest.mock('@kbn/repo-info', () => ({ fromRoot: jest.fn().mockImplementation((path: string) => path), })); diff --git a/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.ts b/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.ts index 4e7ee718113c..672ec2f0a3a2 100644 --- a/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.ts +++ b/packages/core/i18n/core-i18n-server-internal/src/get_kibana_translation_files.ts @@ -7,7 +7,7 @@ */ import { basename } from 'path'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { getTranslationPaths } from './get_translation_paths'; export const getKibanaTranslationFiles = async ( diff --git a/packages/core/i18n/core-i18n-server-internal/tsconfig.json b/packages/core/i18n/core-i18n-server-internal/tsconfig.json index 4582562d6c9b..813e3469b746 100644 --- a/packages/core/i18n/core-i18n-server-internal/tsconfig.json +++ b/packages/core/i18n/core-i18n-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,22 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-i18n-server", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/repo-info", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel b/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel deleted file mode 100644 index 0468c8d6b862..000000000000 --- a/packages/core/i18n/core-i18n-server-mocks/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-i18n-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/i18n/core-i18n-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/i18n/core-i18n-server:npm_module_types", - "//packages/core/i18n/core-i18n-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-server-mocks/kibana.jsonc b/packages/core/i18n/core-i18n-server-mocks/kibana.jsonc index 41ef001641b5..7cd0a24565bd 100644 --- a/packages/core/i18n/core-i18n-server-mocks/kibana.jsonc +++ b/packages/core/i18n/core-i18n-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-server-mocks/package.json b/packages/core/i18n/core-i18n-server-mocks/package.json index e53b59962a3b..e7042cd84a16 100644 --- a/packages/core/i18n/core-i18n-server-mocks/package.json +++ b/packages/core/i18n/core-i18n-server-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-i18n-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-server-mocks/tsconfig.json b/packages/core/i18n/core-i18n-server-mocks/tsconfig.json index ef521586433c..f8ed0171fb0a 100644 --- a/packages/core/i18n/core-i18n-server-mocks/tsconfig.json +++ b/packages/core/i18n/core-i18n-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-i18n-server", + "@kbn/core-i18n-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/i18n/core-i18n-server/BUILD.bazel b/packages/core/i18n/core-i18n-server/BUILD.bazel deleted file mode 100644 index ac40679dcbef..000000000000 --- a/packages/core/i18n/core-i18n-server/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-i18n-server" -PKG_REQUIRE_NAME = "@kbn/core-i18n-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/i18n/core-i18n-server/kibana.jsonc b/packages/core/i18n/core-i18n-server/kibana.jsonc index c32d5d9cd8e7..52cd43387a99 100644 --- a/packages/core/i18n/core-i18n-server/kibana.jsonc +++ b/packages/core/i18n/core-i18n-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-i18n-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/i18n/core-i18n-server/package.json b/packages/core/i18n/core-i18n-server/package.json index 6e4c172f5420..cb280a745879 100644 --- a/packages/core/i18n/core-i18n-server/package.json +++ b/packages/core/i18n/core-i18n-server/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-i18n-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/i18n/core-i18n-server/tsconfig.json b/packages/core/i18n/core-i18n-server/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/i18n/core-i18n-server/tsconfig.json +++ b/packages/core/i18n/core-i18n-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel deleted file mode 100644 index 619d355c908f..000000000000 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/BUILD.bazel +++ /dev/null @@ -1,117 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-injected-metadata-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/kibana.jsonc b/packages/core/injected-metadata/core-injected-metadata-browser-internal/kibana.jsonc index d66f834c08eb..efa2b0d56127 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/kibana.jsonc +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-injected-metadata-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json index 107773154a0b..348afceed318 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-injected-metadata-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json index 3cdea36de9ea..a3a2ef572e19 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/std", + "@kbn/ui-shared-deps-npm", + "@kbn/core-base-common", + "@kbn/core-injected-metadata-common-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel deleted file mode 100644 index f4c3fbdec9a1..000000000000 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-injected-metadata-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/kibana.jsonc b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/kibana.jsonc index cfbfae1b907e..340968dde25f 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/kibana.jsonc +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-injected-metadata-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json index 4c96174666f6..94098a16650b 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-injected-metadata-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json index 3cdea36de9ea..236476943bc6 100644 --- a/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-injected-metadata-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel b/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel deleted file mode 100644 index 0540de01bc9c..000000000000 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-injected-metadata-common-internal" -PKG_REQUIRE_NAME = "@kbn/core-injected-metadata-common-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/kibana.jsonc b/packages/core/injected-metadata/core-injected-metadata-common-internal/kibana.jsonc index 88943c788515..c3dcd61159ae 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/kibana.jsonc +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-injected-metadata-common-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json index 7f4052847f18..d3a691a7db3e 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-injected-metadata-common-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json index 3cdea36de9ea..7ff1f2d20bd5 100644 --- a/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json +++ b/packages/core/injected-metadata/core-injected-metadata-common-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config", + "@kbn/ui-shared-deps-npm", + "@kbn/core-base-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel b/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel deleted file mode 100644 index 049424ab2bc9..000000000000 --- a/packages/core/integrations/core-integrations-browser-internal/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-integrations-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-integrations-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.css", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//moment-timezone", - ### test dependencies - "//packages/core/ui-settings/core-ui-settings-browser-mocks" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment-timezone", - "@npm//rxjs", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/integrations/core-integrations-browser-internal/kibana.jsonc b/packages/core/integrations/core-integrations-browser-internal/kibana.jsonc index fd72743c0859..73312e0e70a9 100644 --- a/packages/core/integrations/core-integrations-browser-internal/kibana.jsonc +++ b/packages/core/integrations/core-integrations-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-integrations-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/integrations/core-integrations-browser-internal/package.json b/packages/core/integrations/core-integrations-browser-internal/package.json index a4e0066c114a..6a515cf11da9 100644 --- a/packages/core/integrations/core-integrations-browser-internal/package.json +++ b/packages/core/integrations/core-integrations-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-integrations-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/integrations/core-integrations-browser-internal/tsconfig.json b/packages/core/integrations/core-integrations-browser-internal/tsconfig.json index e1805086a07a..a160ce80ae03 100644 --- a/packages/core/integrations/core-integrations-browser-internal/tsconfig.json +++ b/packages/core/integrations/core-integrations-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,13 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/core-base-browser-internal", + "@kbn/core-ui-settings-browser", + "@kbn/core-ui-settings-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel b/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel deleted file mode 100644 index ce47f36d5853..000000000000 --- a/packages/core/integrations/core-integrations-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-integrations-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-integrations-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/integrations/core-integrations-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/integrations/core-integrations-browser-mocks/kibana.jsonc b/packages/core/integrations/core-integrations-browser-mocks/kibana.jsonc index a4bcddaecba1..3231c3e282bc 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/kibana.jsonc +++ b/packages/core/integrations/core-integrations-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-integrations-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/integrations/core-integrations-browser-mocks/package.json b/packages/core/integrations/core-integrations-browser-mocks/package.json index eea3536fe806..33caac2c4d2a 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/package.json +++ b/packages/core/integrations/core-integrations-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-integrations-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json b/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json index 3cdea36de9ea..71ce10bb0c90 100644 --- a/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json +++ b/packages/core/integrations/core-integrations-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-integrations-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel deleted file mode 100644 index 9cbc08c356fa..000000000000 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/lifecycle/core-lifecycle-browser:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-browser-internal/kibana.jsonc index c552d622aa43..33ea1f94aecc 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/package.json b/packages/core/lifecycle/core-lifecycle-browser-internal/package.json index c78d95efa4f5..1d945c215fe7 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-lifecycle-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json index 61706db827bc..2031aa4b6f6c 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-lifecycle-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-injected-metadata-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel deleted file mode 100644 index b94917a0f63d..000000000000 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/doc-links/core-doc-links-browser-mocks", - "//packages/core/theme/core-theme-browser-mocks", - "//packages/core/analytics/core-analytics-browser-mocks", - "//packages/core/execution-context/core-execution-context-browser-mocks", - "//packages/core/i18n/core-i18n-browser-mocks", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks", - "//packages/core/http/core-http-browser-mocks", - "//packages/core/ui-settings/core-ui-settings-browser-mocks", - "//packages/core/deprecations/core-deprecations-browser-mocks", - "//packages/core/overlays/core-overlays-browser-mocks", - "//packages/core/saved-objects/core-saved-objects-browser-mocks", - "//packages/core/notifications/core-notifications-browser-mocks", - "//packages/core/application/core-application-browser-mocks", - "//packages/core/chrome/core-chrome-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/doc-links/core-doc-links-browser-mocks:npm_module_types", - "//packages/core/theme/core-theme-browser-mocks:npm_module_types", - "//packages/core/analytics/core-analytics-browser-mocks:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser-mocks:npm_module_types", - "//packages/core/i18n/core-i18n-browser-mocks:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks:npm_module_types", - "//packages/core/http/core-http-browser-mocks:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser-mocks:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser-mocks:npm_module_types", - "//packages/core/overlays/core-overlays-browser-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser-mocks:npm_module_types", - "//packages/core/notifications/core-notifications-browser-mocks:npm_module_types", - "//packages/core/application/core-application-browser-mocks:npm_module_types", - "//packages/core/chrome/core-chrome-browser-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-browser-mocks/kibana.jsonc index ed65ce8dacf5..e3dda6943018 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json b/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json index 2017564049aa..e584b3ccf878 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-lifecycle-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json index 47ad657279cb..f75992604faa 100644 --- a/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,24 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-doc-links-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-deprecations-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-saved-objects-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/core-chrome-browser-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel deleted file mode 100644 index 2b311e9c58fd..000000000000 --- a/packages/core/lifecycle/core-lifecycle-browser/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-browser" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/analytics/core-analytics-browser:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", - "//packages/core/notifications/core-notifications-browser:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser:npm_module_types", - "//packages/core/chrome/core-chrome-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-browser/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-browser/kibana.jsonc index e17c98379b11..664562cba4d0 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-browser/package.json b/packages/core/lifecycle/core-lifecycle-browser/package.json index 72eae4ae4d40..d47bfd2d3dd8 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/package.json +++ b/packages/core/lifecycle/core-lifecycle-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-lifecycle-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json b/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json index 48df8f295724..7db13f868ee5 100644 --- a/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,24 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-theme-browser", + "@kbn/core-analytics-browser", + "@kbn/core-execution-context-browser", + "@kbn/core-http-browser", + "@kbn/core-fatal-errors-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-notifications-browser", + "@kbn/core-application-browser", + "@kbn/core-doc-links-browser", + "@kbn/core-i18n-browser", + "@kbn/core-deprecations-browser", + "@kbn/core-overlays-browser", + "@kbn/core-saved-objects-browser", + "@kbn/core-chrome-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel deleted file mode 100644 index 650127f655d2..000000000000 --- a/packages/core/lifecycle/core-lifecycle-server-internal/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/logging/core-logging-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/preboot/core-preboot-server-internal:npm_module_types", - "//packages/core/http/core-http-context-server-internal:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-internal:npm_module_types", - "//packages/core/http/core-http-resources-server-internal:npm_module_types", - "//packages/core/capabilities/core-capabilities-server:npm_module_types", - "//packages/core/doc-links/core-doc-links-server:npm_module_types", - "//packages/core/i18n/core-i18n-server:npm_module_types", - "//packages/core/environment/core-environment-server-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-server-internal:npm_module_types", - "//packages/core/rendering/core-rendering-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/status/core-status-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc index 7f8fa2fc8f6a..d456283f5a60 100644 --- a/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/package.json b/packages/core/lifecycle/core-lifecycle-server-internal/package.json index 6b02fc1feea5..b24f4f55fa64 100644 --- a/packages/core/lifecycle/core-lifecycle-server-internal/package.json +++ b/packages/core/lifecycle/core-lifecycle-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-lifecycle-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json index 4582562d6c9b..a92db0274831 100644 --- a/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,30 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-logging-server-internal", + "@kbn/core-analytics-server", + "@kbn/core-preboot-server-internal", + "@kbn/core-http-context-server-internal", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-ui-settings-server-internal", + "@kbn/core-http-resources-server-internal", + "@kbn/core-capabilities-server", + "@kbn/core-doc-links-server", + "@kbn/core-i18n-server", + "@kbn/core-environment-server-internal", + "@kbn/core-execution-context-server-internal", + "@kbn/core-deprecations-server-internal", + "@kbn/core-metrics-server-internal", + "@kbn/core-rendering-server-internal", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-status-server-internal", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-usage-data-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel deleted file mode 100644 index 8edde25e3ea1..000000000000 --- a/packages/core/lifecycle/core-lifecycle-server-mocks/BUILD.bazel +++ /dev/null @@ -1,141 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/analytics/core-analytics-server-mocks", - "//packages/core/capabilities/core-capabilities-server-mocks", - "//packages/core/doc-links/core-doc-links-server-mocks", - "//packages/core/deprecations/core-deprecations-server-mocks", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks", - "//packages/core/environment/core-environment-server-mocks", - "//packages/core/execution-context/core-execution-context-server-mocks", - "//packages/core/http/core-http-context-server-mocks", - "//packages/core/http/core-http-server-mocks", - "//packages/core/http/core-http-resources-server-mocks", - "//packages/core/i18n/core-i18n-server-mocks", - "//packages/core/lifecycle/core-lifecycle-server", - "//packages/core/metrics/core-metrics-server-mocks", - "//packages/core/preboot/core-preboot-server-mocks", - "//packages/core/rendering/core-rendering-server-mocks", - "//packages/core/saved-objects/core-saved-objects-server-mocks", - "//packages/core/status/core-status-server-mocks", - "//packages/core/ui-settings/core-ui-settings-server-mocks", - "//packages/core/usage-data/core-usage-data-server-mocks", - -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/core/analytics/core-analytics-server-mocks:npm_module_types", - "//packages/core/capabilities/core-capabilities-server-mocks:npm_module_types", - "//packages/core/doc-links/core-doc-links-server-mocks:npm_module_types", - "//packages/core/deprecations/core-deprecations-server-mocks:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks:npm_module_types", - "//packages/core/environment/core-environment-server-mocks:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-mocks:npm_module_types", - "//packages/core/http/core-http-context-server-mocks:npm_module_types", - "//packages/core/http/core-http-server-mocks:npm_module_types", - "//packages/core/http/core-http-resources-server-mocks:npm_module_types", - "//packages/core/i18n/core-i18n-server-mocks:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", - "//packages/core/metrics/core-metrics-server-mocks:npm_module_types", - "//packages/core/preboot/core-preboot-server-mocks:npm_module_types", - "//packages/core/rendering/core-rendering-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-mocks:npm_module_types", - "//packages/core/status/core-status-server-mocks:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-mocks:npm_module_types", - "//packages/core/usage-data/core-usage-data-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc index ea9bbadfd57e..abb14b3c1486 100644 --- a/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/package.json b/packages/core/lifecycle/core-lifecycle-server-mocks/package.json index 532c07210730..416cbf484ca8 100644 --- a/packages/core/lifecycle/core-lifecycle-server-mocks/package.json +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-lifecycle-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json index 4582562d6c9b..7ae60869a501 100644 --- a/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,32 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types-jest", + "@kbn/core-analytics-server-mocks", + "@kbn/core-capabilities-server-mocks", + "@kbn/core-doc-links-server-mocks", + "@kbn/core-deprecations-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-environment-server-mocks", + "@kbn/core-execution-context-server-mocks", + "@kbn/core-http-context-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-http-resources-server-mocks", + "@kbn/core-i18n-server-mocks", + "@kbn/core-lifecycle-server", + "@kbn/core-metrics-server-mocks", + "@kbn/core-preboot-server-mocks", + "@kbn/core-rendering-server-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-status-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/core-usage-data-server-mocks", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-logging-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel b/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel deleted file mode 100644 index ad8be070d8fa..000000000000 --- a/packages/core/lifecycle/core-lifecycle-server/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-lifecycle-server" -PKG_REQUIRE_NAME = "@kbn/core-lifecycle-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/capabilities/core-capabilities-server:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", - "//packages/core/doc-links/core-doc-links-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/execution-context/core-execution-context-server:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", - "//packages/core/http/core-http-resources-server:npm_module_types", - "//packages/core/i18n/core-i18n-server:npm_module_types", - "//packages/core/logging/core-logging-server:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/preboot/core-preboot-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/status/core-status-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc b/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc index 867db6cc2dab..76017c824b42 100644 --- a/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc +++ b/packages/core/lifecycle/core-lifecycle-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-lifecycle-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/lifecycle/core-lifecycle-server/package.json b/packages/core/lifecycle/core-lifecycle-server/package.json index e594d4972e6c..8dc7f723b1ef 100644 --- a/packages/core/lifecycle/core-lifecycle-server/package.json +++ b/packages/core/lifecycle/core-lifecycle-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-lifecycle-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/lifecycle/core-lifecycle-server/tsconfig.json b/packages/core/lifecycle/core-lifecycle-server/tsconfig.json index 4582562d6c9b..560cde1c3152 100644 --- a/packages/core/lifecycle/core-lifecycle-server/tsconfig.json +++ b/packages/core/lifecycle/core-lifecycle-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,27 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-analytics-server", + "@kbn/core-capabilities-server", + "@kbn/core-deprecations-server", + "@kbn/core-doc-links-server", + "@kbn/core-elasticsearch-server", + "@kbn/core-execution-context-server", + "@kbn/core-http-server", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-http-resources-server", + "@kbn/core-i18n-server", + "@kbn/core-logging-server", + "@kbn/core-metrics-server", + "@kbn/core-preboot-server", + "@kbn/core-saved-objects-server", + "@kbn/core-status-server", + "@kbn/core-ui-settings-server", + "@kbn/core-usage-data-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-browser-internal/BUILD.bazel b/packages/core/logging/core-logging-browser-internal/BUILD.bazel deleted file mode 100644 index b707b68279e4..000000000000 --- a/packages/core/logging/core-logging-browser-internal/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-logging-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/logging/core-logging-common-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-logging:npm_module_types", - "//packages/core/logging/core-logging-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-browser-internal/kibana.jsonc b/packages/core/logging/core-logging-browser-internal/kibana.jsonc index 6d60078e34da..326b03a2367f 100644 --- a/packages/core/logging/core-logging-browser-internal/kibana.jsonc +++ b/packages/core/logging/core-logging-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-browser-internal/package.json b/packages/core/logging/core-logging-browser-internal/package.json index 56cf9d28f32b..a594baa04696 100644 --- a/packages/core/logging/core-logging-browser-internal/package.json +++ b/packages/core/logging/core-logging-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-logging-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-browser-internal/tsconfig.json b/packages/core/logging/core-logging-browser-internal/tsconfig.json index fbd1249f6620..d0d9f725a4ee 100644 --- a/packages/core/logging/core-logging-browser-internal/tsconfig.json +++ b/packages/core/logging/core-logging-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/core-logging-common-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-browser-mocks/BUILD.bazel b/packages/core/logging/core-logging-browser-mocks/BUILD.bazel deleted file mode 100644 index a5e2c1ac54b1..000000000000 --- a/packages/core/logging/core-logging-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-logging-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "//packages/kbn-logging-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/core/logging/core-logging-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-browser-mocks/kibana.jsonc b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc index 377320816c65..122934b8cfd1 100644 --- a/packages/core/logging/core-logging-browser-mocks/kibana.jsonc +++ b/packages/core/logging/core-logging-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-browser-mocks/package.json b/packages/core/logging/core-logging-browser-mocks/package.json index 8ab9610e3547..288da29de2ba 100644 --- a/packages/core/logging/core-logging-browser-mocks/package.json +++ b/packages/core/logging/core-logging-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-logging-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-browser-mocks/tsconfig.json b/packages/core/logging/core-logging-browser-mocks/tsconfig.json index 37f8e83d0d7a..5f39bc493b33 100644 --- a/packages/core/logging/core-logging-browser-mocks/tsconfig.json +++ b/packages/core/logging/core-logging-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/logging-mocks", + "@kbn/core-logging-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-common-internal/BUILD.bazel b/packages/core/logging/core-logging-common-internal/BUILD.bazel deleted file mode 100644 index 2f78f8df668a..000000000000 --- a/packages/core/logging/core-logging-common-internal/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-common-internal" -PKG_REQUIRE_NAME = "@kbn/core-logging-common-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//moment-timezone", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment-timezone", - "@npm//lodash", - "//packages/kbn-logging:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-common-internal/kibana.jsonc b/packages/core/logging/core-logging-common-internal/kibana.jsonc index 353df47ee9dd..4e4f23a47c56 100644 --- a/packages/core/logging/core-logging-common-internal/kibana.jsonc +++ b/packages/core/logging/core-logging-common-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-common-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-common-internal/package.json b/packages/core/logging/core-logging-common-internal/package.json index 3c0aff6df7b0..4a10d4dacaac 100644 --- a/packages/core/logging/core-logging-common-internal/package.json +++ b/packages/core/logging/core-logging-common-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-logging-common-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-common-internal/src/logger.test.ts b/packages/core/logging/core-logging-common-internal/src/logger.test.ts index adf4275a7d6c..613c0cbde93d 100644 --- a/packages/core/logging/core-logging-common-internal/src/logger.test.ts +++ b/packages/core/logging/core-logging-common-internal/src/logger.test.ts @@ -7,7 +7,7 @@ */ import { Appender, LogLevel, LogMeta, LogRecord } from '@kbn/logging'; -import { getLoggerContext } from '@kbn/core-logging-common-internal'; +import { getLoggerContext } from '..'; import { AbstractLogger, CreateLogRecordFn } from './logger'; describe('AbstractLogger', () => { diff --git a/packages/core/logging/core-logging-common-internal/tsconfig.json b/packages/core/logging/core-logging-common-internal/tsconfig.json index fbd1249f6620..371dc89b1817 100644 --- a/packages/core/logging/core-logging-common-internal/tsconfig.json +++ b/packages/core/logging/core-logging-common-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/logging" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-server-internal/BUILD.bazel b/packages/core/logging/core-logging-server-internal/BUILD.bazel deleted file mode 100644 index 078fdd6ac348..000000000000 --- a/packages/core/logging/core-logging-server-internal/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-logging-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//moment-timezone", - "@npm//chalk", - "@npm//elastic-apm-node", - "//packages/kbn-safer-lodash-set", - "//packages/kbn-config-schema", - "//packages/kbn-std", - "//packages/core/logging/core-logging-common-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//rxjs", - "@npm//moment-timezone", - "@npm//elastic-apm-node", - "@npm//chalk", - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-ecs:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/logging/core-logging-common-internal:npm_module_types", - "//packages/core/logging/core-logging-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-server-internal/kibana.jsonc b/packages/core/logging/core-logging-server-internal/kibana.jsonc index ec5ab06a6eff..827b3e7ed120 100644 --- a/packages/core/logging/core-logging-server-internal/kibana.jsonc +++ b/packages/core/logging/core-logging-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-server-internal/package.json b/packages/core/logging/core-logging-server-internal/package.json index df0984f8e6ca..8aa6c20bffee 100644 --- a/packages/core/logging/core-logging-server-internal/package.json +++ b/packages/core/logging/core-logging-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-logging-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-server-internal/tsconfig.json b/packages/core/logging/core-logging-server-internal/tsconfig.json index ef521586433c..43c80b0fcdcd 100644 --- a/packages/core/logging/core-logging-server-internal/tsconfig.json +++ b/packages/core/logging/core-logging-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,21 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/safer-lodash-set", + "@kbn/logging", + "@kbn/config-schema", + "@kbn/core-base-server-internal", + "@kbn/core-logging-common-internal", + "@kbn/core-logging-server", + "@kbn/logging-mocks", + "@kbn/std", + "@kbn/utility-types-jest", + "@kbn/utility-types", + "@kbn/ecs", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-server-mocks/BUILD.bazel b/packages/core/logging/core-logging-server-mocks/BUILD.bazel deleted file mode 100644 index c81d459fe398..000000000000 --- a/packages/core/logging/core-logging-server-mocks/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-logging-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging-mocks" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/core/logging/core-logging-server:npm_module_types", - "//packages/core/logging/core-logging-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-server-mocks/kibana.jsonc b/packages/core/logging/core-logging-server-mocks/kibana.jsonc index 83793b02fca6..3408f6692746 100644 --- a/packages/core/logging/core-logging-server-mocks/kibana.jsonc +++ b/packages/core/logging/core-logging-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-server-mocks/package.json b/packages/core/logging/core-logging-server-mocks/package.json index d028f9469f53..63e4abc2e8c0 100644 --- a/packages/core/logging/core-logging-server-mocks/package.json +++ b/packages/core/logging/core-logging-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-logging-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-server-mocks/tsconfig.json b/packages/core/logging/core-logging-server-mocks/tsconfig.json index ef521586433c..3bf688eeda73 100644 --- a/packages/core/logging/core-logging-server-mocks/tsconfig.json +++ b/packages/core/logging/core-logging-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/core-logging-server", + "@kbn/core-logging-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/logging/core-logging-server/BUILD.bazel b/packages/core/logging/core-logging-server/BUILD.bazel deleted file mode 100644 index 9a34097e4250..000000000000 --- a/packages/core/logging/core-logging-server/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-logging-server" -PKG_REQUIRE_NAME = "@kbn/core-logging-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment-timezone", - "@npm//rxjs", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config-schema:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/logging/core-logging-server/kibana.jsonc b/packages/core/logging/core-logging-server/kibana.jsonc index 27dadd782dcd..92940b93a8db 100644 --- a/packages/core/logging/core-logging-server/kibana.jsonc +++ b/packages/core/logging/core-logging-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-logging-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/logging/core-logging-server/package.json b/packages/core/logging/core-logging-server/package.json index 924cbc152d03..c81cdbd23a65 100644 --- a/packages/core/logging/core-logging-server/package.json +++ b/packages/core/logging/core-logging-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-logging-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/logging/core-logging-server/tsconfig.json b/packages/core/logging/core-logging-server/tsconfig.json index ef521586433c..0f3e14ff4a6f 100644 --- a/packages/core/logging/core-logging-server/tsconfig.json +++ b/packages/core/logging/core-logging-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/config-schema" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel b/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel deleted file mode 100644 index 16a97c7e5499..000000000000 --- a/packages/core/metrics/core-metrics-collectors-server-internal/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-metrics-collectors-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-metrics-collectors-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__mocks__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging", - "@npm//moment", - "@npm//getos", - ### test dependencies - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "@npm//@types/getos", - "@npm//@hapi/hapi", - "@npm//@types/hapi__hapi", - "//packages/kbn-logging:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/kibana.jsonc b/packages/core/metrics/core-metrics-collectors-server-internal/kibana.jsonc index 39a1aff44dba..a277d5fad211 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/kibana.jsonc +++ b/packages/core/metrics/core-metrics-collectors-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-metrics-collectors-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/package.json b/packages/core/metrics/core-metrics-collectors-server-internal/package.json index d9df7f7c232d..779d682ec60f 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/package.json +++ b/packages/core/metrics/core-metrics-collectors-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-metrics-collectors-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json b/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json index ef521586433c..d1a2498ffbd6 100644 --- a/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json +++ b/packages/core/metrics/core-metrics-collectors-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/core-metrics-server", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/logging-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel b/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel deleted file mode 100644 index 9b7f70aed374..000000000000 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-metrics-collectors-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-metrics-collectors-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//moment", - "//packages/core/metrics/core-metrics-server", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/metrics/core-metrics-collectors-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/kibana.jsonc b/packages/core/metrics/core-metrics-collectors-server-mocks/kibana.jsonc index 053d67afb5f6..3b24f1787e04 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/kibana.jsonc +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-metrics-collectors-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/package.json b/packages/core/metrics/core-metrics-collectors-server-mocks/package.json index 344b8978cd02..b2f71629e5d1 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/package.json +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-metrics-collectors-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json b/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json index ef521586433c..e872cb26accf 100644 --- a/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json +++ b/packages/core/metrics/core-metrics-collectors-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-metrics-server", + "@kbn/core-metrics-collectors-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/metrics/core-metrics-server-internal/BUILD.bazel b/packages/core/metrics/core-metrics-server-internal/BUILD.bazel deleted file mode 100644 index aceafc4e3ca8..000000000000 --- a/packages/core/metrics/core-metrics-server-internal/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-metrics-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-metrics-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//moment", - "//packages/kbn-config-schema", - "//packages/core/metrics/core-metrics-collectors-server-internal", - "//packages/core/elasticsearch/core-elasticsearch-server-internal", - ### test dependencies - "//packages/kbn-logging-mocks", - "//packages/core/http/core-http-server-mocks", - "//packages/core/metrics/core-metrics-server-mocks", - "//packages/core/metrics/core-metrics-collectors-server-mocks", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks", - -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//moment", - "@npm//@hapi/hapi", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/metrics/core-metrics-collectors-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/metrics/core-metrics-server-internal/kibana.jsonc b/packages/core/metrics/core-metrics-server-internal/kibana.jsonc index 325f7e64bbb5..303c3a46d8ea 100644 --- a/packages/core/metrics/core-metrics-server-internal/kibana.jsonc +++ b/packages/core/metrics/core-metrics-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-metrics-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/metrics/core-metrics-server-internal/package.json b/packages/core/metrics/core-metrics-server-internal/package.json index f6d827b4edc3..ca9b0c6d1d6d 100644 --- a/packages/core/metrics/core-metrics-server-internal/package.json +++ b/packages/core/metrics/core-metrics-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-metrics-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts b/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts index d997433667e2..1e774d140384 100644 --- a/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts +++ b/packages/core/metrics/core-metrics-server-internal/src/logging/get_ops_metrics_log.test.ts @@ -7,10 +7,16 @@ */ import type { OpsMetrics } from '@kbn/core-metrics-server'; +import type { ElasticsearchClientsMetrics } from '@kbn/core-metrics-server'; import { getEcsOpsMetricsLog } from './get_ops_metrics_log'; -import { sampleEsClientMetrics } from '@kbn/core-metrics-server-mocks'; import { collectorMock } from '@kbn/core-metrics-collectors-server-mocks'; +export const sampleEsClientMetrics: ElasticsearchClientsMetrics = { + totalActiveSockets: 25, + totalIdleSockets: 2, + totalQueuedRequests: 0, +}; + function createBaseOpsMetrics(): OpsMetrics { const mockProcess = collectorMock.createOpsProcessMetrics(); diff --git a/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.test.ts b/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.test.ts index 87011a663404..7c4682e4c24c 100644 --- a/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.test.ts +++ b/packages/core/metrics/core-metrics-server-internal/src/ops_metrics_collector.test.ts @@ -8,8 +8,8 @@ import { loggerMock } from '@kbn/logging-mocks'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; -import { sampleEsClientMetrics } from '@kbn/core-metrics-server-mocks'; import { AgentManager } from '@kbn/core-elasticsearch-client-server-internal'; +import type { ElasticsearchClientsMetrics } from '@kbn/core-metrics-server'; import { mockEsClientCollector, mockOsCollector, @@ -18,6 +18,12 @@ import { } from './ops_metrics_collector.test.mocks'; import { OpsMetricsCollector } from './ops_metrics_collector'; +export const sampleEsClientMetrics: ElasticsearchClientsMetrics = { + totalActiveSockets: 25, + totalIdleSockets: 2, + totalQueuedRequests: 0, +}; + describe('OpsMetricsCollector', () => { let collector: OpsMetricsCollector; diff --git a/packages/core/metrics/core-metrics-server-internal/tsconfig.json b/packages/core/metrics/core-metrics-server-internal/tsconfig.json index ef521586433c..5478a32a4585 100644 --- a/packages/core/metrics/core-metrics-server-internal/tsconfig.json +++ b/packages/core/metrics/core-metrics-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,25 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/config-schema", + "@kbn/core-base-server-internal", + "@kbn/core-http-server-internal", + "@kbn/core-metrics-server", + "@kbn/core-metrics-collectors-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-metrics-collectors-server-mocks", + "@kbn/logging-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel b/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel deleted file mode 100644 index afd9c1a6d6bc..000000000000 --- a/packages/core/metrics/core-metrics-server-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-metrics-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-metrics-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/metrics/core-metrics-collectors-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/metrics/core-metrics-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-collectors-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/metrics/core-metrics-server-mocks/kibana.jsonc b/packages/core/metrics/core-metrics-server-mocks/kibana.jsonc index 6af29213a86c..4e55b952f132 100644 --- a/packages/core/metrics/core-metrics-server-mocks/kibana.jsonc +++ b/packages/core/metrics/core-metrics-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-metrics-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/metrics/core-metrics-server-mocks/package.json b/packages/core/metrics/core-metrics-server-mocks/package.json index f6eb0962aaba..3f621d044b5c 100644 --- a/packages/core/metrics/core-metrics-server-mocks/package.json +++ b/packages/core/metrics/core-metrics-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-metrics-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/metrics/core-metrics-server-mocks/tsconfig.json b/packages/core/metrics/core-metrics-server-mocks/tsconfig.json index ef521586433c..7ea68efec0aa 100644 --- a/packages/core/metrics/core-metrics-server-mocks/tsconfig.json +++ b/packages/core/metrics/core-metrics-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-metrics-server", + "@kbn/core-metrics-server-internal", + "@kbn/core-metrics-collectors-server-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/metrics/core-metrics-server/BUILD.bazel b/packages/core/metrics/core-metrics-server/BUILD.bazel deleted file mode 100644 index d0d2f3218b40..000000000000 --- a/packages/core/metrics/core-metrics-server/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-metrics-server" -PKG_REQUIRE_NAME = "@kbn/core-metrics-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/metrics/core-metrics-server/kibana.jsonc b/packages/core/metrics/core-metrics-server/kibana.jsonc index 64136f9466cb..094d9112f26b 100644 --- a/packages/core/metrics/core-metrics-server/kibana.jsonc +++ b/packages/core/metrics/core-metrics-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-metrics-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/metrics/core-metrics-server/package.json b/packages/core/metrics/core-metrics-server/package.json index 62890dfc756c..5d7f0e022fe7 100644 --- a/packages/core/metrics/core-metrics-server/package.json +++ b/packages/core/metrics/core-metrics-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-metrics-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/metrics/core-metrics-server/tsconfig.json b/packages/core/metrics/core-metrics-server/tsconfig.json index ef521586433c..5dccac215ffa 100644 --- a/packages/core/metrics/core-metrics-server/tsconfig.json +++ b/packages/core/metrics/core-metrics-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel b/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel deleted file mode 100644 index 56ff08916562..000000000000 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-mount-utils-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-mount-utils-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//enzyme", - "//packages/kbn-i18n-react", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-dom", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ] -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/kibana.jsonc b/packages/core/mount-utils/core-mount-utils-browser-internal/kibana.jsonc index c0853a96b395..4f22bf70d798 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/kibana.jsonc +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-mount-utils-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/package.json b/packages/core/mount-utils/core-mount-utils-browser-internal/package.json index 560e995b68ad..c84257676767 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/package.json +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-mount-utils-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json b/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json index c561d9f22012..fad08cdeb878 100644 --- a/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json +++ b/packages/core/mount-utils/core-mount-utils-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/core-mount-utils-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel b/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel deleted file mode 100644 index ee91849586b4..000000000000 --- a/packages/core/mount-utils/core-mount-utils-browser/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-mount-utils-browser" -PKG_REQUIRE_NAME = "@kbn/core-mount-utils-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/mount-utils/core-mount-utils-browser/kibana.jsonc b/packages/core/mount-utils/core-mount-utils-browser/kibana.jsonc index 8f8977af5332..87b8148dbed3 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/kibana.jsonc +++ b/packages/core/mount-utils/core-mount-utils-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-mount-utils-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/mount-utils/core-mount-utils-browser/package.json b/packages/core/mount-utils/core-mount-utils-browser/package.json index 07c43e9ef9e0..f86069561f53 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/package.json +++ b/packages/core/mount-utils/core-mount-utils-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-mount-utils-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json b/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json index 3cdea36de9ea..0f16c2b9311d 100644 --- a/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json +++ b/packages/core/mount-utils/core-mount-utils-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/node/core-node-server-internal/BUILD.bazel b/packages/core/node/core-node-server-internal/BUILD.bazel deleted file mode 100644 index a7f8ae678685..000000000000 --- a/packages/core/node/core-node-server-internal/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-node-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-node-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "//packages/kbn-config-schema", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/logging/core-logging-server-internal:npm_module_types", - "//packages/core/node/core-node-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/node/core-node-server-internal/kibana.jsonc b/packages/core/node/core-node-server-internal/kibana.jsonc index dedee6005b48..15542a4e3042 100644 --- a/packages/core/node/core-node-server-internal/kibana.jsonc +++ b/packages/core/node/core-node-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-node-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/node/core-node-server-internal/package.json b/packages/core/node/core-node-server-internal/package.json index 7d114d937758..d5ef852555d4 100644 --- a/packages/core/node/core-node-server-internal/package.json +++ b/packages/core/node/core-node-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-node-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/node/core-node-server-internal/tsconfig.json b/packages/core/node/core-node-server-internal/tsconfig.json index ef521586433c..7bbe90ab8be7 100644 --- a/packages/core/node/core-node-server-internal/tsconfig.json +++ b/packages/core/node/core-node-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,19 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-logging-server-internal", + "@kbn/core-node-server", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-logging-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/node/core-node-server-mocks/BUILD.bazel b/packages/core/node/core-node-server-mocks/BUILD.bazel deleted file mode 100644 index c1e2d83989b1..000000000000 --- a/packages/core/node/core-node-server-mocks/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-node-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-node-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - '//packages/core/node/core-node-server-internal' -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - '//packages/core/node/core-node-server-internal:npm_module_types' -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/node/core-node-server-mocks/kibana.jsonc b/packages/core/node/core-node-server-mocks/kibana.jsonc index 7070f0218b1c..1f1b6639042e 100644 --- a/packages/core/node/core-node-server-mocks/kibana.jsonc +++ b/packages/core/node/core-node-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-node-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/node/core-node-server-mocks/package.json b/packages/core/node/core-node-server-mocks/package.json index 103ca0f3dce9..0b7c01a79ba9 100644 --- a/packages/core/node/core-node-server-mocks/package.json +++ b/packages/core/node/core-node-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-node-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/node/core-node-server-mocks/tsconfig.json b/packages/core/node/core-node-server-mocks/tsconfig.json index ef521586433c..5300b31bcd61 100644 --- a/packages/core/node/core-node-server-mocks/tsconfig.json +++ b/packages/core/node/core-node-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-node-server-internal", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/node/core-node-server/BUILD.bazel b/packages/core/node/core-node-server/BUILD.bazel deleted file mode 100644 index 5be2d208a1bf..000000000000 --- a/packages/core/node/core-node-server/BUILD.bazel +++ /dev/null @@ -1,102 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-node-server" -PKG_REQUIRE_NAME = "@kbn/core-node-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/node/core-node-server/kibana.jsonc b/packages/core/node/core-node-server/kibana.jsonc index a2322cffe8ac..4f4a4d0969bd 100644 --- a/packages/core/node/core-node-server/kibana.jsonc +++ b/packages/core/node/core-node-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-node-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/node/core-node-server/package.json b/packages/core/node/core-node-server/package.json index d303dbbe08b4..96c0f254bc34 100644 --- a/packages/core/node/core-node-server/package.json +++ b/packages/core/node/core-node-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-node-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/node/core-node-server/tsconfig.json b/packages/core/node/core-node-server/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/node/core-node-server/tsconfig.json +++ b/packages/core/node/core-node-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel b/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel deleted file mode 100644 index 59a85f07f2e4..000000000000 --- a/packages/core/notifications/core-notifications-browser-internal/BUILD.bazel +++ /dev/null @@ -1,139 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-notifications-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-notifications-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//rxjs", - "@npm//lodash", - "@npm//@elastic/eui", - "@npm//enzyme", - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/core/theme/core-theme-browser-internal", - "//packages/core/overlays/core-overlays-browser-mocks", - "//packages/core/theme/core-theme-browser-mocks", - "//packages/core/ui-settings/core-ui-settings-browser-mocks", - "//packages/core/mount-utils/core-mount-utils-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-dom", - "@npm//rxjs", - "@npm//lodash", - "@npm//@elastic/eui", - "@npm//enzyme", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/core/notifications/core-notifications-browser:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/notifications/core-notifications-browser-internal/kibana.jsonc b/packages/core/notifications/core-notifications-browser-internal/kibana.jsonc index 03ad251d65c7..f41a7a0867cc 100644 --- a/packages/core/notifications/core-notifications-browser-internal/kibana.jsonc +++ b/packages/core/notifications/core-notifications-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-notifications-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/notifications/core-notifications-browser-internal/package.json b/packages/core/notifications/core-notifications-browser-internal/package.json index 116a9d21f601..3eb1c32452fe 100644 --- a/packages/core/notifications/core-notifications-browser-internal/package.json +++ b/packages/core/notifications/core-notifications-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-notifications-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json index e1805086a07a..f2828768aa26 100644 --- a/packages/core/notifications/core-notifications-browser-internal/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,25 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/core-theme-browser", + "@kbn/core-theme-browser-internal", + "@kbn/core-i18n-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-overlays-browser", + "@kbn/core-notifications-browser", + "@kbn/core-mount-utils-browser-internal", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/test-jest-helpers", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-theme-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel b/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel deleted file mode 100644 index b1eedb89fb2c..000000000000 --- a/packages/core/notifications/core-notifications-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-notifications-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-notifications-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/notifications/core-notifications-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/core/notifications/core-notifications-browser:npm_module_types", - "//packages/core/notifications/core-notifications-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/notifications/core-notifications-browser-mocks/kibana.jsonc b/packages/core/notifications/core-notifications-browser-mocks/kibana.jsonc index d1c1d8f58f93..1705ff3144b4 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/kibana.jsonc +++ b/packages/core/notifications/core-notifications-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-notifications-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/notifications/core-notifications-browser-mocks/package.json b/packages/core/notifications/core-notifications-browser-mocks/package.json index cb403f57dfc4..60b4aa160c40 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/package.json +++ b/packages/core/notifications/core-notifications-browser-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-notifications-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json b/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json index ef521586433c..37547a6cd6b1 100644 --- a/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types-jest", + "@kbn/core-notifications-browser", + "@kbn/core-notifications-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/notifications/core-notifications-browser/BUILD.bazel b/packages/core/notifications/core-notifications-browser/BUILD.bazel deleted file mode 100644 index 1e9620553236..000000000000 --- a/packages/core/notifications/core-notifications-browser/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-notifications-browser" -PKG_REQUIRE_NAME = "@kbn/core-notifications-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//@elastic/eui", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/notifications/core-notifications-browser/kibana.jsonc b/packages/core/notifications/core-notifications-browser/kibana.jsonc index ae6140a86a20..0bbdd53e56eb 100644 --- a/packages/core/notifications/core-notifications-browser/kibana.jsonc +++ b/packages/core/notifications/core-notifications-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-notifications-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/notifications/core-notifications-browser/package.json b/packages/core/notifications/core-notifications-browser/package.json index 9274f6230e31..a75f3f598d62 100644 --- a/packages/core/notifications/core-notifications-browser/package.json +++ b/packages/core/notifications/core-notifications-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-notifications-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/notifications/core-notifications-browser/tsconfig.json b/packages/core/notifications/core-notifications-browser/tsconfig.json index 3faa31fe437a..e74804a5abae 100644 --- a/packages/core/notifications/core-notifications-browser/tsconfig.json +++ b/packages/core/notifications/core-notifications-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-mount-utils-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel b/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel deleted file mode 100644 index b605c45b504d..000000000000 --- a/packages/core/overlays/core-overlays-browser-internal/BUILD.bazel +++ /dev/null @@ -1,129 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-overlays-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-overlays-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss" - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-markdown", - "//packages/kbn-i18n-react", - "//packages/core/theme/core-theme-browser-internal", - "//packages/core/mount-utils/core-mount-utils-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//react-markdown", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/mount-utils/core-mount-utils-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ] -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/overlays/core-overlays-browser-internal/kibana.jsonc b/packages/core/overlays/core-overlays-browser-internal/kibana.jsonc index 8890a3c132d6..b0b38b2e851c 100644 --- a/packages/core/overlays/core-overlays-browser-internal/kibana.jsonc +++ b/packages/core/overlays/core-overlays-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-overlays-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/overlays/core-overlays-browser-internal/package.json b/packages/core/overlays/core-overlays-browser-internal/package.json index 0e2232e3f1ce..6888b986b779 100644 --- a/packages/core/overlays/core-overlays-browser-internal/package.json +++ b/packages/core/overlays/core-overlays-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-overlays-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json index e1805086a07a..06f6c2c1d36f 100644 --- a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,22 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/core-theme-browser", + "@kbn/core-theme-browser-internal", + "@kbn/core-mount-utils-browser-internal", + "@kbn/core-i18n-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-overlays-browser", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-mount-utils-browser", + "@kbn/core-theme-browser-mocks", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel b/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel deleted file mode 100644 index f376cb502121..000000000000 --- a/packages/core/overlays/core-overlays-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-overlays-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-overlays-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/overlays/core-overlays-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/overlays/core-overlays-browser-mocks/kibana.jsonc b/packages/core/overlays/core-overlays-browser-mocks/kibana.jsonc index 61b14d5cbc8b..f157b590fb35 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/kibana.jsonc +++ b/packages/core/overlays/core-overlays-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-overlays-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/overlays/core-overlays-browser-mocks/package.json b/packages/core/overlays/core-overlays-browser-mocks/package.json index 336f71476649..b15df0984c00 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/package.json +++ b/packages/core/overlays/core-overlays-browser-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-overlays-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json b/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json index ef521586433c..a35954a44cd7 100644 --- a/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/utility-types-jest", + "@kbn/core-overlays-browser", + "@kbn/core-overlays-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/overlays/core-overlays-browser/BUILD.bazel b/packages/core/overlays/core-overlays-browser/BUILD.bazel deleted file mode 100644 index c77d2fe12d6b..000000000000 --- a/packages/core/overlays/core-overlays-browser/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-overlays-browser" -PKG_REQUIRE_NAME = "@kbn/core-overlays-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//rxjs", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/eui", - "//packages/core/mount-utils/core-mount-utils-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/overlays/core-overlays-browser/kibana.jsonc b/packages/core/overlays/core-overlays-browser/kibana.jsonc index de43c7689f1f..6d5de7ad36d4 100644 --- a/packages/core/overlays/core-overlays-browser/kibana.jsonc +++ b/packages/core/overlays/core-overlays-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-overlays-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/overlays/core-overlays-browser/package.json b/packages/core/overlays/core-overlays-browser/package.json index 02c1fee3083c..abae9d3ec97d 100644 --- a/packages/core/overlays/core-overlays-browser/package.json +++ b/packages/core/overlays/core-overlays-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-overlays-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/overlays/core-overlays-browser/tsconfig.json b/packages/core/overlays/core-overlays-browser/tsconfig.json index 3cdea36de9ea..461df2c838a7 100644 --- a/packages/core/overlays/core-overlays-browser/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-mount-utils-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel b/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel deleted file mode 100644 index 3a88e9ead984..000000000000 --- a/packages/core/plugins/core-plugins-base-server-internal/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-base-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-plugins-base-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/core/base/core-base-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-base-server-internal/kibana.jsonc b/packages/core/plugins/core-plugins-base-server-internal/kibana.jsonc index a593530ab5fc..313d463f8f8c 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/kibana.jsonc +++ b/packages/core/plugins/core-plugins-base-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-base-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-base-server-internal/package.json b/packages/core/plugins/core-plugins-base-server-internal/package.json index d11839515ba6..75b20566bc17 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/package.json +++ b/packages/core/plugins/core-plugins-base-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-plugins-base-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json b/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json index 4582562d6c9b..48f63905bf59 100644 --- a/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json +++ b/packages/core/plugins/core-plugins-base-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-base-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel b/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel deleted file mode 100644 index b1ce21eaff31..000000000000 --- a/packages/core/plugins/core-plugins-browser-internal/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-plugins-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//rxjs", - "@npm//lodash", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//lodash", - "//packages/kbn-config:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-common-internal:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-browser:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-browser-internal:npm_module_types", - "//packages/core/plugins/core-plugins-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-browser-internal/kibana.jsonc b/packages/core/plugins/core-plugins-browser-internal/kibana.jsonc index 61935e6670ae..a55852a5f524 100644 --- a/packages/core/plugins/core-plugins-browser-internal/kibana.jsonc +++ b/packages/core/plugins/core-plugins-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-browser-internal/package.json b/packages/core/plugins/core-plugins-browser-internal/package.json index c8679403e28c..348a6378ddc4 100644 --- a/packages/core/plugins/core-plugins-browser-internal/package.json +++ b/packages/core/plugins/core-plugins-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-plugins-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-browser-internal/src/plugins_service.test.ts b/packages/core/plugins/core-plugins-browser-internal/src/plugins_service.test.ts index 6155e4bcdb6b..7127f633f0ca 100644 --- a/packages/core/plugins/core-plugins-browser-internal/src/plugins_service.test.ts +++ b/packages/core/plugins/core-plugins-browser-internal/src/plugins_service.test.ts @@ -86,6 +86,7 @@ describe('PluginsService', () => { plugin: createManifest('pluginC', { required: ['pluginA'], optional: ['nonexist'] }), }, ]; + // @ts-expect-error this file was not being type checked properly in the past, error is legit mockSetupDeps = { analytics: analyticsServiceMock.createAnalyticsServiceSetup(), application: applicationServiceMock.createInternalSetupContract(), @@ -102,6 +103,7 @@ describe('PluginsService', () => { application: expect.any(Object), getStartServices: expect.any(Function), }; + // @ts-expect-error this file was not being type checked properly in the past, error is legit mockStartDeps = { analytics: analyticsServiceMock.createAnalyticsServiceStart(), application: applicationServiceMock.createInternalStartContract(), diff --git a/packages/core/plugins/core-plugins-browser-internal/tsconfig.json b/packages/core/plugins/core-plugins-browser-internal/tsconfig.json index 47ad657279cb..29a75896edda 100644 --- a/packages/core/plugins/core-plugins-browser-internal/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,33 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-base-common", + "@kbn/core-base-browser-internal", + "@kbn/core-injected-metadata-common-internal", + "@kbn/core-lifecycle-browser", + "@kbn/core-lifecycle-browser-internal", + "@kbn/core-plugins-browser", + "@kbn/logging-mocks", + "@kbn/core-base-browser-mocks", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-doc-links-browser-mocks", + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-chrome-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-saved-objects-browser-mocks", + "@kbn/core-deprecations-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel b/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel deleted file mode 100644 index dbe94e7ba964..000000000000 --- a/packages/core/plugins/core-plugins-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-plugins-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/core/plugins/core-plugins-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-browser-mocks/kibana.jsonc b/packages/core/plugins/core-plugins-browser-mocks/kibana.jsonc index c451ce7aac05..1a3f5258dca2 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/kibana.jsonc +++ b/packages/core/plugins/core-plugins-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-browser-mocks/package.json b/packages/core/plugins/core-plugins-browser-mocks/package.json index b8cb7ed38fc3..dac2ee0cb2a6 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/package.json +++ b/packages/core/plugins/core-plugins-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-plugins-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json b/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json index 47ad657279cb..6b14fa13dd8b 100644 --- a/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,14 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/logging-mocks", + "@kbn/core-plugins-browser-internal", + "@kbn/core-plugins-browser", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-browser/BUILD.bazel b/packages/core/plugins/core-plugins-browser/BUILD.bazel deleted file mode 100644 index b56de1b3a839..000000000000 --- a/packages/core/plugins/core-plugins-browser/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-browser" -PKG_REQUIRE_NAME = "@kbn/core-plugins-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-config:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-browser/kibana.jsonc b/packages/core/plugins/core-plugins-browser/kibana.jsonc index f7457049acc0..2f521b0048f7 100644 --- a/packages/core/plugins/core-plugins-browser/kibana.jsonc +++ b/packages/core/plugins/core-plugins-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-browser/package.json b/packages/core/plugins/core-plugins-browser/package.json index 20337d05ec8f..cd335165b6ac 100644 --- a/packages/core/plugins/core-plugins-browser/package.json +++ b/packages/core/plugins/core-plugins-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-plugins-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-browser/tsconfig.json b/packages/core/plugins/core-plugins-browser/tsconfig.json index 47ad657279cb..854df4f55320 100644 --- a/packages/core/plugins/core-plugins-browser/tsconfig.json +++ b/packages/core/plugins/core-plugins-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,14 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/config", + "@kbn/core-base-common", + "@kbn/core-lifecycle-browser", + "@kbn/logging", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-server-internal/BUILD.bazel b/packages/core/plugins/core-plugins-server-internal/BUILD.bazel deleted file mode 100644 index 480a21f44eed..000000000000 --- a/packages/core/plugins/core-plugins-server-internal/BUILD.bazel +++ /dev/null @@ -1,153 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-plugins-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//moment", - "@npm//rxjs", - "@npm//semver", - "@npm//type-detect", - "@npm//lodash", - "//packages/kbn-std", - "//packages/kbn-config", - "//packages/kbn-config-schema", - "//packages/kbn-logging", - "//packages/kbn-utils", - "//packages/core/base/core-base-common", - "//packages/core/base/core-base-server-internal", - "//packages/core/lifecycle/core-lifecycle-server-internal", - "//packages/core/elasticsearch/core-elasticsearch-server-internal", - "//packages/core/node/core-node-server", - "//packages/core/saved-objects/core-saved-objects-base-server-internal", - # test dependencies - "@npm//mock-fs", - "//packages/kbn-config-mocks", - "//packages/core/base/core-base-server-mocks", - "//packages/core/lifecycle/core-lifecycle-server-mocks", - "//packages/core/logging/core-logging-server-mocks", - "//packages/core/node/core-node-server-mocks", - "//packages/core/plugins/core-plugins-server", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//moment", - "@npm//rxjs", - "@npm//semver", - "@npm//type-detect", - "@npm//lodash", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/node/core-node-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", - "//packages/core/plugins/core-plugins-server:npm_module_types", - # test dependencies' mocks - "@npm//mock-fs", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/core/base/core-base-server-mocks:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server-mocks:npm_module_types", - "//packages/core/logging/core-logging-server-mocks:npm_module_types", - "//packages/core/node/core-node-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-server-internal/kibana.jsonc b/packages/core/plugins/core-plugins-server-internal/kibana.jsonc index 2354b5ea2054..e4cbaaef2341 100644 --- a/packages/core/plugins/core-plugins-server-internal/kibana.jsonc +++ b/packages/core/plugins/core-plugins-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-server-internal/package.json b/packages/core/plugins/core-plugins-server-internal/package.json index fef5ddbf7b61..0c68762d1b82 100644 --- a/packages/core/plugins/core-plugins-server-internal/package.json +++ b/packages/core/plugins/core-plugins-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-plugins-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts index 8c1c50e8a612..222788487fe0 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/discovery/plugins_discovery.test.ts @@ -7,7 +7,7 @@ */ // must be before mocks imports to avoid conflicting with `REPO_ROOT` accessor. -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { mockPackage, scanPluginSearchPathsMock } from './plugins_discovery.test.mocks'; import mockFs from 'mock-fs'; import { getEnvOptions, rawConfigServiceMock } from '@kbn/config-mocks'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts index 2bd50db020d0..1bb1dbb98cfa 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/legacy_config.test.ts @@ -8,7 +8,7 @@ import { take } from 'rxjs/operators'; import { getGlobalConfig, getGlobalConfig$ } from './legacy_config'; import { duration } from 'moment'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { ByteSizeValue } from '@kbn/config-schema'; import { createCoreContextConfigServiceMock } from './test_helpers'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts index 008b8eaf6665..da1060ae4feb 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin.test.ts @@ -8,7 +8,7 @@ import { join } from 'path'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { schema } from '@kbn/config-schema'; import { Env } from '@kbn/config'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts index 978bf62222f0..bba736aa3d31 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin_context.test.ts @@ -8,7 +8,7 @@ import { duration } from 'moment'; import { first } from 'rxjs/operators'; -import { REPO_ROOT, fromRoot } from '@kbn/utils'; +import { REPO_ROOT, fromRoot } from '@kbn/repo-info'; import { rawConfigServiceMock, getEnvOptions, configServiceMock } from '@kbn/config-mocks'; import type { CoreContext } from '@kbn/core-base-server-internal'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts index 49bfdf34a34b..2513d51616ef 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_config.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { PluginsConfig, PluginsConfigType } from './plugins_config'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts index b79db7791a91..270f824b432f 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.mocks.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { resolve } from 'path'; const loadJsonFile = jest.requireActual('load-json-file'); diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts index 4664db6e710c..948939b143dd 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_service.test.ts @@ -11,7 +11,7 @@ import { mockDiscover, mockPackage } from './plugins_service.test.mocks'; import { resolve, join } from 'path'; import { BehaviorSubject, from } from 'rxjs'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { schema } from '@kbn/config-schema'; import { ConfigPath, ConfigService, Env } from '@kbn/config'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts index 8b61665f097c..f949d039eb0c 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugins_system.test.ts @@ -14,7 +14,7 @@ import { import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { type PluginName, PluginType } from '@kbn/core-base-common'; import type { CoreContext } from '@kbn/core-base-server-internal'; import { Logger } from '@kbn/logging'; diff --git a/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts index 399d45398eef..60941696b037 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/test_helpers/create_core_context_config_service.mock.ts @@ -9,7 +9,7 @@ import { IConfigService } from '@kbn/config'; import { configServiceMock } from '@kbn/config-mocks'; import { ByteSizeValue } from '@kbn/config-schema'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { duration } from 'moment'; import { from } from 'rxjs'; diff --git a/packages/core/plugins/core-plugins-server-internal/tsconfig.json b/packages/core/plugins/core-plugins-server-internal/tsconfig.json index 4582562d6c9b..526d9e9f46fe 100644 --- a/packages/core/plugins/core-plugins-server-internal/tsconfig.json +++ b/packages/core/plugins/core-plugins-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,36 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/std", + "@kbn/config", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/utils", + "@kbn/core-base-common", + "@kbn/core-base-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-node-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-http-server", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-lifecycle-server", + "@kbn/core-lifecycle-server-internal", + "@kbn/core-plugins-server", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-lifecycle-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-node-server-mocks", + "@kbn/repo-info", + "@kbn/jest-serializers", + "@kbn/core-environment-server-mocks", + "@kbn/core-environment-server-internal", + "@kbn/core-node-server-internal", + "@kbn/core-plugins-base-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel b/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel deleted file mode 100644 index 18c5beb51fb4..000000000000 --- a/packages/core/plugins/core-plugins-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-plugins-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/plugins/core-plugins-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/plugins/core-plugins-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc b/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc index 4a1b2c0bd225..62d8b6d11815 100644 --- a/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc +++ b/packages/core/plugins/core-plugins-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-server-mocks/package.json b/packages/core/plugins/core-plugins-server-mocks/package.json index 2ac79f595e26..4e883adb0073 100644 --- a/packages/core/plugins/core-plugins-server-mocks/package.json +++ b/packages/core/plugins/core-plugins-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-plugins-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-server-mocks/tsconfig.json b/packages/core/plugins/core-plugins-server-mocks/tsconfig.json index 4582562d6c9b..b1ed9a23b486 100644 --- a/packages/core/plugins/core-plugins-server-mocks/tsconfig.json +++ b/packages/core/plugins/core-plugins-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-plugins-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/plugins/core-plugins-server/BUILD.bazel b/packages/core/plugins/core-plugins-server/BUILD.bazel deleted file mode 100644 index 1204629766db..000000000000 --- a/packages/core/plugins/core-plugins-server/BUILD.bazel +++ /dev/null @@ -1,117 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-plugins-server" -PKG_REQUIRE_NAME = "@kbn/core-plugins-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/kbn-config-schema", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/node/core-node-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server:npm_module_types", - -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/plugins/core-plugins-server/kibana.jsonc b/packages/core/plugins/core-plugins-server/kibana.jsonc index 708281a40646..e152670fd40e 100644 --- a/packages/core/plugins/core-plugins-server/kibana.jsonc +++ b/packages/core/plugins/core-plugins-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-plugins-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/plugins/core-plugins-server/package.json b/packages/core/plugins/core-plugins-server/package.json index 72e1521adb93..649fa288c8fc 100644 --- a/packages/core/plugins/core-plugins-server/package.json +++ b/packages/core/plugins/core-plugins-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-plugins-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/plugins/core-plugins-server/tsconfig.json b/packages/core/plugins/core-plugins-server/tsconfig.json index 4582562d6c9b..c6eee13f4931 100644 --- a/packages/core/plugins/core-plugins-server/tsconfig.json +++ b/packages/core/plugins/core-plugins-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,20 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/utils", + "@kbn/logging", + "@kbn/core-base-common", + "@kbn/core-node-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-lifecycle-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel b/packages/core/preboot/core-preboot-server-internal/BUILD.bazel deleted file mode 100644 index 5f6d76b008d5..000000000000 --- a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-preboot-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-preboot-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging", - "//packages/core/base/core-base-server-internal", - "//packages/core/base/core-base-common", - "//packages/kbn-utils", - "//packages/kbn-config", - "//packages/kbn-config-mocks", - "//packages/core/logging/core-logging-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/core/logging/core-logging-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/preboot/core-preboot-server-internal/kibana.jsonc b/packages/core/preboot/core-preboot-server-internal/kibana.jsonc index 9a2eadb716ea..2f391bdfd0f5 100644 --- a/packages/core/preboot/core-preboot-server-internal/kibana.jsonc +++ b/packages/core/preboot/core-preboot-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-preboot-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/preboot/core-preboot-server-internal/package.json b/packages/core/preboot/core-preboot-server-internal/package.json index f768ed11d353..bce9fb66f231 100644 --- a/packages/core/preboot/core-preboot-server-internal/package.json +++ b/packages/core/preboot/core-preboot-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-preboot-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/preboot/core-preboot-server-internal/src/preboot_service.test.ts b/packages/core/preboot/core-preboot-server-internal/src/preboot_service.test.ts index beb3e9d71b9c..5fb4fbe5781a 100644 --- a/packages/core/preboot/core-preboot-server-internal/src/preboot_service.test.ts +++ b/packages/core/preboot/core-preboot-server-internal/src/preboot_service.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { LoggerFactory } from '@kbn/logging'; import { Env } from '@kbn/config'; import { configServiceMock, getEnvOptions } from '@kbn/config-mocks'; diff --git a/packages/core/preboot/core-preboot-server-internal/tsconfig.json b/packages/core/preboot/core-preboot-server-internal/tsconfig.json index ef521586433c..fa2cee0f6049 100644 --- a/packages/core/preboot/core-preboot-server-internal/tsconfig.json +++ b/packages/core/preboot/core-preboot-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,17 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-base-common", + "@kbn/config", + "@kbn/config-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel b/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel deleted file mode 100644 index 2decb5b2d8f2..000000000000 --- a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-preboot-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-preboot-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-utility-types", - "//packages/core/preboot/core-preboot-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/preboot/core-preboot-server-internal:npm_module_types", - "//packages/core/preboot/core-preboot-server:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/preboot/core-preboot-server-mocks/kibana.jsonc b/packages/core/preboot/core-preboot-server-mocks/kibana.jsonc index 87a035b99530..91e60bd62b1e 100644 --- a/packages/core/preboot/core-preboot-server-mocks/kibana.jsonc +++ b/packages/core/preboot/core-preboot-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-preboot-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/preboot/core-preboot-server-mocks/package.json b/packages/core/preboot/core-preboot-server-mocks/package.json index 150053877e93..3b550e2243da 100644 --- a/packages/core/preboot/core-preboot-server-mocks/package.json +++ b/packages/core/preboot/core-preboot-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-preboot-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/preboot/core-preboot-server-mocks/tsconfig.json b/packages/core/preboot/core-preboot-server-mocks/tsconfig.json index ef521586433c..3ee5616edbd6 100644 --- a/packages/core/preboot/core-preboot-server-mocks/tsconfig.json +++ b/packages/core/preboot/core-preboot-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-preboot-server-internal", + "@kbn/core-preboot-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/preboot/core-preboot-server/BUILD.bazel b/packages/core/preboot/core-preboot-server/BUILD.bazel deleted file mode 100644 index 6bd1af7108de..000000000000 --- a/packages/core/preboot/core-preboot-server/BUILD.bazel +++ /dev/null @@ -1,102 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-preboot-server" -PKG_REQUIRE_NAME = "@kbn/core-preboot-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/preboot/core-preboot-server/kibana.jsonc b/packages/core/preboot/core-preboot-server/kibana.jsonc index e529cfdd6568..adcbf3c84aee 100644 --- a/packages/core/preboot/core-preboot-server/kibana.jsonc +++ b/packages/core/preboot/core-preboot-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-preboot-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/preboot/core-preboot-server/package.json b/packages/core/preboot/core-preboot-server/package.json index b65818960169..e86ff58f703e 100644 --- a/packages/core/preboot/core-preboot-server/package.json +++ b/packages/core/preboot/core-preboot-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-preboot-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/preboot/core-preboot-server/tsconfig.json b/packages/core/preboot/core-preboot-server/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/preboot/core-preboot-server/tsconfig.json +++ b/packages/core/preboot/core-preboot-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel b/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel deleted file mode 100644 index c0fb214bfb96..000000000000 --- a/packages/core/rendering/core-rendering-browser-internal/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-rendering-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-rendering-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//rxjs", - "@npm//classnames", - "@npm//react-use", - "//packages/core/application/core-application-common", - "//packages/core/theme/core-theme-browser-internal", - ### test dependencies - "//packages/core/application/core-application-browser-mocks", - "//packages/core/chrome/core-chrome-browser-mocks", - "//packages/core/overlays/core-overlays-browser-mocks", - "//packages/core/theme/core-theme-browser-mocks", - "//packages/core/i18n/core-i18n-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/classnames", - "@npm//@types/react-dom", - "@npm//rxjs", - "@npm//react-use", - "//packages/core/application/core-application-common:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", - "//packages/core/overlays/core-overlays-browser:npm_module_types", - "//packages/core/chrome/core-chrome-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/rendering/core-rendering-browser-internal/kibana.jsonc b/packages/core/rendering/core-rendering-browser-internal/kibana.jsonc index aaca72f8b484..87f174de187f 100644 --- a/packages/core/rendering/core-rendering-browser-internal/kibana.jsonc +++ b/packages/core/rendering/core-rendering-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-rendering-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/rendering/core-rendering-browser-internal/package.json b/packages/core/rendering/core-rendering-browser-internal/package.json index 1ccaccf9621e..6942411ed56b 100644 --- a/packages/core/rendering/core-rendering-browser-internal/package.json +++ b/packages/core/rendering/core-rendering-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-rendering-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json index 37f8e83d0d7a..7851397e4912 100644 --- a/packages/core/rendering/core-rendering-browser-internal/tsconfig.json +++ b/packages/core/rendering/core-rendering-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,22 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-application-common", + "@kbn/core-application-browser-internal", + "@kbn/core-theme-browser", + "@kbn/core-theme-browser-internal", + "@kbn/core-i18n-browser", + "@kbn/core-overlays-browser", + "@kbn/core-chrome-browser-internal", + "@kbn/core-application-browser-mocks", + "@kbn/core-chrome-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-i18n-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel b/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel deleted file mode 100644 index d2cdb9c78c28..000000000000 --- a/packages/core/rendering/core-rendering-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-rendering-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-rendering-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/rendering/core-rendering-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/rendering/core-rendering-browser-mocks/kibana.jsonc b/packages/core/rendering/core-rendering-browser-mocks/kibana.jsonc index 82b891ad721d..38be88afd149 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/kibana.jsonc +++ b/packages/core/rendering/core-rendering-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-rendering-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/rendering/core-rendering-browser-mocks/package.json b/packages/core/rendering/core-rendering-browser-mocks/package.json index b9cef0d40073..8c471403e757 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/package.json +++ b/packages/core/rendering/core-rendering-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-rendering-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json b/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json index 741519055e98..67c2b7619323 100644 --- a/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json +++ b/packages/core/rendering/core-rendering-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-rendering-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/rendering/core-rendering-server-internal/BUILD.bazel b/packages/core/rendering/core-rendering-server-internal/BUILD.bazel deleted file mode 100644 index 9b9c41de7866..000000000000 --- a/packages/core/rendering/core-rendering-server-internal/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-rendering-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-rendering-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-dom", - "@npm//rxjs", - "//packages/kbn-i18n", - "//packages/kbn-ui-shared-deps-npm", - "//packages/kbn-ui-shared-deps-src", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-dom", - "@npm//rxjs", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-ui-shared-deps-src:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-common-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/status/core-status-server-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-common:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", - "//packages/core/plugins/core-plugins-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/rendering/core-rendering-server-internal/kibana.jsonc b/packages/core/rendering/core-rendering-server-internal/kibana.jsonc index 2ce227d70528..9f7f2ea9c43a 100644 --- a/packages/core/rendering/core-rendering-server-internal/kibana.jsonc +++ b/packages/core/rendering/core-rendering-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-rendering-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/rendering/core-rendering-server-internal/package.json b/packages/core/rendering/core-rendering-server-internal/package.json index b41efec088ad..b6eb85b15abd 100644 --- a/packages/core/rendering/core-rendering-server-internal/package.json +++ b/packages/core/rendering/core-rendering-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-rendering-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/bootstrap_renderer.ts b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/bootstrap_renderer.ts index 8424bb3e68a1..83043a100c85 100644 --- a/packages/core/rendering/core-rendering-server-internal/src/bootstrap/bootstrap_renderer.ts +++ b/packages/core/rendering/core-rendering-server-internal/src/bootstrap/bootstrap_renderer.ts @@ -82,6 +82,7 @@ export const bootstrapRendererFactory: BootstrapRendererFactory = ({ core: `${regularBundlePath}/core/`, 'kbn-ui-shared-deps-src': `${regularBundlePath}/kbn-ui-shared-deps-src/`, 'kbn-ui-shared-deps-npm': `${regularBundlePath}/kbn-ui-shared-deps-npm/`, + 'kbn-monaco': `${regularBundlePath}/kbn-monaco/`, ...Object.fromEntries( [...bundlePaths.entries()].map(([pluginId, plugin]) => [pluginId, plugin.publicPath]) ), diff --git a/packages/core/rendering/core-rendering-server-internal/tsconfig.json b/packages/core/rendering/core-rendering-server-internal/tsconfig.json index 2279a16c99ad..54274d5e5e3c 100644 --- a/packages/core/rendering/core-rendering-server-internal/tsconfig.json +++ b/packages/core/rendering/core-rendering-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,31 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/ui-shared-deps-npm", + "@kbn/ui-shared-deps-src", + "@kbn/core-base-server-internal", + "@kbn/core-injected-metadata-common-internal", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-status-server-internal", + "@kbn/core-ui-settings-common", + "@kbn/core-ui-settings-server", + "@kbn/core-plugins-base-server-internal", + "@kbn/core-http-router-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/config", + "@kbn/core-base-common", + "@kbn/core-base-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-status-server-mocks", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel b/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel deleted file mode 100644 index 7f960ef9e806..000000000000 --- a/packages/core/rendering/core-rendering-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-rendering-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-rendering-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/rendering/core-rendering-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/rendering/core-rendering-server-mocks/kibana.jsonc b/packages/core/rendering/core-rendering-server-mocks/kibana.jsonc index a04eae9cadc2..8d836f9acdda 100644 --- a/packages/core/rendering/core-rendering-server-mocks/kibana.jsonc +++ b/packages/core/rendering/core-rendering-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-rendering-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/rendering/core-rendering-server-mocks/package.json b/packages/core/rendering/core-rendering-server-mocks/package.json index e729d1c022bc..2add3ab42dcc 100644 --- a/packages/core/rendering/core-rendering-server-mocks/package.json +++ b/packages/core/rendering/core-rendering-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-rendering-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/rendering/core-rendering-server-mocks/tsconfig.json b/packages/core/rendering/core-rendering-server-mocks/tsconfig.json index 4582562d6c9b..ffd8b5b62c9d 100644 --- a/packages/core/rendering/core-rendering-server-mocks/tsconfig.json +++ b/packages/core/rendering/core-rendering-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-rendering-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/root/core-root-browser-internal/BUILD.bazel b/packages/core/root/core-root-browser-internal/BUILD.bazel deleted file mode 100644 index 05f41123181e..000000000000 --- a/packages/core/root/core-root-browser-internal/BUILD.bazel +++ /dev/null @@ -1,172 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-root-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-root-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//@elastic/apm-rum", - "//packages/kbn-std", - "//packages/kbn-i18n", - "//packages/kbn-ebt-tools", - "//packages/core/application/core-application-browser-internal", - "//packages/core/logging/core-logging-browser-internal", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal", - "//packages/core/doc-links/core-doc-links-browser-internal", - "//packages/core/theme/core-theme-browser-internal", - "//packages/core/analytics/core-analytics-browser-internal", - "//packages/core/i18n/core-i18n-browser-internal", - "//packages/core/execution-context/core-execution-context-browser-internal", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal", - "//packages/core/http/core-http-browser-internal", - "//packages/core/ui-settings/core-ui-settings-browser-internal", - "//packages/core/deprecations/core-deprecations-browser-internal", - "//packages/core/integrations/core-integrations-browser-internal", - "//packages/core/overlays/core-overlays-browser-internal", - "//packages/core/saved-objects/core-saved-objects-browser-internal", - "//packages/core/notifications/core-notifications-browser-internal", - "//packages/core/chrome/core-chrome-browser-internal", - "//packages/core/rendering/core-rendering-browser-internal", - "//packages/core/apps/core-apps-browser-internal", - "//packages/core/lifecycle/core-lifecycle-browser-internal", - "//packages/core/plugins/core-plugins-browser-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//@elastic/apm-rum", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ebt-tools:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser:npm_module_types", - "//packages/core/application/core-application-browser-internal:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/logging/core-logging-browser-internal:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/doc-links/core-doc-links-browser-internal:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types", - "//packages/core/analytics/core-analytics-browser:npm_module_types", - "//packages/core/analytics/core-analytics-browser-internal:npm_module_types", - "//packages/core/i18n/core-i18n-browser-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-browser-internal:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-internal:npm_module_types", - "//packages/core/http/core-http-browser-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-browser-internal:npm_module_types", - "//packages/core/integrations/core-integrations-browser-internal:npm_module_types", - "//packages/core/overlays/core-overlays-browser-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser-internal:npm_module_types", - "//packages/core/notifications/core-notifications-browser-internal:npm_module_types", - "//packages/core/chrome/core-chrome-browser-internal:npm_module_types", - "//packages/core/rendering/core-rendering-browser-internal:npm_module_types", - "//packages/core/apps/core-apps-browser-internal:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-browser-internal:npm_module_types", - "//packages/core/plugins/core-plugins-browser-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/root/core-root-browser-internal/kibana.jsonc b/packages/core/root/core-root-browser-internal/kibana.jsonc index 0dd7d5ae6beb..e99eaefd0e84 100644 --- a/packages/core/root/core-root-browser-internal/kibana.jsonc +++ b/packages/core/root/core-root-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-root-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/root/core-root-browser-internal/package.json b/packages/core/root/core-root-browser-internal/package.json index d010180d2747..8ced433c4940 100644 --- a/packages/core/root/core-root-browser-internal/package.json +++ b/packages/core/root/core-root-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-root-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/root/core-root-browser-internal/tsconfig.json b/packages/core/root/core-root-browser-internal/tsconfig.json index 47ad657279cb..f5b66338a52b 100644 --- a/packages/core/root/core-root-browser-internal/tsconfig.json +++ b/packages/core/root/core-root-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,59 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/std", + "@kbn/i18n", + "@kbn/ebt-tools", + "@kbn/core-execution-context-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-base-browser-internal", + "@kbn/core-logging-browser-internal", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-doc-links-browser-internal", + "@kbn/core-theme-browser-internal", + "@kbn/core-analytics-browser", + "@kbn/core-analytics-browser-internal", + "@kbn/core-i18n-browser-internal", + "@kbn/core-execution-context-browser-internal", + "@kbn/core-fatal-errors-browser", + "@kbn/core-fatal-errors-browser-internal", + "@kbn/core-http-browser-internal", + "@kbn/core-ui-settings-browser-internal", + "@kbn/core-deprecations-browser-internal", + "@kbn/core-integrations-browser-internal", + "@kbn/core-overlays-browser-internal", + "@kbn/core-saved-objects-browser-internal", + "@kbn/core-notifications-browser-internal", + "@kbn/core-chrome-browser-internal", + "@kbn/core-rendering-browser-internal", + "@kbn/core-apps-browser-internal", + "@kbn/core-lifecycle-browser-internal", + "@kbn/core-plugins-browser-internal", + "@kbn/utility-types-jest", + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-doc-links-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/core-chrome-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-plugins-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-rendering-browser-mocks", + "@kbn/core-integrations-browser-mocks", + "@kbn/core-apps-browser-mocks", + "@kbn/core-logging-browser-mocks", + "@kbn/logging", + "@kbn/config", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/root/core-root-server-internal/BUILD.bazel b/packages/core/root/core-root-server-internal/BUILD.bazel deleted file mode 100644 index 4d88acf88178..000000000000 --- a/packages/core/root/core-root-server-internal/BUILD.bazel +++ /dev/null @@ -1,167 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-root-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-root-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//elastic-apm-node", - "//packages/kbn-utils", - "//packages/kbn-config", - "//packages/kbn-ebt-tools", - "//packages/core/doc-links/core-doc-links-server-internal", - "//packages/core/logging/core-logging-server-internal", - "//packages/core/config/core-config-server-internal", - "//packages/core/node/core-node-server-internal", - "//packages/core/analytics/core-analytics-server-internal", - "//packages/core/environment/core-environment-server-internal", - "//packages/core/execution-context/core-execution-context-server-internal", - "//packages/core/preboot/core-preboot-server-internal", - "//packages/core/http/core-http-context-server-internal", - "//packages/core/http/core-http-server-internal", - "//packages/core/elasticsearch/core-elasticsearch-server-internal", - "//packages/core/metrics/core-metrics-server-internal", - "//packages/core/capabilities/core-capabilities-server-internal", - "//packages/core/saved-objects/core-saved-objects-base-server-internal", - "//packages/core/saved-objects/core-saved-objects-server-internal", - "//packages/core/i18n/core-i18n-server-internal", - "//packages/core/deprecations/core-deprecations-server-internal", - "//packages/core/usage-data/core-usage-data-server-internal", - "//packages/core/status/core-status-server-internal", - "//packages/core/ui-settings/core-ui-settings-server-internal", - "//packages/core/http/core-http-request-handler-context-server-internal", - "//packages/core/rendering/core-rendering-server-internal", - "//packages/core/http/core-http-resources-server-internal", - "//packages/core/plugins/core-plugins-server-internal", - "//packages/core/apps/core-apps-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//elastic-apm-node", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-ebt-tools:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/doc-links/core-doc-links-server-internal:npm_module_types", - "//packages/core/logging/core-logging-server-internal:npm_module_types", - "//packages/core/config/core-config-server-internal:npm_module_types", - "//packages/core/node/core-node-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/environment/core-environment-server-internal:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-internal:npm_module_types", - "//packages/core/preboot/core-preboot-server-internal:npm_module_types", - "//packages/core/http/core-http-context-server-internal:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-server-internal:npm_module_types", - "//packages/core/capabilities/core-capabilities-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/i18n/core-i18n-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-server-internal:npm_module_types", - "//packages/core/status/core-status-server-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-internal:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server-internal:npm_module_types", - "//packages/core/http/core-http-request-handler-context-server:npm_module_types", - "//packages/core/rendering/core-rendering-server-internal:npm_module_types", - "//packages/core/http/core-http-resources-server-internal:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", - "//packages/core/plugins/core-plugins-server-internal:npm_module_types", - "//packages/core/apps/core-apps-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/root/core-root-server-internal/kibana.jsonc b/packages/core/root/core-root-server-internal/kibana.jsonc index b2cd75af099e..45446380c449 100644 --- a/packages/core/root/core-root-server-internal/kibana.jsonc +++ b/packages/core/root/core-root-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-root-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/root/core-root-server-internal/package.json b/packages/core/root/core-root-server-internal/package.json index 2d71f791a6e5..eed5c24376fd 100644 --- a/packages/core/root/core-root-server-internal/package.json +++ b/packages/core/root/core-root-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-root-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/core/root/core-root-server-internal/src/bootstrap.ts b/packages/core/root/core-root-server-internal/src/bootstrap.ts index 5aa602328e67..d37e589e66ef 100644 --- a/packages/core/root/core-root-server-internal/src/bootstrap.ts +++ b/packages/core/root/core-root-server-internal/src/bootstrap.ts @@ -34,7 +34,7 @@ export async function bootstrap({ configs, cliArgs, applyConfigOverrides }: Boot // and as `REPO_ROOT` is initialized on the fly when importing `dev-utils` and requires // the `fs` package, it causes failures. This is why we use a dynamic `require` here. // eslint-disable-next-line @typescript-eslint/no-var-requires - const { REPO_ROOT } = require('@kbn/utils'); + const { REPO_ROOT } = require('@kbn/repo-info'); const env = Env.createDefault(REPO_ROOT, { configs, diff --git a/packages/core/root/core-root-server-internal/src/root/index.test.ts b/packages/core/root/core-root-server-internal/src/root/index.test.ts index 707975affd2b..278c56bbe745 100644 --- a/packages/core/root/core-root-server-internal/src/root/index.test.ts +++ b/packages/core/root/core-root-server-internal/src/root/index.test.ts @@ -10,7 +10,7 @@ import { rawConfigService, configService, logger, mockServer } from './index.tes import { BehaviorSubject } from 'rxjs'; import { filter, first } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { Root } from '.'; diff --git a/packages/core/root/core-root-server-internal/src/server.test.ts b/packages/core/root/core-root-server-internal/src/server.test.ts index 9826430b2340..894dbeca94f6 100644 --- a/packages/core/root/core-root-server-internal/src/server.test.ts +++ b/packages/core/root/core-root-server-internal/src/server.test.ts @@ -28,7 +28,7 @@ import { } from './server.test.mocks'; import { BehaviorSubject } from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { rawConfigServiceMock, getEnvOptions } from '@kbn/config-mocks'; import { Server } from './server'; diff --git a/packages/core/root/core-root-server-internal/tsconfig.json b/packages/core/root/core-root-server-internal/tsconfig.json index 4582562d6c9b..2e4947a51c39 100644 --- a/packages/core/root/core-root-server-internal/tsconfig.json +++ b/packages/core/root/core-root-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,64 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utils", + "@kbn/logging", + "@kbn/config", + "@kbn/ebt-tools", + "@kbn/core-base-server-internal", + "@kbn/core-doc-links-server-internal", + "@kbn/core-logging-server-internal", + "@kbn/core-config-server-internal", + "@kbn/core-node-server-internal", + "@kbn/core-analytics-server-internal", + "@kbn/core-analytics-server", + "@kbn/core-environment-server-internal", + "@kbn/core-execution-context-server-internal", + "@kbn/core-preboot-server-internal", + "@kbn/core-http-context-server-internal", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-metrics-server-internal", + "@kbn/core-capabilities-server-internal", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-i18n-server-internal", + "@kbn/core-deprecations-server-internal", + "@kbn/core-usage-data-server-internal", + "@kbn/core-status-server-internal", + "@kbn/core-ui-settings-server-internal", + "@kbn/core-http-request-handler-context-server-internal", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-rendering-server-internal", + "@kbn/core-http-resources-server-internal", + "@kbn/core-lifecycle-server-internal", + "@kbn/core-plugins-server-internal", + "@kbn/core-apps-server-internal", + "@kbn/core-http-server-mocks", + "@kbn/core-plugins-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/config-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-http-context-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/core-rendering-server-mocks", + "@kbn/core-environment-server-mocks", + "@kbn/core-node-server-mocks", + "@kbn/core-metrics-server-mocks", + "@kbn/core-status-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-i18n-server-mocks", + "@kbn/core-preboot-server-mocks", + "@kbn/core-deprecations-server-mocks", + "@kbn/core-doc-links-server-mocks", + "@kbn/repo-info", + "@kbn/config-schema", + "@kbn/apm-config-loader", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel deleted file mode 100644 index c5335b58bdd1..000000000000 --- a/packages/core/saved-objects/core-saved-objects-api-browser/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-api-browser" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-api-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-api-browser/kibana.jsonc index dc9bc275a4cb..29d24ccc6a08 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-api-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-api-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/package.json b/packages/core/saved-objects/core-saved-objects-api-browser/package.json index af4889e4c341..3b9859c73e28 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-saved-objects-api-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json index ef521586433c..271f341183fc 100644 --- a/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-api-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel deleted file mode 100644 index c35025c728e5..000000000000 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/BUILD.bazel +++ /dev/null @@ -1,130 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-api-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-api-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks/*", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//p-map", - "@npm//@hapi/boom", - "//packages/kbn-config-schema", - "//packages/kbn-es-query", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", - "//packages/core/elasticsearch/core-elasticsearch-server-internal", - "//packages/core/usage-data/core-usage-data-base-server-internal", - "//packages/core/saved-objects/core-saved-objects-utils-server", - #### test dependencies - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "@npm//p-map", - "@npm//@hapi/boom", - "@npm//@elastic/elasticsearch", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-es-query:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-api-server-internal/kibana.jsonc index afef1f03740a..e85d65a50788 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-api-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json index 99461f483c86..6e0e4b37c6dd 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-api-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/test_helpers/repository.test.common.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/test_helpers/repository.test.common.ts index 99b87279c8b6..a6b9ba684b56 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/test_helpers/repository.test.common.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/test_helpers/repository.test.common.ts @@ -484,7 +484,7 @@ export const mockUpdateResponse = ( ); }; -export const updateSuccess = async ( +export const updateSuccess = async >( client: ElasticsearchClientMock, repository: SavedObjectsRepository, registry: SavedObjectTypeRegistry, diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json index 4582562d6c9b..6f7ca16e5d58 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,31 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/es-query", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-utils-server", + "@kbn/logging-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/es-errors", + "@kbn/safer-lodash-set", + "@kbn/utility-types-jest", + "@kbn/logging", + "@kbn/core-elasticsearch-server", + "@kbn/core-http-server", + "@kbn/core-http-server-mocks", + "@kbn/core-saved-objects-migration-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel deleted file mode 100644 index c746f77a7473..000000000000 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-api-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-api-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/saved-objects/core-saved-objects-utils-server", - "//packages/core/saved-objects/core-saved-objects-api-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-api-server-mocks/kibana.jsonc index beb632af28c0..0bb78d126e72 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-api-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json index 344dee3e9e71..d1b99b1ab49a 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-api-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json index 4582562d6c9b..96548fe6eaac 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-api-server-internal", + "@kbn/core-saved-objects-utils-server", + "@kbn/logging-mocks", + "@kbn/core-saved-objects-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel deleted file mode 100644 index 80a40011e1a9..000000000000 --- a/packages/core/saved-objects/core-saved-objects-api-server/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-api-server" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-api-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/elasticsearch", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-api-server/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-api-server/kibana.jsonc index 08ebe81051b6..4f6c6b3f761d 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-api-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-api-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-api-server/package.json b/packages/core/saved-objects/core-saved-objects-api-server/package.json index 006b28669cf7..36b5e9f23a63 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-api-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-api-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json index ef521586433c..0e593db446f6 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-api-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-saved-objects-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel deleted file mode 100644 index 99fc132ed18e..000000000000 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-base-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-base-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//semver", - "//packages/kbn-config-schema", - ### test dependencies - "//packages/kbn-logging-mocks", - "@npm//@hapi/boom", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/semver", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-base-server-internal/kibana.jsonc index a14d74263ec9..fba789e2893c 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-base-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json index d630f04e6631..31ed83a1f27f 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-base-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json index ef521586433c..5227e67e6947 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,17 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/config-schema", + "@kbn/core-base-server-internal", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-utils-server", + "@kbn/std", + "@kbn/logging-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel deleted file mode 100644 index c5ef95201325..000000000000 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-base-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-base-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-base-server-mocks/kibana.jsonc index deab59887d74..29356da39ae3 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-base-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json index 3ff49367166f..3a5786139f6c 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-base-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json index ef521586433c..d60979195832 100644 --- a/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-base-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel deleted file mode 100644 index 0228c86c6d99..000000000000 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "//packages/kbn-safer-lodash-set", - ### test dependencies - "//packages/core/http/core-http-browser-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/core/base/core-base-browser-internal:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-browser-internal/kibana.jsonc index ec1e45b0ffb3..85abf04f839f 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/package.json b/packages/core/saved-objects/core-saved-objects-browser-internal/package.json index 1117da4a27c9..5cfe8ec3aeae 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-saved-objects-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json index ef521586433c..a29dbf58b411 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/safer-lodash-set", + "@kbn/core-base-browser-internal", + "@kbn/core-http-browser", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-browser", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-api-browser", + "@kbn/core-http-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel deleted file mode 100644 index 0bea85871440..000000000000 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/saved-objects/core-saved-objects-browser-internal" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-browser-mocks/kibana.jsonc index cf0623a36b70..105338611b28 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json b/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json index bba43d5d36ae..db85475b718c 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-saved-objects-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json index ef521586433c..0a68b34d3b83 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-saved-objects-browser", + "@kbn/core-saved-objects-browser-internal", + "@kbn/core-saved-objects-api-browser", + "@kbn/core-saved-objects-common", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel deleted file mode 100644 index e54003311090..000000000000 --- a/packages/core/saved-objects/core-saved-objects-browser/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-browser" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-api-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-browser/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-browser/kibana.jsonc index 923add888b03..b09f75ea9f6c 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-browser/package.json b/packages/core/saved-objects/core-saved-objects-browser/package.json index 76019a9aaab8..d897a3fbf3d9 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/package.json +++ b/packages/core/saved-objects/core-saved-objects-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-saved-objects-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json b/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json index ef521586433c..737e72c758c9 100644 --- a/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-saved-objects-api-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel deleted file mode 100644 index 18376aa9960e..000000000000 --- a/packages/core/saved-objects/core-saved-objects-common/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-common" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-common/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-common/kibana.jsonc index d82a9bf67d32..205503f731e7 100644 --- a/packages/core/saved-objects/core-saved-objects-common/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-common/package.json b/packages/core/saved-objects/core-saved-objects-common/package.json index 11849bd364a1..64260227c7a5 100644 --- a/packages/core/saved-objects/core-saved-objects-common/package.json +++ b/packages/core/saved-objects/core-saved-objects-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-saved-objects-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-common/tsconfig.json b/packages/core/saved-objects/core-saved-objects-common/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/saved-objects/core-saved-objects-common/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel deleted file mode 100644 index 1004b8bdc006..000000000000 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-import-export-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-import-export-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//uuid", - "@npm//p-map", - "//packages/kbn-utils", - ### test dependencies - "//packages/core/saved-objects/core-saved-objects-api-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//p-map", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/kibana.jsonc index eabb9e670baf..cde6f2516df0 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-import-export-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json index 83b06bcce8d2..e06b053497dd 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-import-export-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json index 4582562d6c9b..0cd74a160792 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,23 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utils", + "@kbn/logging", + "@kbn/core-http-server", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-server", + "@kbn/core-http-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/logging-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-http-router-server-internal", + "@kbn/core-saved-objects-utils-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel deleted file mode 100644 index 4189affe70b4..000000000000 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-import-export-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-import-export-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/kibana.jsonc index 174960bd1aad..20b09ed4cf69 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-import-export-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json index e6117d0a4df3..27679e391708 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-import-export-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json index 4582562d6c9b..473437fa0be8 100644 --- a/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-saved-objects-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel deleted file mode 100644 index e582bb081188..000000000000 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-migration-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-migration-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//uuid", - "@npm//semver", - "@npm//fp-ts", - "@npm//lodash", - "@npm//@hapi/boom", - "@npm//@elastic/elasticsearch", - "//packages/kbn-std", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal", - ### test dependencies - "//packages/core/elasticsearch/core-elasticsearch-server-mocks", - "//packages/core/elasticsearch/core-elasticsearch-client-server-mocks", - "//packages/core/logging/core-logging-server-mocks", - -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/uuid", - "@npm//@types/semver", - "@npm//fp-ts", - "@npm//lodash", - "@npm//@hapi/boom", - "@npm//@elastic/elasticsearch", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/core/doc-links/core-doc-links-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-client-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-migration-server-internal/kibana.jsonc index 4a04817a139c..05f06aeb86b8 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-migration-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json index 1759e06b6594..82412503a878 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-migration-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json index 4582562d6c9b..3612fae05aba 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,28 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/std", + "@kbn/core-doc-links-server", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-utils-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-logging-server-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/config-schema", + "@kbn/core-doc-links-server-mocks", + "@kbn/core-logging-server-internal", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/doc-links", + "@kbn/safer-lodash-set", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel deleted file mode 100644 index 9dbf4e0b79d6..000000000000 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/BUILD.bazel +++ /dev/null @@ -1,109 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-migration-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-migration-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/kibana.jsonc index b27f6951cb0d..49e49c7d12b4 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-migration-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json index ac9a5a819185..b509883da091 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-migration-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json index 4582562d6c9b..b228481a3207 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-migration-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-migration-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel deleted file mode 100644 index 7bcee948e25e..000000000000 --- a/packages/core/saved-objects/core-saved-objects-server-internal/BUILD.bazel +++ /dev/null @@ -1,131 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//json-stable-stringify", - "//packages/kbn-config-schema", - "//packages/core/base/core-base-common", - "//packages/core/status/core-status-common", - "//packages/core/saved-objects/core-saved-objects-base-server-internal", - "//packages/core/saved-objects/core-saved-objects-api-server-internal", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal", - "//packages/core/saved-objects/core-saved-objects-import-export-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/json-stable-stringify", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/deprecations/core-deprecations-common:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-migration-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-import-export-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", - "//packages/core/deprecations/core-deprecations-server:npm_module_types", - "//packages/core/node/core-node-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-server-internal/kibana.jsonc index 43cadd207f91..4e71454f9ca7 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-server-internal/package.json index 1d0e563c9440..a39ed97cfeb6 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/package.json +++ b/packages/core/saved-objects/core-saved-objects-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts index af364b6a1a87..6afe9eb18b4f 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/saved_objects_service.test.ts @@ -21,7 +21,7 @@ import { BehaviorSubject, firstValueFrom } from 'rxjs'; import { skip } from 'rxjs/operators'; import { type RawPackageInfo, Env } from '@kbn/config'; import { ByteSizeValue } from '@kbn/config-schema'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; import { nodeServiceMock } from '@kbn/core-node-server-mocks'; diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json index 4582562d6c9b..4d43cd2ea06b 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,45 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-status-common", + "@kbn/core-deprecations-common", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-api-server-internal", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-migration-server-internal", + "@kbn/core-saved-objects-import-export-server-internal", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-deprecations-server", + "@kbn/core-node-server", + "@kbn/core-saved-objects-migration-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-base-server-internal", + "@kbn/core-doc-links-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/i18n", + "@kbn/config", + "@kbn/repo-info", + "@kbn/config-mocks", + "@kbn/core-doc-links-server-mocks", + "@kbn/core-node-server-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/utils", + "@kbn/core-http-router-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel deleted file mode 100644 index 83fc281ab340..000000000000 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/status/core-status-common", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks", - "//packages/core/saved-objects/core-saved-objects-import-export-server-mocks", - "//packages/core/saved-objects/core-saved-objects-migration-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-import-export-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-migration-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-server-mocks/kibana.jsonc index c9cb96751b21..4e9f3fa49b01 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-server-mocks/package.json index 9057e65e2b31..c9a4ce797ab3 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/package.json +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json index 4582562d6c9b..30ab276e44e3 100644 --- a/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-status-common", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-saved-objects-import-export-server-mocks", + "@kbn/core-saved-objects-migration-server-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel deleted file mode 100644 index 8be58e1f2856..000000000000 --- a/packages/core/saved-objects/core-saved-objects-server/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-server" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/elasticsearch", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-ecs:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-server/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-server/kibana.jsonc index 8e1a56b92f1f..b6baeefd08b9 100644 --- a/packages/core/saved-objects/core-saved-objects-server/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-server/package.json b/packages/core/saved-objects/core-saved-objects-server/package.json index 1cfa72bf9cee..0212a1c862e2 100644 --- a/packages/core/saved-objects/core-saved-objects-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-server/tsconfig.json index ef521586433c..427b46dc70af 100644 --- a/packages/core/saved-objects/core-saved-objects-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/core-http-server", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-api-server", + "@kbn/ecs" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel deleted file mode 100644 index ae246f3976c4..000000000000 --- a/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-saved-objects-utils-server" -PKG_REQUIRE_NAME = "@kbn/core-saved-objects-utils-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//uuid", - "@npm//@hapi/boom", -] - - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/uuid", - "@npm//@hapi/boom", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/kibana.jsonc b/packages/core/saved-objects/core-saved-objects-utils-server/kibana.jsonc index 61d87e1fe9bd..17724acc7468 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/kibana.jsonc +++ b/packages/core/saved-objects/core-saved-objects-utils-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-saved-objects-utils-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/package.json b/packages/core/saved-objects/core-saved-objects-utils-server/package.json index 28293054578d..9b89498d64fc 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/package.json +++ b/packages/core/saved-objects/core-saved-objects-utils-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-saved-objects-utils-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json index ef521586433c..25ba9d5fefac 100644 --- a/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-api-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/status/core-status-common-internal/BUILD.bazel b/packages/core/status/core-status-common-internal/BUILD.bazel deleted file mode 100644 index 10c02ceed52f..000000000000 --- a/packages/core/status/core-status-common-internal/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-status-common-internal" -PKG_REQUIRE_NAME = "@kbn/core-status-common-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/status/core-status-common-internal/kibana.jsonc b/packages/core/status/core-status-common-internal/kibana.jsonc index 3ce3b2bfbcbd..20ce17ae3cef 100644 --- a/packages/core/status/core-status-common-internal/kibana.jsonc +++ b/packages/core/status/core-status-common-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-status-common-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/status/core-status-common-internal/package.json b/packages/core/status/core-status-common-internal/package.json index 7d5bbf52425a..73f0212c4385 100644 --- a/packages/core/status/core-status-common-internal/package.json +++ b/packages/core/status/core-status-common-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-status-common-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/status/core-status-common-internal/tsconfig.json b/packages/core/status/core-status-common-internal/tsconfig.json index 741519055e98..c746e7133cd2 100644 --- a/packages/core/status/core-status-common-internal/tsconfig.json +++ b/packages/core/status/core-status-common-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-status-common", + "@kbn/core-metrics-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/status/core-status-common/BUILD.bazel b/packages/core/status/core-status-common/BUILD.bazel deleted file mode 100644 index a488a5999df0..000000000000 --- a/packages/core/status/core-status-common/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-status-common" -PKG_REQUIRE_NAME = "@kbn/core-status-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-std:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/status/core-status-common/kibana.jsonc b/packages/core/status/core-status-common/kibana.jsonc index 13d67c52659c..bb40934299c7 100644 --- a/packages/core/status/core-status-common/kibana.jsonc +++ b/packages/core/status/core-status-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-status-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/status/core-status-common/package.json b/packages/core/status/core-status-common/package.json index 0c32405177b4..c8428e799d26 100644 --- a/packages/core/status/core-status-common/package.json +++ b/packages/core/status/core-status-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-status-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/status/core-status-common/tsconfig.json b/packages/core/status/core-status-common/tsconfig.json index 741519055e98..a63f70f93043 100644 --- a/packages/core/status/core-status-common/tsconfig.json +++ b/packages/core/status/core-status-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/std" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/status/core-status-server-internal/BUILD.bazel b/packages/core/status/core-status-server-internal/BUILD.bazel deleted file mode 100644 index 2e15439eee3d..000000000000 --- a/packages/core/status/core-status-server-internal/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-status-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-status-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//lodash", - "//packages/kbn-config-schema", - "//packages/kbn-std", - "//packages/kbn-i18n", - "//packages/core/status/core-status-common", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//lodash", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/analytics/client:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/metrics/core-metrics-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-server-internal:npm_module_types", - "//packages/core/analytics/core-analytics-server:npm_module_types", - "//packages/core/environment/core-environment-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/status/core-status-server:npm_module_types", - "//packages/core/status/core-status-common:npm_module_types", - "//packages/core/status/core-status-common-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/status/core-status-server-internal/kibana.jsonc b/packages/core/status/core-status-server-internal/kibana.jsonc index 9ed3627ce73e..166476e13ada 100644 --- a/packages/core/status/core-status-server-internal/kibana.jsonc +++ b/packages/core/status/core-status-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-status-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/status/core-status-server-internal/package.json b/packages/core/status/core-status-server-internal/package.json index 0c2023160601..a9be6cf042d3 100644 --- a/packages/core/status/core-status-server-internal/package.json +++ b/packages/core/status/core-status-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-status-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/status/core-status-server-internal/tsconfig.json b/packages/core/status/core-status-server-internal/tsconfig.json index 4582562d6c9b..ec555e676e1e 100644 --- a/packages/core/status/core-status-server-internal/tsconfig.json +++ b/packages/core/status/core-status-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,39 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/config", + "@kbn/std", + "@kbn/logging", + "@kbn/i18n", + "@kbn/analytics-client", + "@kbn/core-base-common", + "@kbn/core-base-server-internal", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-metrics-server", + "@kbn/core-metrics-server-internal", + "@kbn/core-usage-data-server", + "@kbn/core-analytics-server", + "@kbn/core-environment-server-internal", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-status-server", + "@kbn/core-status-common", + "@kbn/core-status-common-internal", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-base-server-mocks", + "@kbn/core-environment-server-mocks", + "@kbn/core-http-router-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-metrics-server-mocks", + "@kbn/config-mocks", + "@kbn/core-usage-data-server-mocks", + "@kbn/core-analytics-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/status/core-status-server-mocks/BUILD.bazel b/packages/core/status/core-status-server-mocks/BUILD.bazel deleted file mode 100644 index ba6451364481..000000000000 --- a/packages/core/status/core-status-server-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-status-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-status-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/status/core-status-server:npm_module_types", - "//packages/core/status/core-status-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/status/core-status-server-mocks/kibana.jsonc b/packages/core/status/core-status-server-mocks/kibana.jsonc index 04f0e29eedf7..ebb50f47fb40 100644 --- a/packages/core/status/core-status-server-mocks/kibana.jsonc +++ b/packages/core/status/core-status-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-status-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/status/core-status-server-mocks/package.json b/packages/core/status/core-status-server-mocks/package.json index 666843aad894..25c27fc8dd0b 100644 --- a/packages/core/status/core-status-server-mocks/package.json +++ b/packages/core/status/core-status-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-status-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/status/core-status-server-mocks/tsconfig.json b/packages/core/status/core-status-server-mocks/tsconfig.json index 4582562d6c9b..84ca957ca157 100644 --- a/packages/core/status/core-status-server-mocks/tsconfig.json +++ b/packages/core/status/core-status-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-status-server", + "@kbn/core-status-server-internal", + "@kbn/core-status-common", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/status/core-status-server/BUILD.bazel b/packages/core/status/core-status-server/BUILD.bazel deleted file mode 100644 index d9cf0a216956..000000000000 --- a/packages/core/status/core-status-server/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-status-server" -PKG_REQUIRE_NAME = "@kbn/core-status-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/status/core-status-common", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/core/status/core-status-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/status/core-status-server/kibana.jsonc b/packages/core/status/core-status-server/kibana.jsonc index 3021a52ce4c1..7e7eafcbe13c 100644 --- a/packages/core/status/core-status-server/kibana.jsonc +++ b/packages/core/status/core-status-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-status-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/status/core-status-server/package.json b/packages/core/status/core-status-server/package.json index 95e42e16f809..4f3719672132 100644 --- a/packages/core/status/core-status-server/package.json +++ b/packages/core/status/core-status-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-status-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/status/core-status-server/tsconfig.json b/packages/core/status/core-status-server/tsconfig.json index 4582562d6c9b..f1268b704981 100644 --- a/packages/core/status/core-status-server/tsconfig.json +++ b/packages/core/status/core-status-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-status-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel deleted file mode 100644 index 72af0cdf5452..000000000000 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-test-helpers-deprecations-getters" -PKG_REQUIRE_NAME = "@kbn/core-test-helpers-deprecations-getters" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-safer-lodash-set", - "//packages/kbn-config", - "//packages/kbn-config-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/kibana.jsonc b/packages/core/test-helpers/core-test-helpers-deprecations-getters/kibana.jsonc index 1c245768d3f7..58b022edc214 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/kibana.jsonc +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-test-helpers-deprecations-getters", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json b/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json index 37bfe7ddbf75..cc23ac6bc507 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-test-helpers-deprecations-getters", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json b/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json index ef521586433c..709b092761e4 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/safer-lodash-set", + "@kbn/config", + "@kbn/config-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel deleted file mode 100644 index 4161d62c3a05..000000000000 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-test-helpers-http-setup-browser" -PKG_REQUIRE_NAME = "@kbn/core-test-helpers-http-setup-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/execution-context/core-execution-context-browser-mocks", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks", - "//packages/core/http/core-http-browser-internal" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/execution-context/core-execution-context-browser-mocks:npm_module_types", - "//packages/core/fatal-errors/core-fatal-errors-browser-mocks:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-mocks:npm_module_types", - "//packages/core/http/core-http-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/kibana.jsonc b/packages/core/test-helpers/core-test-helpers-http-setup-browser/kibana.jsonc index f5e257dd883a..ccb44bf669f6 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/kibana.jsonc +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-test-helpers-http-setup-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json b/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json index 813f6050c044..b9de84e85e87 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-test-helpers-http-setup-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json b/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json index ef521586433c..50f950223c66 100644 --- a/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-http-setup-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-http-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/test-helpers/core-test-helpers-kbn-server/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-kbn-server/BUILD.bazel deleted file mode 100644 index aaa2b09a3ebf..000000000000 --- a/packages/core/test-helpers/core-test-helpers-kbn-server/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-test-helpers-kbn-server" -PKG_REQUIRE_NAME = "@kbn/core-test-helpers-kbn-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "@npm//supertest", - "//packages/kbn-tooling-log", - "//packages/kbn-utils", - "//packages/kbn-test", - "//packages/kbn-config", - "//packages/core/lifecycle/core-lifecycle-server-internal", - "//packages/core/root/core-root-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "@npm//rxjs", - "@npm//supertest", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-test:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types", - "//packages/core/root/core-root-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/test-helpers/core-test-helpers-kbn-server/kibana.jsonc b/packages/core/test-helpers/core-test-helpers-kbn-server/kibana.jsonc index 8c67f3103320..399c4032208c 100644 --- a/packages/core/test-helpers/core-test-helpers-kbn-server/kibana.jsonc +++ b/packages/core/test-helpers/core-test-helpers-kbn-server/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/core-test-helpers-kbn-server", "owner": "@elastic/kibana-core", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/core/test-helpers/core-test-helpers-kbn-server/package.json b/packages/core/test-helpers/core-test-helpers-kbn-server/package.json index 6f5c80544bd1..dbdbcfb37419 100644 --- a/packages/core/test-helpers/core-test-helpers-kbn-server/package.json +++ b/packages/core/test-helpers/core-test-helpers-kbn-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-test-helpers-kbn-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/core/test-helpers/core-test-helpers-kbn-server/src/create_root.ts b/packages/core/test-helpers/core-test-helpers-kbn-server/src/create_root.ts index 8a2ef2e7c81e..08a99ae61a96 100644 --- a/packages/core/test-helpers/core-test-helpers-kbn-server/src/create_root.ts +++ b/packages/core/test-helpers/core-test-helpers-kbn-server/src/create_root.ts @@ -13,7 +13,7 @@ import { BehaviorSubject } from 'rxjs'; import supertest from 'supertest'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createTestEsCluster, CreateTestEsClusterOptions, diff --git a/packages/core/test-helpers/core-test-helpers-kbn-server/tsconfig.json b/packages/core/test-helpers/core-test-helpers-kbn-server/tsconfig.json index 4582562d6c9b..4f2c8c210354 100644 --- a/packages/core/test-helpers/core-test-helpers-kbn-server/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-kbn-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/test", + "@kbn/config", + "@kbn/core-lifecycle-server-internal", + "@kbn/core-root-server-internal", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel deleted file mode 100644 index 4f9f25dd7707..000000000000 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/BUILD.bazel +++ /dev/null @@ -1,109 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-test-helpers-so-type-serializer" -PKG_REQUIRE_NAME = "@kbn/core-test-helpers-so-type-serializer" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//semver", - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/semver", - "//packages/kbn-std:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/kibana.jsonc b/packages/core/test-helpers/core-test-helpers-so-type-serializer/kibana.jsonc index 4a4a765bbc51..7c8c4da8c303 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/kibana.jsonc +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-test-helpers-so-type-serializer", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json b/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json index 2c0288ec0123..b3cc2a750409 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-test-helpers-so-type-serializer", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json b/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json index 4582562d6c9b..9e3df6e49fac 100644 --- a/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-so-type-serializer/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/std", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-server", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel deleted file mode 100644 index 19fda628add7..000000000000 --- a/packages/core/test-helpers/core-test-helpers-test-utils/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-test-helpers-test-utils" -PKG_REQUIRE_NAME = "@kbn/core-test-helpers-test-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/core/deprecations/core-deprecations-server-mocks", - "//packages/core/execution-context/core-execution-context-server-mocks", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks", - "//packages/core/http/core-http-context-server-internal", - "//packages/core/http/core-http-context-server-mocks", - "//packages/core/http/core-http-server-mocks", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks", - "//packages/core/saved-objects/core-saved-objects-server-mocks", - "//packages/core/ui-settings/core-ui-settings-server-mocks", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/deprecations/core-deprecations-server-mocks:npm_module_types", - "//packages/core/execution-context/core-execution-context-server-mocks:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-mocks:npm_module_types", - "//packages/core/http/core-http-context-server-internal:npm_module_types", - "//packages/core/http/core-http-context-server-mocks:npm_module_types", - "//packages/core/http/core-http-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-mocks:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-mocks:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/kibana.jsonc b/packages/core/test-helpers/core-test-helpers-test-utils/kibana.jsonc index a587c1fd8566..3e4b11f13d95 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/kibana.jsonc +++ b/packages/core/test-helpers/core-test-helpers-test-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-test-helpers-test-utils", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/package.json b/packages/core/test-helpers/core-test-helpers-test-utils/package.json index e812501e0ff7..f417a155fed2 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/package.json +++ b/packages/core/test-helpers/core-test-helpers-test-utils/package.json @@ -2,7 +2,5 @@ "name": "@kbn/core-test-helpers-test-utils", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json b/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json index 4582562d6c9b..6f6374588407 100644 --- a/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json +++ b/packages/core/test-helpers/core-test-helpers-test-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,21 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-deprecations-server-mocks", + "@kbn/core-execution-context-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-http-context-server-internal", + "@kbn/core-http-context-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-ui-settings-server-mocks" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/theme/core-theme-browser-internal/BUILD.bazel b/packages/core/theme/core-theme-browser-internal/BUILD.bazel deleted file mode 100644 index c149e0b9e069..000000000000 --- a/packages/core/theme/core-theme-browser-internal/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-theme-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-theme-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react", - "@npm//rxjs", - "@npm//@elastic/eui", - "@npm//@emotion/cache", - "@npm//react-use", - "//packages/core/base/core-base-common", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//rxjs", - "@npm//@emotion/cache", - "@npm//react-use", - "@npm//@elastic/eui", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/i18n/core-i18n-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/theme/core-theme-browser-internal/kibana.jsonc b/packages/core/theme/core-theme-browser-internal/kibana.jsonc index 36842b069548..4f52d3655e06 100644 --- a/packages/core/theme/core-theme-browser-internal/kibana.jsonc +++ b/packages/core/theme/core-theme-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-theme-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/theme/core-theme-browser-internal/package.json b/packages/core/theme/core-theme-browser-internal/package.json index 9a5bf644a384..bd819f36617f 100644 --- a/packages/core/theme/core-theme-browser-internal/package.json +++ b/packages/core/theme/core-theme-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-theme-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/theme/core-theme-browser-internal/tsconfig.json b/packages/core/theme/core-theme-browser-internal/tsconfig.json index c561d9f22012..1f52b9cf1408 100644 --- a/packages/core/theme/core-theme-browser-internal/tsconfig.json +++ b/packages/core/theme/core-theme-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,16 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/core-base-common", + "@kbn/core-injected-metadata-browser-internal", + "@kbn/core-theme-browser", + "@kbn/core-i18n-browser", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/theme/core-theme-browser-mocks/BUILD.bazel b/packages/core/theme/core-theme-browser-mocks/BUILD.bazel deleted file mode 100644 index d67987e887b0..000000000000 --- a/packages/core/theme/core-theme-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-theme-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-theme-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//react" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/theme/core-theme-browser:npm_module_types", - "//packages/core/theme/core-theme-browser-internal:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/theme/core-theme-browser-mocks/kibana.jsonc b/packages/core/theme/core-theme-browser-mocks/kibana.jsonc index e46f0193c406..f04c78bf09fe 100644 --- a/packages/core/theme/core-theme-browser-mocks/kibana.jsonc +++ b/packages/core/theme/core-theme-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-theme-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/theme/core-theme-browser-mocks/package.json b/packages/core/theme/core-theme-browser-mocks/package.json index d90fe901d796..205ae4ee096f 100644 --- a/packages/core/theme/core-theme-browser-mocks/package.json +++ b/packages/core/theme/core-theme-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-theme-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/theme/core-theme-browser-mocks/tsconfig.json b/packages/core/theme/core-theme-browser-mocks/tsconfig.json index 3cdea36de9ea..590e3729953e 100644 --- a/packages/core/theme/core-theme-browser-mocks/tsconfig.json +++ b/packages/core/theme/core-theme-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-theme-browser", + "@kbn/core-theme-browser-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/theme/core-theme-browser/BUILD.bazel b/packages/core/theme/core-theme-browser/BUILD.bazel deleted file mode 100644 index bf1b34b975a3..000000000000 --- a/packages/core/theme/core-theme-browser/BUILD.bazel +++ /dev/null @@ -1,111 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-theme-browser" -PKG_REQUIRE_NAME = "@kbn/core-theme-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/theme/core-theme-browser/kibana.jsonc b/packages/core/theme/core-theme-browser/kibana.jsonc index 9dbe039d7064..28faccea003b 100644 --- a/packages/core/theme/core-theme-browser/kibana.jsonc +++ b/packages/core/theme/core-theme-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-theme-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/theme/core-theme-browser/package.json b/packages/core/theme/core-theme-browser/package.json index 4f21a8f07883..1e8a8861ba25 100644 --- a/packages/core/theme/core-theme-browser/package.json +++ b/packages/core/theme/core-theme-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-theme-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/theme/core-theme-browser/tsconfig.json b/packages/core/theme/core-theme-browser/tsconfig.json index ef521586433c..e7513f6481e8 100644 --- a/packages/core/theme/core-theme-browser/tsconfig.json +++ b/packages/core/theme/core-theme-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel deleted file mode 100644 index 8407c14febcc..000000000000 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-browser-internal" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-browser-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//lodash", - "//packages/core/test-helpers/core-test-helpers-http-setup-browser" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//lodash", - "//packages/core/test-helpers/core-test-helpers-http-setup-browser:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-browser-internal/kibana.jsonc index 9a46e97ec89a..1197ce326899 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-browser-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/package.json b/packages/core/ui-settings/core-ui-settings-browser-internal/package.json index 496fc4fb7386..c33e1b84f354 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-ui-settings-browser-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json index ef521586433c..0beed2d6ddfb 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,17 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-test-helpers-http-setup-browser", + "@kbn/core-http-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-ui-settings-common", + "@kbn/core-http-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-injected-metadata-browser-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel deleted file mode 100644 index 944128daf6dc..000000000000 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-browser-mocks" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-browser-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", - "//packages/core/ui-settings/core-ui-settings-browser-internal" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser-internal:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-browser-mocks/kibana.jsonc index f6906835b648..fe1b1c48238c 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-browser-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json b/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json index 9f3010fa6d92..2f78aad5793e 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-ui-settings-browser-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json index ef521586433c..1fb7aec053ef 100644 --- a/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-ui-settings-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel deleted file mode 100644 index 0b46af92d86e..000000000000 --- a/packages/core/ui-settings/core-ui-settings-browser/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-browser" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/core/ui-settings/core-ui-settings-common:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-browser/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-browser/kibana.jsonc index 9129ef435fb6..57036db46d66 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-browser/package.json b/packages/core/ui-settings/core-ui-settings-browser/package.json index 0d4798f84d10..ded763061b0b 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/package.json +++ b/packages/core/ui-settings/core-ui-settings-browser/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-ui-settings-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json b/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json index 3faa31fe437a..95fe1b5c6ea0 100644 --- a/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/core-ui-settings-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel deleted file mode 100644 index c88e3142602d..000000000000 --- a/packages/core/ui-settings/core-ui-settings-common/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-common" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-common" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-analytics:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-common/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-common/kibana.jsonc index 4d9b57542369..9d12715c5ebf 100644 --- a/packages/core/ui-settings/core-ui-settings-common/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-common/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-common", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-common/package.json b/packages/core/ui-settings/core-ui-settings-common/package.json index 12da969fe70f..844f81ccab1c 100644 --- a/packages/core/ui-settings/core-ui-settings-common/package.json +++ b/packages/core/ui-settings/core-ui-settings-common/package.json @@ -2,9 +2,6 @@ "name": "@kbn/core-ui-settings-common", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-common/tsconfig.json b/packages/core/ui-settings/core-ui-settings-common/tsconfig.json index ef521586433c..3b43c09cbaa0 100644 --- a/packages/core/ui-settings/core-ui-settings-common/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-common/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/analytics" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel deleted file mode 100644 index de69c7346747..000000000000 --- a/packages/core/ui-settings/core-ui-settings-server-internal/BUILD.bazel +++ /dev/null @@ -1,127 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//semver", - "@npm//moment-timezone", - "//packages/kbn-std", - "//packages/kbn-i18n", - "//packages/kbn-config-schema", - "//packages/core/saved-objects/core-saved-objects-utils-server", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/semver", - "@npm//moment-timezone", - "@npm//lodash", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-common:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-server-internal/kibana.jsonc index b6c943e1e667..e0f62711171c 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/package.json b/packages/core/ui-settings/core-ui-settings-server-internal/package.json index 04b1646e4a86..79a2460ed510 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/package.json +++ b/packages/core/ui-settings/core-ui-settings-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-ui-settings-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/src/clients/ui_settings_client_factory.ts b/packages/core/ui-settings/core-ui-settings-server-internal/src/clients/ui_settings_client_factory.ts index db1c69a6074f..893a45d6830b 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/src/clients/ui_settings_client_factory.ts +++ b/packages/core/ui-settings/core-ui-settings-server-internal/src/clients/ui_settings_client_factory.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import type { UiSettingsServiceOptions } from '@kbn/core-ui-settings-server-internal'; +import type { UiSettingsServiceOptions } from '../..'; import { UiSettingsClient } from './ui_settings_client'; import { UiSettingsGlobalClient } from './ui_settings_global_client'; diff --git a/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json index 4582562d6c9b..b90718d624e9 100644 --- a/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,32 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/ui-shared-deps-npm", + "@kbn/logging", + "@kbn/std", + "@kbn/i18n", + "@kbn/config-schema", + "@kbn/core-base-server-internal", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-saved-objects-utils-server", + "@kbn/core-ui-settings-common", + "@kbn/core-ui-settings-server", + "@kbn/config", + "@kbn/core-base-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-saved-objects-api-server-internal", + "@kbn/core-saved-objects-common", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel deleted file mode 100644 index 8b016335d66e..000000000000 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-server-mocks/kibana.jsonc index 5426961c3a66..b82edffb705d 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/package.json b/packages/core/ui-settings/core-ui-settings-server-mocks/package.json index c22f7b69954b..e7de21bf88c8 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/package.json +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-ui-settings-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json index 4582562d6c9b..7c315c5cded7 100644 --- a/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-ui-settings-server", + "@kbn/core-ui-settings-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel b/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel deleted file mode 100644 index 0cf8fb2d3119..000000000000 --- a/packages/core/ui-settings/core-ui-settings-server/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-ui-settings-server" -PKG_REQUIRE_NAME = "@kbn/core-ui-settings-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-common:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/ui-settings/core-ui-settings-server/kibana.jsonc b/packages/core/ui-settings/core-ui-settings-server/kibana.jsonc index 5ac08792e518..11926aebbc87 100644 --- a/packages/core/ui-settings/core-ui-settings-server/kibana.jsonc +++ b/packages/core/ui-settings/core-ui-settings-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-ui-settings-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/core/ui-settings/core-ui-settings-server/package.json b/packages/core/ui-settings/core-ui-settings-server/package.json index 4f4e046e6980..8ecf2790ced1 100644 --- a/packages/core/ui-settings/core-ui-settings-server/package.json +++ b/packages/core/ui-settings/core-ui-settings-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-ui-settings-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/ui-settings/core-ui-settings-server/tsconfig.json b/packages/core/ui-settings/core-ui-settings-server/tsconfig.json index 4582562d6c9b..dce14385f9e7 100644 --- a/packages/core/ui-settings/core-ui-settings-server/tsconfig.json +++ b/packages/core/ui-settings/core-ui-settings-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-saved-objects-api-server", + "@kbn/core-ui-settings-common" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel b/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel deleted file mode 100644 index d2412fae38af..000000000000 --- a/packages/core/usage-data/core-usage-data-base-server-internal/BUILD.bazel +++ /dev/null @@ -1,107 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-usage-data-base-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-usage-data-base-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/kibana.jsonc b/packages/core/usage-data/core-usage-data-base-server-internal/kibana.jsonc index d35d6c2bbd6d..8c2a2c4b191d 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/kibana.jsonc +++ b/packages/core/usage-data/core-usage-data-base-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-usage-data-base-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/package.json b/packages/core/usage-data/core-usage-data-base-server-internal/package.json index 3bac6ca65b83..38a8bf6f749f 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/package.json +++ b/packages/core/usage-data/core-usage-data-base-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-usage-data-base-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json b/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json index 4582562d6c9b..cfcefb9833f7 100644 --- a/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-base-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-http-server", + "@kbn/core-usage-data-server", + "@kbn/core-saved-objects-server" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel b/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel deleted file mode 100644 index c677b2c16ece..000000000000 --- a/packages/core/usage-data/core-usage-data-server-internal/BUILD.bazel +++ /dev/null @@ -1,128 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-usage-data-server-internal" -PKG_REQUIRE_NAME = "@kbn/core-usage-data-server-internal" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//rxjs", - "@npm//@elastic/elasticsearch", - "//packages/kbn-config", - "//packages/core/saved-objects/core-saved-objects-base-server-internal", - "//packages/core/saved-objects/core-saved-objects-utils-server", - "//packages/core/usage-data/core-usage-data-base-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//lodash", - "@npm//rxjs", - "@npm//@elastic/elasticsearch", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/logging/core-logging-server-internal:npm_module_types", - "//packages/core/http/core-http-server:npm_module_types", - "//packages/core/http/core-http-server-internal:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/core/elasticsearch/core-elasticsearch-server-internal:npm_module_types", - "//packages/core/metrics/core-metrics-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-api-server:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", - "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/usage-data/core-usage-data-server-internal/kibana.jsonc b/packages/core/usage-data/core-usage-data-server-internal/kibana.jsonc index 30bf6865b5bb..9e8be00d3c9d 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/kibana.jsonc +++ b/packages/core/usage-data/core-usage-data-server-internal/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-usage-data-server-internal", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/usage-data/core-usage-data-server-internal/package.json b/packages/core/usage-data/core-usage-data-server-internal/package.json index 3138c86ae3ba..65e97da09e26 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/package.json +++ b/packages/core/usage-data/core-usage-data-server-internal/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-usage-data-server-internal", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json b/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json index 4582562d6c9b..51b42f8df773 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server-internal/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,33 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/config", + "@kbn/logging", + "@kbn/core-base-server-internal", + "@kbn/core-logging-server-internal", + "@kbn/core-http-server", + "@kbn/core-http-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-metrics-server", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-utils-server", + "@kbn/core-usage-data-server", + "@kbn/core-usage-data-base-server-internal", + "@kbn/config-mocks", + "@kbn/core-base-server-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-metrics-server-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel b/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel deleted file mode 100644 index d75bd1efb572..000000000000 --- a/packages/core/usage-data/core-usage-data-server-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-usage-data-server-mocks" -PKG_REQUIRE_NAME = "@kbn/core-usage-data-server-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//rxjs", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "//packages/kbn-utility-types:npm_module_types", - "//packages/core/usage-data/core-usage-data-server:npm_module_types", - "//packages/core/usage-data/core-usage-data-base-server-internal:npm_module_types", - "//packages/core/usage-data/core-usage-data-server-internal:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/usage-data/core-usage-data-server-mocks/kibana.jsonc b/packages/core/usage-data/core-usage-data-server-mocks/kibana.jsonc index f12bd25bee86..f916d41050f6 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/kibana.jsonc +++ b/packages/core/usage-data/core-usage-data-server-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-usage-data-server-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/usage-data/core-usage-data-server-mocks/package.json b/packages/core/usage-data/core-usage-data-server-mocks/package.json index 90dca09cf147..ab47ad04bc44 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/package.json +++ b/packages/core/usage-data/core-usage-data-server-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-usage-data-server-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json b/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json index 4582562d6c9b..0488bb38c3ce 100644 --- a/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/core-usage-data-server", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-usage-data-server-internal" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/core/usage-data/core-usage-data-server/BUILD.bazel b/packages/core/usage-data/core-usage-data-server/BUILD.bazel deleted file mode 100644 index 2133607f6aa8..000000000000 --- a/packages/core/usage-data/core-usage-data-server/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "core-usage-data-server" -PKG_REQUIRE_NAME = "@kbn/core-usage-data-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/core/usage-data/core-usage-data-server/kibana.jsonc b/packages/core/usage-data/core-usage-data-server/kibana.jsonc index a785db809071..722bd81550aa 100644 --- a/packages/core/usage-data/core-usage-data-server/kibana.jsonc +++ b/packages/core/usage-data/core-usage-data-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/core-usage-data-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/core/usage-data/core-usage-data-server/package.json b/packages/core/usage-data/core-usage-data-server/package.json index 5f6f8f77a93a..8b367cbfa320 100644 --- a/packages/core/usage-data/core-usage-data-server/package.json +++ b/packages/core/usage-data/core-usage-data-server/package.json @@ -2,8 +2,6 @@ "name": "@kbn/core-usage-data-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/core/usage-data/core-usage-data-server/tsconfig.json b/packages/core/usage-data/core-usage-data-server/tsconfig.json index 4582562d6c9b..77d0aa6ade3b 100644 --- a/packages/core/usage-data/core-usage-data-server/tsconfig.json +++ b/packages/core/usage-data/core-usage-data-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/home/sample_data_card/BUILD.bazel b/packages/home/sample_data_card/BUILD.bazel deleted file mode 100644 index 6697c6c0cefb..000000000000 --- a/packages/home/sample_data_card/BUILD.bazel +++ /dev/null @@ -1,152 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "sample_data_card" -PKG_REQUIRE_NAME = "@kbn/home-sample-data-card" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - "**/*.svg", - "**/*.png", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//@storybook/addon-actions", - "@npm//@storybook/react", - "@npm//enzyme", - "@npm//lodash", - "@npm//react", - "//packages/kbn-i18n", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@storybook/addon-actions", - "@npm//@storybook/react", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n:npm_module_types", - "//packages/home/sample_data_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/home/sample_data_card/kibana.jsonc b/packages/home/sample_data_card/kibana.jsonc index 37c9a72d03e4..03869fcdb70b 100644 --- a/packages/home/sample_data_card/kibana.jsonc +++ b/packages/home/sample_data_card/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/home-sample-data-card", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/home/sample_data_card/package.json b/packages/home/sample_data_card/package.json index 35d0f1b22ef3..c82ba35d9423 100644 --- a/packages/home/sample_data_card/package.json +++ b/packages/home/sample_data_card/package.json @@ -2,8 +2,5 @@ "name": "@kbn/home-sample-data-card", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/home/sample_data_card/tsconfig.json b/packages/home/sample_data_card/tsconfig.json index 158e1387bb88..531dd52379f1 100644 --- a/packages/home/sample_data_card/tsconfig.json +++ b/packages/home/sample_data_card/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/home-sample-data-types", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/home/sample_data_tab/BUILD.bazel b/packages/home/sample_data_tab/BUILD.bazel deleted file mode 100644 index 54e0ea0c82c6..000000000000 --- a/packages/home/sample_data_tab/BUILD.bazel +++ /dev/null @@ -1,146 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "sample_data_tab" -PKG_REQUIRE_NAME = "@kbn/home-sample-data-tab" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - "**/*.png", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@elastic/eui", - "//packages/kbn-i18n", - "//packages/home/sample_data_card", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ambient-ui-types", - "//packages/home/sample_data_types", - "//packages/home/sample_data_card:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/home/sample_data_tab/kibana.jsonc b/packages/home/sample_data_tab/kibana.jsonc index 9e57d400caa6..ecf1eae5d146 100644 --- a/packages/home/sample_data_tab/kibana.jsonc +++ b/packages/home/sample_data_tab/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/home-sample-data-tab", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/home/sample_data_tab/package.json b/packages/home/sample_data_tab/package.json index beb7a99f8aa6..435df25207ff 100644 --- a/packages/home/sample_data_tab/package.json +++ b/packages/home/sample_data_tab/package.json @@ -2,8 +2,5 @@ "name": "@kbn/home-sample-data-tab", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/home/sample_data_tab/tsconfig.json b/packages/home/sample_data_tab/tsconfig.json index 158e1387bb88..3cdeb5489c22 100644 --- a/packages/home/sample_data_tab/tsconfig.json +++ b/packages/home/sample_data_tab/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/home-sample-data-card", + "@kbn/home-sample-data-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/home/sample_data_types/BUILD.bazel b/packages/home/sample_data_types/BUILD.bazel deleted file mode 100644 index 574f07ca11e6..000000000000 --- a/packages/home/sample_data_types/BUILD.bazel +++ /dev/null @@ -1,58 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "sample_data_types" -PKG_REQUIRE_NAME = "@kbn/home-sample-data-types" -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/home/sample_data_types/kibana.jsonc b/packages/home/sample_data_types/kibana.jsonc index db7884dd0d07..f82d226f836e 100644 --- a/packages/home/sample_data_types/kibana.jsonc +++ b/packages/home/sample_data_types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/home-sample-data-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/home/sample_data_types/package.json b/packages/home/sample_data_types/package.json index dd42a0e0a193..e18945e544a5 100644 --- a/packages/home/sample_data_types/package.json +++ b/packages/home/sample_data_types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/home-sample-data-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/home/sample_data_types/tsconfig.json b/packages/home/sample_data_types/tsconfig.json index 2ff5d03a149c..493400e55a76 100644 --- a/packages/home/sample_data_types/tsconfig.json +++ b/packages/home/sample_data_types/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel deleted file mode 100644 index 87b2e9f57354..000000000000 --- a/packages/kbn-ace/BUILD.bazel +++ /dev/null @@ -1,131 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ace" -PKG_REQUIRE_NAME = "@kbn/ace" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "src/ace/modes/x_json/worker/x_json.ace.worker.js", - ], - exclude = [ - "src/ace/modes/x_json/worker/worker.d.ts", - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "@npm//brace", - "@npm//lodash", - "@npm//raw-loader", -] - -TYPES_DEPS = [ - "@npm//brace", - "@npm//@types/lodash", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - additional_args = [ - "--copy-files", - "--ignore", - "**/*/src/ace/modes/x_json/worker/x_json.ace.worker.js", - "--quiet" - ], - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - additional_args = [ - "--copy-files", - "--ignore", - "**/*/src/ace/modes/x_json/worker/x_json.ace.worker.js", - "--quiet" - ], - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ace/kibana.jsonc b/packages/kbn-ace/kibana.jsonc index 25da4fe177ee..8c5e29f19b54 100644 --- a/packages/kbn-ace/kibana.jsonc +++ b/packages/kbn-ace/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ace", - "owner": "@elastic/platform-deployment-management", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/platform-deployment-management" } diff --git a/packages/kbn-ace/package.json b/packages/kbn-ace/package.json index da9587a86cb1..71718766f4ca 100644 --- a/packages/kbn-ace/package.json +++ b/packages/kbn-ace/package.json @@ -2,8 +2,5 @@ "name": "@kbn/ace", "version": "1.0.0", "private": true, - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ace/tsconfig.json b/packages/kbn-ace/tsconfig.json index 1cf2f1e9ac9a..a545abd7d65a 100644 --- a/packages/kbn-ace/tsconfig.json +++ b/packages/kbn-ace/tsconfig.json @@ -1,15 +1,16 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "allowJs": false, - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": true, "types": ["node"] }, "include": [ "**/*.ts", "src/ace/modes/x_json/worker/x_json.ace.worker.js" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel deleted file mode 100644 index 74f684fc6d45..000000000000 --- a/packages/kbn-alerts/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-alerts" -PKG_REQUIRE_NAME = "@kbn/alerts" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx" - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "@npm//@elastic/eui", - "@npm//enzyme", - "@npm//react", -] - -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "@npm//@elastic/eui", - "@npm//tslib", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-alerts/kibana.jsonc b/packages/kbn-alerts/kibana.jsonc index 93b42c4ef86b..d801aa493acf 100644 --- a/packages/kbn-alerts/kibana.jsonc +++ b/packages/kbn-alerts/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/alerts", - "owner": "@elastic/security-solution", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution" } diff --git a/packages/kbn-alerts/package.json b/packages/kbn-alerts/package.json index cc4285cfc50a..3246bcfb5b3e 100644 --- a/packages/kbn-alerts/package.json +++ b/packages/kbn-alerts/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "Alerts components and hooks", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-alerts/tsconfig.json b/packages/kbn-alerts/tsconfig.json index fccc6563c0e7..91f7ce820b25 100644 --- a/packages/kbn-alerts/tsconfig.json +++ b/packages/kbn-alerts/tsconfig.json @@ -1,13 +1,17 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["jest", "node"] }, "include": [ "**/*.ts", "**/*.tsx" ], + "kbn_references": [ + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-ambient-common-types/BUILD.bazel b/packages/kbn-ambient-common-types/BUILD.bazel deleted file mode 100644 index 3a8b17248da2..000000000000 --- a/packages/kbn-ambient-common-types/BUILD.bazel +++ /dev/null @@ -1,58 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-ambient-common-types" -PKG_REQUIRE_NAME = "@kbn/ambient-common-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ambient-common-types/README.mdx b/packages/kbn-ambient-common-types/README.mdx index f08885537225..6bc1ab253e79 100644 --- a/packages/kbn-ambient-common-types/README.mdx +++ b/packages/kbn-ambient-common-types/README.mdx @@ -14,7 +14,4 @@ These types will automatically be included for plugins. ## Packages -To include these types in a package: - -- add `"//packages/kbn-ambient-ui-types:npm_module_types"` to the `TYPES_DEPS` portion of the `BUILD.bazel` file. -- add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file +To include these types in a package add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file diff --git a/packages/kbn-ambient-common-types/kibana.jsonc b/packages/kbn-ambient-common-types/kibana.jsonc index 70537777cc82..941cb38015f0 100644 --- a/packages/kbn-ambient-common-types/kibana.jsonc +++ b/packages/kbn-ambient-common-types/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ambient-common-types", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-ambient-common-types/package.json b/packages/kbn-ambient-common-types/package.json index 1794b046ef16..989705008e0c 100644 --- a/packages/kbn-ambient-common-types/package.json +++ b/packages/kbn-ambient-common-types/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ambient-common-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-ambient-common-types/tsconfig.json b/packages/kbn-ambient-common-types/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-ambient-common-types/tsconfig.json +++ b/packages/kbn-ambient-common-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ambient-ftr-types/BUILD.bazel b/packages/kbn-ambient-ftr-types/BUILD.bazel deleted file mode 100644 index f6de3cba29f6..000000000000 --- a/packages/kbn-ambient-ftr-types/BUILD.bazel +++ /dev/null @@ -1,58 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-ambient-ftr-types" -PKG_REQUIRE_NAME = "@kbn/ambient-ftr-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ambient-ftr-types/kibana.jsonc b/packages/kbn-ambient-ftr-types/kibana.jsonc index 5fa351e4d781..0464c850c166 100644 --- a/packages/kbn-ambient-ftr-types/kibana.jsonc +++ b/packages/kbn-ambient-ftr-types/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ambient-ftr-types", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-ambient-ftr-types/package.json b/packages/kbn-ambient-ftr-types/package.json index 7928b304529c..840c9c81d7bb 100644 --- a/packages/kbn-ambient-ftr-types/package.json +++ b/packages/kbn-ambient-ftr-types/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ambient-ftr-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-ambient-ftr-types/tsconfig.json b/packages/kbn-ambient-ftr-types/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-ambient-ftr-types/tsconfig.json +++ b/packages/kbn-ambient-ftr-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ambient-storybook-types/BUILD.bazel b/packages/kbn-ambient-storybook-types/BUILD.bazel deleted file mode 100644 index 1d4beea5fee4..000000000000 --- a/packages/kbn-ambient-storybook-types/BUILD.bazel +++ /dev/null @@ -1,64 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ambient-storybook-types" -PKG_REQUIRE_NAME = "@kbn/ambient-storybook-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - # Storybook react doesn't depend on these types even though their types use - # them, so we depend on them in this package and import them to make sure that they - # are available to users of the ambient types - "@npm//react-textarea-autosize", - "@npm//@storybook/react-docgen-typescript-plugin", -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ambient-storybook-types/README.mdx b/packages/kbn-ambient-storybook-types/README.mdx index f0db9b552d6e..8dcd0c9f04c7 100644 --- a/packages/kbn-ambient-storybook-types/README.mdx +++ b/packages/kbn-ambient-storybook-types/README.mdx @@ -11,8 +11,4 @@ This package holds ambient typescript definitions needed to use storybooks. ## Packages -To include these types in a package: - -- add `"//packages/kbn-ambient-storybook-types"` to the `RUNTIME_DEPS` portion of the `BUILD.bazel` file. -- add `"//packages/kbn-ambient-storybook-types:npm_module_types"` to the `TYPES_DEPS` portion of the `BUILD.bazel` file. -- add `"@kbn/ambient-storybook-types"` to the `types` portion of the `tsconfig.json` file. +To include these types in a package add `"@kbn/ambient-storybook-types"` to the `types` portion of the `tsconfig.json` file. diff --git a/packages/kbn-ambient-storybook-types/kibana.jsonc b/packages/kbn-ambient-storybook-types/kibana.jsonc index d04a5a93e296..c746094ae008 100644 --- a/packages/kbn-ambient-storybook-types/kibana.jsonc +++ b/packages/kbn-ambient-storybook-types/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ambient-storybook-types", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ambient-storybook-types/tsconfig.json b/packages/kbn-ambient-storybook-types/tsconfig.json index c0217a1c1a01..36ec9753b793 100644 --- a/packages/kbn-ambient-storybook-types/tsconfig.json +++ b/packages/kbn-ambient-storybook-types/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ambient-ui-types/BUILD.bazel b/packages/kbn-ambient-ui-types/BUILD.bazel deleted file mode 100644 index b6913eedc6d9..000000000000 --- a/packages/kbn-ambient-ui-types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ambient-ui-types" -PKG_REQUIRE_NAME = "@kbn/ambient-ui-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ambient-ui-types/README.mdx b/packages/kbn-ambient-ui-types/README.mdx index dbff6fb8e18a..818f20e48d05 100644 --- a/packages/kbn-ambient-ui-types/README.mdx +++ b/packages/kbn-ambient-ui-types/README.mdx @@ -14,8 +14,4 @@ These types will automatically be included for plugins. ## Packages -To include these types in a package: - -- add `"//packages/kbn-ambient-ui-types"` to the `RUNTIME_DEPS` portion of the `BUILD.bazel` file. -- add `"//packages/kbn-ambient-ui-types:npm_module_types"` to the `TYPES_DEPS` portion of the `BUILD.bazel` file. -- add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file +To include these types in a package add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file diff --git a/packages/kbn-ambient-ui-types/kibana.jsonc b/packages/kbn-ambient-ui-types/kibana.jsonc index 1837bcfbd561..940c59f8c3e2 100644 --- a/packages/kbn-ambient-ui-types/kibana.jsonc +++ b/packages/kbn-ambient-ui-types/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ambient-ui-types", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ambient-ui-types/tsconfig.json b/packages/kbn-ambient-ui-types/tsconfig.json index 6904725bb1b2..1b6c3402c64d 100644 --- a/packages/kbn-ambient-ui-types/tsconfig.json +++ b/packages/kbn-ambient-ui-types/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "@types/react", ] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index d1d6b6c90d1c..3d30665907d2 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-analytics" -PKG_REQUIRE_NAME = "@kbn/analytics" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", ], @@ -24,103 +19,16 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json" -] - -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "@npm//moment", "@npm//moment-timezone", "@npm//tslib", ] -TYPES_DEPS = [ - "@npm//moment", - "@npm//moment-timezone", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_config( - name = "tsconfig_browser", - src = "tsconfig.browser.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.browser.json", - "//:tsconfig.browser_bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-analytics", + package_name = "@kbn/analytics", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-analytics/kibana.jsonc b/packages/kbn-analytics/kibana.jsonc index 06320d851340..b10ca7bb960f 100644 --- a/packages/kbn-analytics/kibana.jsonc +++ b/packages/kbn-analytics/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/analytics", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index 57216d4e563d..128870ecff50 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -3,9 +3,6 @@ "private": true, "version": "1.0.0", "description": "Kibana Analytics tool", - "main": "target_node/index.js", - "browser": "target_web/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-analytics/tsconfig.json b/packages/kbn-analytics/tsconfig.json index c1b62ffb7d14..d2dc35192fa5 100644 --- a/packages/kbn-analytics/tsconfig.json +++ b/packages/kbn-analytics/tsconfig.json @@ -1,15 +1,16 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node" ] }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel deleted file mode 100644 index fd51d0719bac..000000000000 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-apm-config-loader" -PKG_REQUIRE_NAME = "@kbn/apm-config-loader" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-safer-lodash-set", - "//packages/kbn-utils", - "@npm//js-yaml", - "@npm//lodash", -] - -TYPES_DEPS = [ - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//@elastic/apm-rum", - "@npm//@types/jest", - "@npm//@types/js-yaml", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//elastic-apm-node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-apm-config-loader/kibana.jsonc b/packages/kbn-apm-config-loader/kibana.jsonc index 904a7eda0177..e9d06f353949 100644 --- a/packages/kbn-apm-config-loader/kibana.jsonc +++ b/packages/kbn-apm-config-loader/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/apm-config-loader", - "owner": ["@elastic/kibana-core", "@vigneshshanmugam"], - "runtimeDeps": [], - "typeDeps": [] + "owner": ["@elastic/kibana-core", "@vigneshshanmugam"] } diff --git a/packages/kbn-apm-config-loader/package.json b/packages/kbn-apm-config-loader/package.json index 30d7f3780f83..c4645cdf148f 100644 --- a/packages/kbn-apm-config-loader/package.json +++ b/packages/kbn-apm-config-loader/package.json @@ -1,8 +1,6 @@ { "name": "@kbn/apm-config-loader", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-apm-config-loader/tsconfig.json b/packages/kbn-apm-config-loader/tsconfig.json index 57c1dd1c94e0..09575e5e2b74 100644 --- a/packages/kbn-apm-config-loader/tsconfig.json +++ b/packages/kbn-apm-config-loader/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/safer-lodash-set", + "@kbn/utils", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-apm-synthtrace/BUILD.bazel b/packages/kbn-apm-synthtrace/BUILD.bazel deleted file mode 100644 index 2e7b4ac1f456..000000000000 --- a/packages/kbn-apm-synthtrace/BUILD.bazel +++ /dev/null @@ -1,127 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-apm-synthtrace" -PKG_REQUIRE_NAME = "@kbn/apm-synthtrace" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/.eslintrc.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-datemath", - "@npm//@elastic/elasticsearch", - "@npm//lodash", - "@npm//moment", - "@npm//object-hash", - "@npm//p-limit", - "@npm//yargs", - "@npm//node-fetch", - "@npm//semver", - "@npm//elastic-apm-http-client", -] - -TYPES_DEPS = [ - "//packages/kbn-datemath:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/object-hash", - "@npm//moment", - "@npm//p-limit", - "@npm//@types/node-fetch", - "@npm//@types/semver", - "@npm//@types/yargs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", - validate = False, -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-apm-synthtrace/kibana.jsonc b/packages/kbn-apm-synthtrace/kibana.jsonc index 0bde4f9d7715..1ae0bbcbaa7a 100644 --- a/packages/kbn-apm-synthtrace/kibana.jsonc +++ b/packages/kbn-apm-synthtrace/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/apm-synthtrace", "devOnly": true, - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-apm-synthtrace/package.json b/packages/kbn-apm-synthtrace/package.json index 935eb518639d..827e251d8a13 100644 --- a/packages/kbn-apm-synthtrace/package.json +++ b/packages/kbn-apm-synthtrace/package.json @@ -6,7 +6,5 @@ "bin": { "synthtrace": "./bin/synthtrace" }, - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-apm-synthtrace/tsconfig.json b/packages/kbn-apm-synthtrace/tsconfig.json index cc3e7412412d..6c61405223cd 100644 --- a/packages/kbn-apm-synthtrace/tsconfig.json +++ b/packages/kbn-apm-synthtrace/tsconfig.json @@ -1,10 +1,14 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["node", "jest"] }, - "include": ["**/*.ts"] + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/datemath" + ], + "exclude": [ + "target/**/*", + ] } diff --git a/packages/kbn-apm-utils/BUILD.bazel b/packages/kbn-apm-utils/BUILD.bazel deleted file mode 100644 index 5f685b859613..000000000000 --- a/packages/kbn-apm-utils/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-apm-utils" -PKG_REQUIRE_NAME = "@kbn/apm-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//elastic-apm-node", -] - -TYPES_DEPS = [ - "@npm//elastic-apm-node", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-apm-utils/kibana.jsonc b/packages/kbn-apm-utils/kibana.jsonc index 3db7022ea44c..950a5dacb9ba 100644 --- a/packages/kbn-apm-utils/kibana.jsonc +++ b/packages/kbn-apm-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/apm-utils", - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-apm-utils/package.json b/packages/kbn-apm-utils/package.json index 7e31210e1d19..46979a22a947 100644 --- a/packages/kbn-apm-utils/package.json +++ b/packages/kbn-apm-utils/package.json @@ -1,8 +1,6 @@ { "name": "@kbn/apm-utils", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-apm-utils/tsconfig.json b/packages/kbn-apm-utils/tsconfig.json index b4316f3d2faa..2649fb45f0a4 100644 --- a/packages/kbn-apm-utils/tsconfig.json +++ b/packages/kbn-apm-utils/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node" ] }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-axe-config/BUILD.bazel b/packages/kbn-axe-config/BUILD.bazel deleted file mode 100644 index b565aea2e8c0..000000000000 --- a/packages/kbn-axe-config/BUILD.bazel +++ /dev/null @@ -1,130 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-axe-config" -PKG_REQUIRE_NAME = "@kbn/axe-config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//axe-core", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-axe-config/kibana.jsonc b/packages/kbn-axe-config/kibana.jsonc index f2444755f909..09252ba807fa 100644 --- a/packages/kbn-axe-config/kibana.jsonc +++ b/packages/kbn-axe-config/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/axe-config", "devOnly": true, - "owner": "@elastic/kibana-qa", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-qa" } diff --git a/packages/kbn-axe-config/package.json b/packages/kbn-axe-config/package.json index 77c6d2b4c31c..54f699538acb 100644 --- a/packages/kbn-axe-config/package.json +++ b/packages/kbn-axe-config/package.json @@ -2,8 +2,5 @@ "name": "@kbn/axe-config", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-axe-config/tsconfig.json b/packages/kbn-axe-config/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-axe-config/tsconfig.json +++ b/packages/kbn-axe-config/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-babel-plugin-package-imports/BUILD.bazel b/packages/kbn-babel-plugin-package-imports/BUILD.bazel new file mode 100644 index 000000000000..87b5126abb74 --- /dev/null +++ b/packages/kbn-babel-plugin-package-imports/BUILD.bazel @@ -0,0 +1,31 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = [ + "babel_plugin_package_imports.js", + "index.js", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +BUNDLER_DEPS = [ + "@npm//@babel/helper-plugin-utils", + "@npm//normalize-path", + "//packages/kbn-repo-info", + "//packages/kbn-package-map", +] + +js_library( + name = "kbn-babel-plugin-package-imports", + package_name = "@kbn/babel-plugin-package-imports", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-babel-plugin-package-imports/README.mdx b/packages/kbn-babel-plugin-package-imports/README.mdx new file mode 100644 index 000000000000..1f36b2266b4a --- /dev/null +++ b/packages/kbn-babel-plugin-package-imports/README.mdx @@ -0,0 +1,11 @@ +--- +id: kibDevDocsOpsBabelPluginPackageImports +slug: /kibana-dev-docs/ops/babel-plugin-package-imports +title: "@kbn/babel-plugin-package-imports" +description: A babel plugin that transforms our @kbn/{NAME} imports into paths +date: 2022-05-19 +tags: ['kibana', 'dev', 'contributor', 'operations', 'babel', 'plugin', 'packages', 'imports'] +--- + +When developing inside the Kibana repository importing a package from any other package is just easy as +importing `@kbn/{package-name}`. However not every package is a node_module yet and while that is something we are working on to accomplish we need a way to dealing with it for now. Using this babel plugin is our transitory solution. It allows us to import from module ids and then transform it automatically back into paths on the transpiled code without friction for our engineering teams. \ No newline at end of file diff --git a/packages/kbn-babel-plugin-synthetic-packages/babel_plugin_synthetic_packages.js b/packages/kbn-babel-plugin-package-imports/babel_plugin_package_imports.js similarity index 55% rename from packages/kbn-babel-plugin-synthetic-packages/babel_plugin_synthetic_packages.js rename to packages/kbn-babel-plugin-package-imports/babel_plugin_package_imports.js index 8caa3906c8fe..3f3b155ff7ab 100644 --- a/packages/kbn-babel-plugin-synthetic-packages/babel_plugin_synthetic_packages.js +++ b/packages/kbn-babel-plugin-package-imports/babel_plugin_package_imports.js @@ -6,84 +6,79 @@ * Side Public License, v 1. */ -/** @typedef {import('@babel/core').PluginObj} PluginObj */ - const Path = require('path'); -const Fs = require('fs'); const T = require('@babel/types'); const normalizePath = require('normalize-path'); const { declare } = require('@babel/helper-plugin-utils'); -const KbnSyntheticPackageMap = require('@kbn/synthetic-package-map'); +const KbnSyntheticPackageMap = require('@kbn/package-map'); +const { REPO_ROOT } = require('@kbn/repo-info'); const PKG_MAP = KbnSyntheticPackageMap.readPackageMap(); -const PKG_MAP_HASH = KbnSyntheticPackageMap.readHashOfPackageMap(); +/** + * @param {unknown} v + * @returns {v is Record} + */ +const isObj = (v) => typeof v === 'object' && !!v; + +/** + * @param {unknown} state + * @returns {string} + */ function getFilename(state) { - if (typeof state !== 'object' || !state || !state.filename || !Path.isAbsolute(state.filename)) { + if (!isObj(state) || typeof state.filename !== 'string' || !Path.isAbsolute(state.filename)) { throw new Error( - `@kbn/babel-plugin-synthetic-packages is only compatible when building files with absolute filename state` + `@kbn/babel-plugin-package-imports is only compatible when building files with absolute filename state` ); } return state.filename; } -let foundKibanaRoot; -function getKibanaRoot(someSourceFilename) { - if (foundKibanaRoot) { - return foundKibanaRoot; - } - - // try to find the Kibana package.json file in a parent directory of the sourceFile - let cursorDir = Path.dirname(someSourceFilename); - while (true) { - const packageJsonPath = Path.resolve(cursorDir, 'package.json'); - try { - const pkg = JSON.parse(Fs.readFileSync(packageJsonPath, 'utf8')); - if (pkg && pkg.name === 'kibana') { - foundKibanaRoot = cursorDir; - return foundKibanaRoot; - } - } catch { - // this directory is not the Kibana dir - } - - const nextCursor = Path.dirname(cursorDir); - if (!nextCursor || nextCursor === cursorDir) { - // stop iterating when we get to the root of the root of the filesystem - break; - } - - cursorDir = nextCursor; - } - - throw new Error( - '@kbn/*-plugin and @kbn/core imports can only be used by source files which have not been converted to packages, building packages which rely on these imports requires converting the thing you want into a package.' - ); -} - -function fixImportRequest(req, filename, kibanaRoot) { +/** + * @param {string} req + * @returns {import('./types').ParsedReq | undefined} + */ +function parseReq(req) { if (!req.startsWith('@kbn/')) { return; } const parts = req.split('/'); - const dir = PKG_MAP.get(`@kbn/${parts[1]}`); + const moduleId = `@kbn/${parts[1]}`; + const dir = PKG_MAP.get(moduleId); if (!dir) { return; } - return normalizePath( - Path.relative( - Path.dirname(filename), - Path.resolve(kibanaRoot ?? getKibanaRoot(filename), dir, ...parts.slice(2)) - ) + return { + req, + moduleId, + dir, + subParts: parts.slice(2), + }; +} + +/** + * @param {import('./types').ParsedReq} req + * @param {string} filename + */ +function fixImportRequest(req, filename) { + if (process.env.BAZEL_WORKSPACE === 'kibana') { + return; + } + + const rel = normalizePath( + Path.relative(Path.dirname(filename), Path.resolve(REPO_ROOT, req.dir, ...req.subParts)) ); + + return rel.startsWith('.') ? rel : `./${rel}`; } /** * @param {T.CallExpression} node + * @returns {node is T.Import & { arguments: [T.StringLiteral] }} */ function isDynamicImport(node) { return !!( @@ -95,6 +90,7 @@ function isDynamicImport(node) { /** * @param {T.CallExpression} node + * @returns {node is T.CallExpression & { arguments: [T.StringLiteral] }} */ function isRequire(node) { return !!( @@ -107,6 +103,7 @@ function isRequire(node) { /** * @param {T.CallExpression} node + * @returns {node is T.CallExpression & { arguments: [T.StringLiteral] }} */ function isRequireResolve(node) { return !!( @@ -122,6 +119,7 @@ function isRequireResolve(node) { /** * @param {T.CallExpression} node + * @returns {node is T.CallExpression & { arguments: [T.StringLiteral] }} */ function isJestMockCall(node) { return !!( @@ -134,15 +132,17 @@ function isJestMockCall(node) { } module.exports = declare((api, options) => { - const kibanaRoot = options['kibana/rootDir']; + /** @type {Set | undefined} */ + const ignoredPkgIds = options.ignoredPkgIds; api.assertVersion(7); - api.cache.using(() => `${PKG_MAP_HASH}:${kibanaRoot}`); - /** @type {PluginObj} */ - const plugin = { - name: 'synthetic-packages', + return { + name: 'kbn-package-imports', visitor: { + /** + * @param {import('@babel/core').NodePath} path + */ 'ImportDeclaration|ExportNamedDeclaration|ExportAllDeclaration'(path) { const filename = getFilename(this); @@ -152,11 +152,20 @@ module.exports = declare((api, options) => { } const req = source.value; - const newReq = fixImportRequest(req, filename, kibanaRoot); + const parsed = parseReq(req); + if (!parsed || ignoredPkgIds?.has(parsed.moduleId)) { + return; + } + + const newReq = fixImportRequest(parsed, filename); if (newReq) { path.get('source').replaceWith(T.stringLiteral(newReq)); } }, + + /** + * @param {import('@babel/core').NodePath} path + */ CallExpression(path) { const filename = getFilename(this); @@ -171,13 +180,16 @@ module.exports = declare((api, options) => { } const req = node.arguments[0].value; - const newReq = fixImportRequest(req, filename, kibanaRoot); + const parsed = parseReq(req); + if (!parsed || ignoredPkgIds?.has(parsed.moduleId)) { + return; + } + + const newReq = fixImportRequest(parsed, filename); if (newReq) { - path.get('arguments.0').replaceWith(T.stringLiteral(newReq)); + path.get('arguments')[0].replaceWith(T.stringLiteral(newReq)); } }, }, }; - - return plugin; }); diff --git a/packages/kbn-optimizer/src/node/index.ts b/packages/kbn-babel-plugin-package-imports/index.js similarity index 85% rename from packages/kbn-optimizer/src/node/index.ts rename to packages/kbn-babel-plugin-package-imports/index.js index a6c019425bf2..ce314829e93c 100644 --- a/packages/kbn-optimizer/src/node/index.ts +++ b/packages/kbn-babel-plugin-package-imports/index.js @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export * from './node_auto_tranpilation'; +module.exports = require('./babel_plugin_package_imports'); diff --git a/packages/kbn-babel-plugin-package-imports/kibana.jsonc b/packages/kbn-babel-plugin-package-imports/kibana.jsonc new file mode 100644 index 000000000000..c555d9f00877 --- /dev/null +++ b/packages/kbn-babel-plugin-package-imports/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/babel-plugin-package-imports", + "devOnly": true, + "owner": "@elastic/kibana-operations" +} diff --git a/packages/kbn-babel-plugin-package-imports/package.json b/packages/kbn-babel-plugin-package-imports/package.json new file mode 100644 index 000000000000..1d7206c6b100 --- /dev/null +++ b/packages/kbn-babel-plugin-package-imports/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/babel-plugin-package-imports", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-babel-plugin-package-imports/tsconfig.json b/packages/kbn-babel-plugin-package-imports/tsconfig.json new file mode 100644 index 000000000000..cdf3aa866fce --- /dev/null +++ b/packages/kbn-babel-plugin-package-imports/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "checkJs": true, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.js", + "**/*.ts", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/repo-info", + "@kbn/package-map" + ] +} diff --git a/kbn_pm/src/commands/projects.js b/packages/kbn-babel-plugin-package-imports/types.ts similarity index 77% rename from kbn_pm/src/commands/projects.js rename to packages/kbn-babel-plugin-package-imports/types.ts index 8ebd3be073d0..c556aa9b0733 100644 --- a/kbn_pm/src/commands/projects.js +++ b/packages/kbn-babel-plugin-package-imports/types.ts @@ -6,5 +6,9 @@ * Side Public License, v 1. */ -const { PROJECTS } = require('../../../src/dev/typescript/projects'); -module.exports = { PROJECTS }; +export interface ParsedReq { + req: string; + moduleId: string; + dir: string; + subParts: string[]; +} diff --git a/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel b/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel deleted file mode 100644 index a1e6891f23ec..000000000000 --- a/packages/kbn-babel-plugin-synthetic-packages/BUILD.bazel +++ /dev/null @@ -1,62 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-babel-plugin-synthetic-packages" -PKG_REQUIRE_NAME = "@kbn/babel-plugin-synthetic-packages" - -filegroup( - name = "srcs", - srcs = [ - "babel_plugin_synthetic_packages.js" - ], -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@babel/helper-plugin-utils", - "@npm//normalize-path", - "//packages/kbn-synthetic-package-map", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-babel-plugin-synthetic-packages/README.mdx b/packages/kbn-babel-plugin-synthetic-packages/README.mdx deleted file mode 100644 index 6f11e9cf2d6b..000000000000 --- a/packages/kbn-babel-plugin-synthetic-packages/README.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: kibDevDocsOpsBabelPluginSyntheticPackages -slug: /kibana-dev-docs/ops/babel-plugin-synthetic-packages -title: "@kbn/babel-plugin-synthetic-packages" -description: A babel plugin that transforms our @kbn/{NAME} imports into paths -date: 2022-05-19 -tags: ['kibana', 'dev', 'contributor', 'operations', 'babel', 'plugin', 'synthetic', 'packages'] ---- - -When developing inside the Kibana repository importing a package from any other package is just easy as importing `@kbn/{package-name}`. -However not every package is a node_module yet and while that is something we are working on to accomplish we need a way to dealing with it for -now. Using this babel plugin is our transitory solution. It allows us to import from module ids and then transform it automatically back into -paths on the transpiled code without friction for our engineering teams. \ No newline at end of file diff --git a/packages/kbn-babel-plugin-synthetic-packages/kibana.jsonc b/packages/kbn-babel-plugin-synthetic-packages/kibana.jsonc deleted file mode 100644 index a426d7bec6a2..000000000000 --- a/packages/kbn-babel-plugin-synthetic-packages/kibana.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/babel-plugin-synthetic-packages", - "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] -} diff --git a/packages/kbn-babel-plugin-synthetic-packages/package.json b/packages/kbn-babel-plugin-synthetic-packages/package.json deleted file mode 100644 index 89de157a1172..000000000000 --- a/packages/kbn-babel-plugin-synthetic-packages/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/babel-plugin-synthetic-packages", - "private": true, - "version": "1.0.0", - "main": "./babel_plugin_synthetic_packages.js", - "license": "SSPL-1.0 OR Elastic License 2.0" -} diff --git a/packages/kbn-babel-preset/BUILD.bazel b/packages/kbn-babel-preset/BUILD.bazel index 7b4090ceac48..73313161f6ac 100644 --- a/packages/kbn-babel-preset/BUILD.bazel +++ b/packages/kbn-babel-preset/BUILD.bazel @@ -39,7 +39,7 @@ RUNTIME_DEPS = [ "@npm//babel-plugin-add-module-exports", "@npm//babel-plugin-styled-components", "@npm//babel-plugin-transform-react-remove-prop-types", - "//packages/kbn-babel-plugin-synthetic-packages", + "//packages/kbn-babel-plugin-package-imports", ] js_library( @@ -51,16 +51,3 @@ js_library( package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-babel-preset/common_babel_parser_options.js b/packages/kbn-babel-preset/common_babel_parser_options.js index aea9b94fd418..576050b9d886 100644 --- a/packages/kbn-babel-preset/common_babel_parser_options.js +++ b/packages/kbn-babel-preset/common_babel_parser_options.js @@ -8,6 +8,7 @@ // The @babel/parser options documentation can be found here: // https://babeljs.io/docs/en/babel-parser#options +/** @type {import('@babel/core').ParserOptions} */ module.exports = { sourceType: 'unambiguous', plugins: [ diff --git a/packages/kbn-babel-preset/common_preset.js b/packages/kbn-babel-preset/common_preset.js index 1c3e2135d104..cfb8bf495c6a 100644 --- a/packages/kbn-babel-preset/common_preset.js +++ b/packages/kbn-babel-preset/common_preset.js @@ -47,7 +47,18 @@ module.exports = (_, options = {}) => ({ }, ], - [require.resolve('@kbn/babel-plugin-synthetic-packages'), options], + ...(options['kibana/ignoreAllPkgImports'] + ? [] + : [ + [ + require.resolve('@kbn/babel-plugin-package-imports'), + { + ignoredPkgIds: options['kibana/ignoredPkgIds'] + ? new Set(options['kibana/ignoredPkgIds']) + : undefined, + }, + ], + ]), ], }, diff --git a/packages/kbn-babel-preset/kibana.jsonc b/packages/kbn-babel-preset/kibana.jsonc index fa4ca725c56d..f63a0c554e7e 100644 --- a/packages/kbn-babel-preset/kibana.jsonc +++ b/packages/kbn-babel-preset/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/babel-preset", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-babel-preset/tsconfig.json b/packages/kbn-babel-preset/tsconfig.json new file mode 100644 index 000000000000..0792a42605d4 --- /dev/null +++ b/packages/kbn-babel-preset/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.js" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-babel-preset/webpack_preset.js b/packages/kbn-babel-preset/webpack_preset.js index 75ceab91d8af..7d8f092384b4 100644 --- a/packages/kbn-babel-preset/webpack_preset.js +++ b/packages/kbn-babel-preset/webpack_preset.js @@ -8,7 +8,8 @@ const { USES_STYLED_COMPONENTS } = require('./styled_components_files'); -module.exports = (_, options = {}) => { +/** @type {import('@babel/core').ConfigFunction} */ +module.exports = (api, options = {}) => { return { presets: [ [ @@ -20,6 +21,7 @@ module.exports = (_, options = {}) => { // in node_preset.js corejs: '3.26.1', bugfixes: true, + browserslistEnv: api.env('production') ? 'production' : 'dev', }, ], [require('./common_preset'), options], diff --git a/packages/kbn-babel-register/BUILD.bazel b/packages/kbn-babel-register/BUILD.bazel new file mode 100644 index 000000000000..962f000fb4fa --- /dev/null +++ b/packages/kbn-babel-register/BUILD.bazel @@ -0,0 +1,50 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.js", + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +BUNDLER_DEPS = [ + "@npm//@babel/core", + "@npm//chalk", + "@npm//pirates", + "@npm//lmdb", + "@npm//source-map-support", + "//packages/kbn-package-map", + "//packages/kbn-repo-info", + "//packages/kbn-babel-transform", +] + +js_library( + name = "kbn-babel-register", + package_name = "@kbn/babel-register", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-babel-register/README.md b/packages/kbn-babel-register/README.md new file mode 100644 index 000000000000..5c11943e3181 --- /dev/null +++ b/packages/kbn-babel-register/README.md @@ -0,0 +1,3 @@ +# @kbn/babel-register + +Empty package generated by @kbn/generate diff --git a/packages/kbn-babel-register/cache/index.js b/packages/kbn-babel-register/cache/index.js new file mode 100644 index 000000000000..78d17cf3e059 --- /dev/null +++ b/packages/kbn-babel-register/cache/index.js @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const Fs = require('fs'); +const Path = require('path'); +const Crypto = require('crypto'); + +const { readHashOfPackageMap } = require('@kbn/package-map'); +const babel = require('@babel/core'); +const peggy = require('@kbn/peggy'); +const { REPO_ROOT, UPSTREAM_BRANCH } = require('@kbn/repo-info'); +const { getBabelOptions } = require('@kbn/babel-transform'); + +/** + * @babel/register uses a JSON encoded copy of the config + babel.version + * as the cache key for files, so we do something similar but we don't need + * a unique cache key for every file as our config isn't different for + * different files (by design). Instead we determine a unique prefix and + * automatically prepend all paths with the prefix to create cache keys + */ +function determineCachePrefix() { + const json = JSON.stringify({ + synthPkgMapHash: readHashOfPackageMap(), + babelVersion: babel.version, + peggyVersion: peggy.version, + // get a config for a fake js, ts, and tsx file to make sure we + // capture conditional config portions based on the file extension + js: babel.loadOptions(getBabelOptions(Path.resolve('foo.js'))), + ts: babel.loadOptions(getBabelOptions(Path.resolve('foo.ts'))), + tsx: babel.loadOptions(getBabelOptions(Path.resolve('foo.tsx'))), + }); + + return Crypto.createHash('sha256').update(json).digest('hex').slice(0, 10); +} + +function lmdbAvailable() { + try { + require('lmdb'); + return true; + } catch (error) { + return false; + } +} + +/** + * @returns {import('./types').Cache} + */ +function getCache() { + const log = process.env.DEBUG_BABEL_REGISTER_CACHE + ? Fs.createWriteStream('babel_register_cache.log', { flags: 'a' }) + : undefined; + + if (process.env.DISABLE_BABEL_REGISTER_CACHE) { + log?.end('lmdb cache is disabled\n'); + return new (require('./no_cache_cache').NoCacheCache)(); + } + + if (lmdbAvailable()) { + log?.write('lmdb is available, using lmdb cache\n'); + return new (require('./lmdb_cache').LmdbCache)({ + pathRoot: REPO_ROOT, + dir: Path.resolve(REPO_ROOT, 'data/babel_register_cache_v1', UPSTREAM_BRANCH), + prefix: determineCachePrefix(), + log, + }); + } + + log?.end('lmdb is unavailable, disabling cache\n'); + console.error('unable to load LMDB in this env, disabling babel/register cache'); + return new (require('./no_cache_cache').NoCacheCache)(); +} + +module.exports = { + getCache, +}; diff --git a/packages/kbn-babel-register/cache/lmdb_cache.js b/packages/kbn-babel-register/cache/lmdb_cache.js new file mode 100644 index 000000000000..1c69ba1ed12a --- /dev/null +++ b/packages/kbn-babel-register/cache/lmdb_cache.js @@ -0,0 +1,280 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const Path = require('path'); + +const chalk = require('chalk'); +const LmdbStore = require('lmdb'); + +const GLOBAL_ATIME = `${Date.now()}`; +const MINUTE = 1000 * 60; +const HOUR = MINUTE * 60; +const DAY = HOUR * 24; + +/** @typedef {import('./types').Cache} CacheInterface */ +/** @typedef {import('lmdb').Database} Db */ + +/** + * @param {Db} db + * @returns {string} + */ +const dbName = (db) => + // @ts-expect-error db.name is not a documented/typed property + db.name; + +/** + * @implements {CacheInterface} + */ +class LmdbCache { + /** @type {import('lmdb').RootDatabase} */ + #codes; + /** @type {Db} */ + #atimes; + /** @type {Db} */ + #mtimes; + /** @type {Db} */ + #sourceMaps; + /** @type {string} */ + #pathRoot; + /** @type {string} */ + #prefix; + /** @type {import('stream').Writable | undefined} */ + #log; + /** @type {ReturnType} */ + #timer; + + /** + * @param {import('./types').CacheConfig} config + */ + constructor(config) { + if (!Path.isAbsolute(config.pathRoot)) { + throw new Error('cache requires an absolute path to resolve paths relative to'); + } + + this.#pathRoot = config.pathRoot; + this.#prefix = config.prefix; + this.#log = config.log; + + this.#codes = LmdbStore.open(config.dir, { + name: 'codes', + encoding: 'string', + maxReaders: 500, + }); + + // TODO: redundant 'name' syntax is necessary because of a bug that I have yet to fix + this.#atimes = this.#codes.openDB('atimes', { + name: 'atimes', + encoding: 'string', + }); + + this.#mtimes = this.#codes.openDB('mtimes', { + name: 'mtimes', + encoding: 'string', + }); + + this.#sourceMaps = this.#codes.openDB('sourceMaps', { + name: 'sourceMaps', + encoding: 'string', + }); + + // after the process has been running for 30 minutes prune the + // keys which haven't been used in 30 days. We use `unref()` to + // make sure this timer doesn't hold other processes open + // unexpectedly + this.#timer = setTimeout(() => { + this.#pruneOldKeys().catch((error) => { + process.stderr.write(` +Failed to cleanup @kbn/babel-register cache: + + ${error.stack.split('\n').join('\n ')} + +To eliminate this problem you may want to delete the "${Path.relative(process.cwd(), config.dir)}" +directory and report this error to the Operations team.\n`); + }); + }, 30 * MINUTE); + + // timer.unref is not defined in jest which emulates the dom by default + if (typeof this.#timer.unref === 'function') { + this.#timer.unref(); + } + } + + /** + * @param {string} path + */ + getMtime(path) { + return this.#safeGet(this.#mtimes, this.#getKey(path)); + } + + /** + * @param {string} path + */ + getCode(path) { + const key = this.#getKey(path); + const code = this.#safeGet(this.#codes, key); + + if (code !== undefined) { + // when we use a file from the cache set the "atime" of that cache entry + // so that we know which cache items we use and which haven't been + // touched in a long time (currently 30 days) + this.#safePut(this.#atimes, key, GLOBAL_ATIME); + } + + return code; + } + + /** + * @param {string} path + */ + getSourceMap(path) { + const map = this.#safeGet(this.#sourceMaps, this.#getKey(path)); + if (typeof map === 'string') { + return JSON.parse(map); + } + } + + close() { + clearTimeout(this.#timer); + } + + /** + * @param {string} path + * @param {{ mtime: string; code: string; map?: any }} file + */ + async update(path, file) { + const key = this.#getKey(path); + + this.#safePut(this.#atimes, key, GLOBAL_ATIME); + this.#safePut(this.#mtimes, key, file.mtime); + this.#safePut(this.#codes, key, file.code); + + if (file.map) { + this.#safePut(this.#sourceMaps, key, JSON.stringify(file.map)); + } + } + + /** + * @param {string} path + */ + #getKey(path) { + const normalizedPath = + Path.sep !== '/' + ? Path.relative(this.#pathRoot, path).split(Path.sep).join('/') + : Path.relative(this.#pathRoot, path); + + return `${this.#prefix}:${normalizedPath}`; + } + + /** + * @param {LmdbStore.Database} db + * @param {string} key + */ + #safeGet(db, key) { + try { + const value = db.get(key); + this.#debug(value === undefined ? 'MISS' : 'HIT', db, key); + return value; + } catch (error) { + if (error.message.includes('No transaction to renew')) { + // this happens on errors very early in the process + return undefined; + } + + this.#logError('GET', db, key, error); + } + } + + /** + * @param {LmdbStore.Database} db + * @param {string} key + * @param {string} value + */ + #safePut(db, key, value) { + try { + db.putSync(key, value); + this.#debug('PUT', db, key); + } catch (error) { + this.#logError('PUT', db, key, error); + } + } + + /** + * @param {string} type + * @param {LmdbStore.Database} db + * @param {string} key + */ + #debug(type, db, key) { + this.#log?.write(`${type} [${dbName(db)}] ${String(key)}\n`); + } + + /** + * @param {'GET' | 'PUT'} type + * @param {LmdbStore.Database} db + * @param {string} key + * @param {Error} error + */ + #logError(type, db, key, error) { + this.#debug(`ERROR/${type}`, db, `${String(key)}: ${error.stack}`); + process.stderr.write( + chalk.red( + `[@kbn/optimizer/node] ${type} error [${dbName(db)}/${String(key)}]: ${error.stack}\n` + ) + ); + } + + async #pruneOldKeys() { + try { + const ATIME_LIMIT = Date.now() - 30 * DAY; + const BATCH_SIZE = 1000; + + /** @type {string[]} */ + const validKeys = []; + /** @type {string[]} */ + const invalidKeys = []; + + for (const { key, value } of this.#atimes.getRange()) { + const atime = parseInt(`${value}`, 10); + if (Number.isNaN(atime) || atime < ATIME_LIMIT) { + invalidKeys.push(key); + } else { + validKeys.push(key); + } + + if (validKeys.length + invalidKeys.length >= BATCH_SIZE) { + const promises = new Set(); + + if (invalidKeys.length) { + for (const k of invalidKeys) { + // all these promises are the same currently, so Set() will + // optimise this to a single promise, but I wouldn't be shocked + // if a future version starts returning independent promises so + // this is just for some future-proofing + promises.add(this.#atimes.remove(k)); + promises.add(this.#mtimes.remove(k)); + promises.add(this.#codes.remove(k)); + promises.add(this.#sourceMaps.remove(k)); + } + } else { + // delay a smidge to allow other things to happen before the next batch of checks + promises.add(new Promise((resolve) => setTimeout(resolve, 1))); + } + + invalidKeys.length = 0; + validKeys.length = 0; + await Promise.all(Array.from(promises)); + } + } + } catch { + // ignore errors, the cache is totally disposable and will rebuild if there is some sort of corruption + } + } +} + +module.exports = { + LmdbCache, +}; diff --git a/packages/kbn-optimizer/src/node/integration_tests/cache.test.ts b/packages/kbn-babel-register/cache/lmdb_cache.test.ts similarity index 91% rename from packages/kbn-optimizer/src/node/integration_tests/cache.test.ts rename to packages/kbn-babel-register/cache/lmdb_cache.test.ts index 55a4a500359e..d752e45879ae 100644 --- a/packages/kbn-optimizer/src/node/integration_tests/cache.test.ts +++ b/packages/kbn-babel-register/cache/lmdb_cache.test.ts @@ -11,7 +11,7 @@ import { Writable } from 'stream'; import del from 'del'; -import { Cache } from '../cache'; +import { LmdbCache } from './lmdb_cache'; const DIR = Path.resolve(__dirname, '../__tmp__/cache'); @@ -31,9 +31,9 @@ const makeTestLog = () => { return log; }; -const instances: Cache[] = []; -const makeCache = (...options: ConstructorParameters) => { - const instance = new Cache(...options); +const instances: LmdbCache[] = []; +const makeCache = (...options: ConstructorParameters) => { + const instance = new LmdbCache(...options); instances.push(instance); return instance; }; diff --git a/packages/kbn-babel-register/cache/no_cache_cache.js b/packages/kbn-babel-register/cache/no_cache_cache.js new file mode 100644 index 000000000000..b4608e866d3b --- /dev/null +++ b/packages/kbn-babel-register/cache/no_cache_cache.js @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/** @typedef {import('./types').Cache} CacheInterface */ + +/** + * @implements {CacheInterface} + */ +class NoCacheCache { + getCode() { + return undefined; + } + + getMtime() { + return undefined; + } + + getSourceMap() { + return undefined; + } + + async update() { + return undefined; + } + + close() {} +} + +module.exports = { + NoCacheCache, +}; diff --git a/packages/kbn-babel-register/cache/types.ts b/packages/kbn-babel-register/cache/types.ts new file mode 100644 index 000000000000..6438662ae2d6 --- /dev/null +++ b/packages/kbn-babel-register/cache/types.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Writable } from 'stream'; + +export interface CacheConfig { + pathRoot: string; + dir: string; + prefix: string; + log?: Writable; +} + +export interface Cache { + getMtime(path: string): string | undefined; + getCode(path: string): string | undefined; + getSourceMap(path: string): object | undefined; + update(path: string, opts: { mtime: string; code: string; map?: any }): Promise; + close(): void; +} diff --git a/packages/kbn-babel-register/index.js b/packages/kbn-babel-register/index.js new file mode 100644 index 000000000000..ba20e1f1b18f --- /dev/null +++ b/packages/kbn-babel-register/index.js @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +/* eslint-disable @kbn/eslint/require-license-header */ + +/** + * This module is based on @babel/register @ 9808d25, modified to use + * a more efficient caching implementation which writes to disk as + * the cache is built rather than keeping the whole cache in memory + * and then dumping it to disk when the process exits. + */ + +/** + * @notice + * MIT License + * + * Copyright (c) 2014-present Sebastian McKenzie and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +const Path = require('path'); + +const { addHook } = require('pirates'); +const sourceMapSupport = require('source-map-support'); + +const { getCache } = require('./cache'); + +const { TRANSFORMS } = require('./transforms'); + +/** @typedef {RegExp | string} Matcher */ + +/** @type {Matcher[]} */ +const IGNORE_PATTERNS = [ + // ignore paths matching `/node_modules/{a}`, unless `a` is "@kbn" + /[\/\\]node_modules[\/\\](?!@kbn)([^\/\\]+)[\/\\]/, + + // ignore packages with "babel" in their names + /[\/\\]packages[\/\\]([^\/\\]+-)?babel(-[^\/\\]+)?[\/\\]/, + + // ignore paths matching `/canvas/canvas_plugin/` + /[\/\\]canvas[\/\\]canvas_plugin[\/\\]/, +]; + +/** + * + * @param {string} path + * @param {Matcher[] | undefined} matchers + */ +function match(path, matchers) { + if (!matchers) { + return false; + } + + return matchers.some((m) => { + if (typeof m === 'string') { + if (m.endsWith('/')) { + return path.startsWith(m); + } + + return path === m || path.startsWith(m + Path.sep); + } + + return m.test(path); + }); +} + +let installed = false; + +/** + * @param {{ ignore?: Matcher[], only?: Matcher[] } | undefined} options + */ +function install(options = undefined) { + if (installed) { + return; + } + + installed = true; + const cache = getCache(); + + sourceMapSupport.install({ + handleUncaughtExceptions: false, + environment: 'node', + // @ts-expect-error bad source-map-support types + retrieveSourceMap(path) { + const map = cache.getSourceMap(path); + return map ? { map, url: null } : null; + }, + }); + + const ignorePatterns = options?.ignore + ? [...options.ignore, ...IGNORE_PATTERNS] + : IGNORE_PATTERNS; + + addHook( + (code, path) => { + const ext = Path.extname(path); + const transform = (Object.hasOwn(TRANSFORMS, ext) && TRANSFORMS[ext]) || TRANSFORMS.default; + return transform(path, code, cache); + }, + { + exts: ['.js', '.ts', '.tsx', '.peggy'], + ignoreNodeModules: false, + matcher(path) { + if (options?.only && !match(path, options.only)) { + return false; + } + + return !match(path, ignorePatterns); + }, + } + ); +} + +module.exports = { install }; diff --git a/packages/kbn-optimizer/src/node/polyfill.ts b/packages/kbn-babel-register/install.js similarity index 93% rename from packages/kbn-optimizer/src/node/polyfill.ts rename to packages/kbn-babel-register/install.js index e84906bda146..55a635e6184a 100644 --- a/packages/kbn-optimizer/src/node/polyfill.ts +++ b/packages/kbn-babel-register/install.js @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -import 'core-js/stable'; +require('.').install(); diff --git a/packages/kbn-type-summarizer/jest.config.js b/packages/kbn-babel-register/jest.config.js similarity index 89% rename from packages/kbn-type-summarizer/jest.config.js rename to packages/kbn-babel-register/jest.config.js index 76d7b935cfce..03d9d66acdc0 100644 --- a/packages/kbn-type-summarizer/jest.config.js +++ b/packages/kbn-babel-register/jest.config.js @@ -9,5 +9,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../..', - roots: ['/packages/kbn-type-summarizer'], + roots: ['/packages/kbn-babel-register'], }; diff --git a/packages/kbn-babel-register/kibana.jsonc b/packages/kbn-babel-register/kibana.jsonc new file mode 100644 index 000000000000..33dd730bc10b --- /dev/null +++ b/packages/kbn-babel-register/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/babel-register", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-babel-register/package.json b/packages/kbn-babel-register/package.json new file mode 100644 index 000000000000..efca23be6801 --- /dev/null +++ b/packages/kbn-babel-register/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/babel-register", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-babel-register/transforms/babel.js b/packages/kbn-babel-register/transforms/babel.js new file mode 100644 index 000000000000..a1557bd52889 --- /dev/null +++ b/packages/kbn-babel-register/transforms/babel.js @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const Fs = require('fs'); + +const { transformCode } = require('@kbn/babel-transform'); + +/** @type {import('./types').Transform} */ +const babelTransform = (path, source, cache) => { + const mtime = `${Fs.statSync(path).mtimeMs}`; + + if (cache.getMtime(path) === mtime) { + const code = cache.getCode(path); + if (code) { + return code; + } + } + + const result = transformCode(path, source); + + cache.update(path, { + mtime, + code: result.code, + map: result.map, + }); + + return result.code; +}; + +module.exports = { babelTransform }; diff --git a/packages/kbn-babel-register/transforms/index.js b/packages/kbn-babel-register/transforms/index.js new file mode 100644 index 000000000000..5b656eae913d --- /dev/null +++ b/packages/kbn-babel-register/transforms/index.js @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const { peggyTransform } = require('./peggy'); +const { babelTransform } = require('./babel'); + +module.exports = { + TRANSFORMS: { + '.peggy': peggyTransform, + default: babelTransform, + }, +}; diff --git a/packages/kbn-optimizer/src/node/transforms/peggy.ts b/packages/kbn-babel-register/transforms/peggy.js similarity index 81% rename from packages/kbn-optimizer/src/node/transforms/peggy.ts rename to packages/kbn-babel-register/transforms/peggy.js index 23edb608ef56..b87676ca03bc 100644 --- a/packages/kbn-optimizer/src/node/transforms/peggy.ts +++ b/packages/kbn-babel-register/transforms/peggy.js @@ -6,14 +6,13 @@ * Side Public License, v 1. */ -import Fs from 'fs'; -import Crypto from 'crypto'; +const Fs = require('fs'); +const Crypto = require('crypto'); -import * as Peggy from '@kbn/peggy'; +const Peggy = require('@kbn/peggy'); -import { Transform } from './transform'; - -export const peggyTransform: Transform = (path, source, cache) => { +/** @type {import('./types').Transform} */ +const peggyTransform = (path, source, cache) => { const config = Peggy.findConfigFile(path); const mtime = `${Fs.statSync(path).mtimeMs}`; const key = !config @@ -46,3 +45,5 @@ export const peggyTransform: Transform = (path, source, cache) => { return code; }; + +module.exports = { peggyTransform }; diff --git a/packages/kbn-optimizer/src/node/transforms/transform.ts b/packages/kbn-babel-register/transforms/types.ts similarity index 90% rename from packages/kbn-optimizer/src/node/transforms/transform.ts rename to packages/kbn-babel-register/transforms/types.ts index 49c76a8c14bd..9d649f22ae62 100644 --- a/packages/kbn-optimizer/src/node/transforms/transform.ts +++ b/packages/kbn-babel-register/transforms/types.ts @@ -6,6 +6,6 @@ * Side Public License, v 1. */ -import { Cache } from '../cache'; +import type { Cache } from '../cache/types'; export type Transform = (path: string, source: string, cache: Cache) => string; diff --git a/packages/kbn-babel-register/tsconfig.json b/packages/kbn-babel-register/tsconfig.json new file mode 100644 index 000000000000..5d46380d2ef7 --- /dev/null +++ b/packages/kbn-babel-register/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "checkJs": true, + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.js", + "**/*.ts", + ], + "kbn_references": [ + "@kbn/package-map", + "@kbn/repo-info", + "@kbn/babel-transform", + "@kbn/peggy", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-babel-transform/BUILD.bazel b/packages/kbn-babel-transform/BUILD.bazel new file mode 100644 index 000000000000..eb292fe60390 --- /dev/null +++ b/packages/kbn-babel-transform/BUILD.bazel @@ -0,0 +1,33 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.js", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +BUNDLER_DEPS = [ + "@npm//piscina", + "@npm//@babel/core", +] + +js_library( + name = "kbn-babel-transform", + package_name = "@kbn/babel-transform", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-babel-transform/README.md b/packages/kbn-babel-transform/README.md new file mode 100644 index 000000000000..8f14d5ab82ba --- /dev/null +++ b/packages/kbn-babel-transform/README.md @@ -0,0 +1,3 @@ +# @kbn/babel-transform + +Empty package generated by @kbn/generate diff --git a/packages/kbn-babel-transform/fast_async_transformer.js b/packages/kbn-babel-transform/fast_async_transformer.js new file mode 100644 index 000000000000..fad1a1762ba4 --- /dev/null +++ b/packages/kbn-babel-transform/fast_async_transformer.js @@ -0,0 +1,53 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const Piscina = require('piscina'); + +/** + * @param {import('./types').TransformConfig} config + * @param {(transform: import('./types').Transform) => Promise} block + * @returns {Promise} + */ +async function withFastAsyncTransform(config, block) { + /** @type {import('./types').WorkerData} */ + const workerData = { + config, + }; + + const pool = new Piscina({ + filename: require.resolve('./fast_async_worker.mjs'), + idleTimeout: 200, + workerData, + }); + + /** @type {import('./types').Transform} */ + const transform = async (path, source) => { + /** @type {import('./types').WorkerTask} */ + const task = { + path, + source, + }; + return await pool.run(task); + }; + + let success = false; + try { + await block(transform); + success = true; + } finally { + try { + await pool.destroy(); + } catch (error) { + if (success === true) { + console.error(`Failure closing piscina pool: ${error.stack}`); + } + } + } +} + +module.exports = { withFastAsyncTransform }; diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/export_some_name.ts b/packages/kbn-babel-transform/fast_async_worker.mjs similarity index 50% rename from packages/kbn-type-summarizer/src/lib/type_summary/export_some_name.ts rename to packages/kbn-babel-transform/fast_async_worker.mjs index d8616d5ae492..171c1151c434 100644 --- a/packages/kbn-type-summarizer/src/lib/type_summary/export_some_name.ts +++ b/packages/kbn-babel-transform/fast_async_worker.mjs @@ -6,13 +6,16 @@ * Side Public License, v 1. */ -import { NamedExportDetails } from '../export_details'; +import { workerData } from 'piscina'; +import { transformCode } from './sync_transform.js'; + +/** @type {import('./types').WorkerData} */ +const { config } = workerData; /** - * Create an export statement for some name already in scope + * @param {import('./types').WorkerTask} param0 + * @returns {Promise} */ -export const exportSomeName = ({ name, typeOnly }: NamedExportDetails, localName: string) => { - return `export ${typeOnly ? `type ` : ''}{${ - name === localName ? name : `${localName} as ${name}` - }}\n`; +export default async ({ path, source }) => { + return transformCode(path, source, config); }; diff --git a/packages/kbn-type-summarizer-core/src/log/test_log.ts b/packages/kbn-babel-transform/index.js similarity index 52% rename from packages/kbn-type-summarizer-core/src/log/test_log.ts rename to packages/kbn-babel-transform/index.js index 8f05c8b60989..2ee140e1260e 100644 --- a/packages/kbn-type-summarizer-core/src/log/test_log.ts +++ b/packages/kbn-babel-transform/index.js @@ -6,22 +6,10 @@ * Side Public License, v 1. */ -import { CliLog } from './cli_log'; +/** @typedef {import('./types').TransformConfig} TransformConfig */ -/** - * Logger which collects messages in memory for testing - */ -export class TestLog extends CliLog { - messages: string[] = []; - constructor() { - super( - 'debug', - { - write: (chunk) => { - this.messages.push(chunk); - }, - }, - false - ); - } -} +const { getBabelOptions } = require('./options'); +const { transformCode } = require('./sync_transform'); +const { withFastAsyncTransform } = require('./fast_async_transformer'); + +module.exports = { transformCode, getBabelOptions, withFastAsyncTransform }; diff --git a/packages/kbn-type-summarizer-cli/jest.config.js b/packages/kbn-babel-transform/jest.config.js similarity index 88% rename from packages/kbn-type-summarizer-cli/jest.config.js rename to packages/kbn-babel-transform/jest.config.js index bbf8a9ab4449..78f6018332bd 100644 --- a/packages/kbn-type-summarizer-cli/jest.config.js +++ b/packages/kbn-babel-transform/jest.config.js @@ -9,5 +9,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../..', - roots: ['/packages/kbn-type-summarizer-cli'], + roots: ['/packages/kbn-babel-transform'], }; diff --git a/packages/kbn-babel-transform/kibana.jsonc b/packages/kbn-babel-transform/kibana.jsonc new file mode 100644 index 000000000000..72b7cf1a9cc8 --- /dev/null +++ b/packages/kbn-babel-transform/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/babel-transform", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-babel-transform/options.js b/packages/kbn-babel-transform/options.js new file mode 100644 index 000000000000..c8c089f873da --- /dev/null +++ b/packages/kbn-babel-transform/options.js @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const NODE_PRESET = require.resolve('@kbn/babel-preset/node_preset'); + +const cwd = process.cwd(); + +/** + * get the babel options for a specific path, path does not + * exist, utit just might vary based on the file extension + * + * @param {string | undefined} path + * @param {import('./types').TransformConfig} config + * @returns {import('@babel/core').TransformOptions} + */ +function getBabelOptions(path, config = {}) { + return { + filename: path, + presets: [ + [ + NODE_PRESET, + { + 'kibana/ignoredPkgIds': config.ignoredPkgIds, + }, + ], + ], + cwd, + babelrc: false, + sourceMaps: !config.disableSourceMaps, + ast: false, + }; +} + +module.exports = { getBabelOptions }; diff --git a/packages/kbn-babel-transform/package.json b/packages/kbn-babel-transform/package.json new file mode 100644 index 000000000000..6756ec19c71e --- /dev/null +++ b/packages/kbn-babel-transform/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/babel-transform", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-babel-transform/sync_transform.js b/packages/kbn-babel-transform/sync_transform.js new file mode 100644 index 000000000000..d96ec0d6e854 --- /dev/null +++ b/packages/kbn-babel-transform/sync_transform.js @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const babel = require('@babel/core'); + +const { getBabelOptions } = require('./options'); + +/** + * transform the source code at the given path with babel + * using the standard configuration for the repository + * @param {string} path + * @param {string | undefined} source + * @param {import('./types').TransformConfig} config + * @returns + */ +function transformCode(path, source, config = {}) { + const options = getBabelOptions(path, config); + const result = + source === undefined + ? babel.transformFileSync(path, options) + : babel.transformSync(source, options); + + if (!result || !result.code) { + throw new Error(`babel failed to transpile [${path}]`); + } + + return { + code: result.code, + map: result.map, + }; +} + +module.exports = { transformCode }; diff --git a/packages/kbn-babel-transform/tsconfig.json b/packages/kbn-babel-transform/tsconfig.json new file mode 100644 index 000000000000..d87e149617bd --- /dev/null +++ b/packages/kbn-babel-transform/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "checkJs": true, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.js", + "**/*.ts", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-babel-transform/types.ts b/packages/kbn-babel-transform/types.ts new file mode 100644 index 000000000000..1ccb31d9ebb7 --- /dev/null +++ b/packages/kbn-babel-transform/types.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export interface TransformConfig { + disableSourceMaps?: boolean; + ignoredPkgIds?: string[]; +} + +export interface WorkerData { + config: TransformConfig; +} + +export interface WorkerTask { + path: string; + source: string; +} + +export interface WorkerResult { + code: string; + map?: any; +} + +export type Transform = (path: string, source: string) => Promise; diff --git a/packages/kbn-bazel-packages/BUILD.bazel b/packages/kbn-bazel-packages/BUILD.bazel deleted file mode 100644 index 83804b96e50b..000000000000 --- a/packages/kbn-bazel-packages/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-bazel-packages" -PKG_REQUIRE_NAME = "@kbn/bazel-packages" - -SOURCE_FILES = glob( - [ - "**/*.js", - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS: -# eg. "@npm//@types/babel__core" -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - allow_js = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-bazel-packages/kibana.jsonc b/packages/kbn-bazel-packages/kibana.jsonc index fc373ccad73a..b6e523cf1d5d 100644 --- a/packages/kbn-bazel-packages/kibana.jsonc +++ b/packages/kbn-bazel-packages/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/bazel-packages", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-bazel-packages/package.json b/packages/kbn-bazel-packages/package.json index 32e4cdd4df27..4754d876b7aa 100644 --- a/packages/kbn-bazel-packages/package.json +++ b/packages/kbn-bazel-packages/package.json @@ -2,7 +2,5 @@ "name": "@kbn/bazel-packages", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-bazel-packages/src/bazel_package.js b/packages/kbn-bazel-packages/src/bazel_package.js index 4a6d1b69bd8b..bb5d42192bfe 100644 --- a/packages/kbn-bazel-packages/src/bazel_package.js +++ b/packages/kbn-bazel-packages/src/bazel_package.js @@ -8,21 +8,16 @@ const { inspect } = require('util'); const Path = require('path'); -const Fsp = require('fs/promises'); const { readPackageJson } = require('./parse_package_json'); const { readPackageManifest } = require('./parse_package_manifest'); -const BUILD_RULE_NAME = /(^|\s)name\s*=\s*"build"/; -const BUILD_TYPES_RULE_NAME = /(^|\s)name\s*=\s*"build_types"/; - /** * Representation of a Bazel Package in the Kibana repository * @class * @property {string} normalizedRepoRelativeDir * @property {import('./types').KibanaPackageManifest} manifest * @property {import('./types').ParsedPackageJson | undefined} pkg - * @property {string | undefined} buildBazelContent */ class BazelPackage { /** @@ -35,18 +30,10 @@ class BazelPackage { const manifest = readPackageManifest(path); const dir = Path.dirname(path); - let buildBazelContent; - try { - buildBazelContent = await Fsp.readFile(Path.resolve(dir, 'BUILD.bazel'), 'utf8'); - } catch (error) { - throw new Error(`unable to read BUILD.bazel file in [${dir}]: ${error.message}`); - } - return new BazelPackage( Path.relative(repoRoot, dir), manifest, - readPackageJson(Path.resolve(dir, 'package.json')), - buildBazelContent + readPackageJson(Path.resolve(dir, 'package.json')) ); } @@ -82,31 +69,11 @@ class BazelPackage { * Parsed package.json file from the package * @type {import('./types').ParsedPackageJson | undefined} */ - pkg, - /** - * Content of the BUILD.bazel file - * @type {string | undefined} - */ - buildBazelContent = undefined + pkg ) { this.normalizedRepoRelativeDir = normalizedRepoRelativeDir; this.manifest = manifest; this.pkg = pkg; - this.buildBazelContent = buildBazelContent; - } - - /** - * Returns true if the package includes a `:build` bazel rule - */ - hasBuildRule() { - return !!(this.buildBazelContent && BUILD_RULE_NAME.test(this.buildBazelContent)); - } - - /** - * Returns true if the package includes a `:build_types` bazel rule - */ - hasBuildTypesRule() { - return !!(this.buildBazelContent && BUILD_TYPES_RULE_NAME.test(this.buildBazelContent)); } /** diff --git a/packages/kbn-bazel-packages/src/bazel_package.test.ts b/packages/kbn-bazel-packages/src/bazel_package.test.ts deleted file mode 100644 index 202d4d96204e..000000000000 --- a/packages/kbn-bazel-packages/src/bazel_package.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs'; -import Path from 'path'; - -import { BazelPackage } from './bazel_package'; -import { KibanaPackageManifest, ParsedPackageJson } from './types'; - -const OWN_BAZEL_BUILD_FILE = Fs.readFileSync(Path.resolve(__dirname, '../BUILD.bazel'), 'utf8'); - -const pkgJson: ParsedPackageJson = { - name: 'foo', -}; -const manifest: KibanaPackageManifest = { - type: 'shared-common', - id: '@kbn/foo', - owner: ['@elastic/kibana-operations'], - runtimeDeps: [], - typeDeps: [], -}; - -describe('hasBuildRule()', () => { - it('returns true if there is a rule with the name "build"', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson, OWN_BAZEL_BUILD_FILE); - expect(pkg.hasBuildRule()).toBe(true); - }); - - it('returns false if there is no rule with name "build"', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson, ``); - expect(pkg.hasBuildRule()).toBe(false); - }); - - it('returns false if there is no BUILD.bazel file', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson); - expect(pkg.hasBuildRule()).toBe(false); - }); -}); - -describe('hasBuildTypesRule()', () => { - it('returns true if there is a rule with the name "build_types"', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson, OWN_BAZEL_BUILD_FILE); - expect(pkg.hasBuildTypesRule()).toBe(true); - }); - - it('returns false if there is no rule with name "build_types"', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson, ``); - expect(pkg.hasBuildTypesRule()).toBe(false); - }); - - it('returns false if there is no BUILD.bazel file', () => { - const pkg = new BazelPackage('foo', manifest, pkgJson); - expect(pkg.hasBuildTypesRule()).toBe(false); - }); -}); diff --git a/packages/kbn-bazel-packages/src/parse_package_manifest.js b/packages/kbn-bazel-packages/src/parse_package_manifest.js index 97a209bb4738..cd7310d27812 100644 --- a/packages/kbn-bazel-packages/src/parse_package_manifest.js +++ b/packages/kbn-bazel-packages/src/parse_package_manifest.js @@ -122,8 +122,7 @@ function validatePackageManifest(parsed) { throw new Error('expected manifest root to be an object'); } - const { type, id, owner, typeDeps, runtimeDeps, devOnly, plugin, sharedBrowserBundle, ...extra } = - parsed; + const { type, id, owner, devOnly, plugin, sharedBrowserBundle, ...extra } = parsed; const extraKeys = Object.keys(extra); if (extraKeys.length) { @@ -149,14 +148,6 @@ function validatePackageManifest(parsed) { ); } - if (!isArrOfStrings(typeDeps)) { - throw err(`typeDeps`, typeDeps, `must be an array of strings`); - } - - if (!isArrOfStrings(runtimeDeps)) { - throw err(`runtimeDeps`, runtimeDeps, `must be an array of strings`); - } - if (devOnly !== undefined && typeof devOnly !== 'boolean') { throw err(`devOnly`, devOnly, `must be a boolean when defined`); } @@ -164,8 +155,6 @@ function validatePackageManifest(parsed) { const base = { id, owner: Array.isArray(owner) ? owner : [owner], - typeDeps, - runtimeDeps, devOnly, }; diff --git a/packages/kbn-bazel-packages/src/types.ts b/packages/kbn-bazel-packages/src/types.ts index 106d0bce3fe5..2ad621900d49 100644 --- a/packages/kbn-bazel-packages/src/types.ts +++ b/packages/kbn-bazel-packages/src/types.ts @@ -58,16 +58,6 @@ interface PackageManifestBaseFields { * These values will be used in the codeowners files for this package. */ owner: string[]; - /** - * Packages which are required for the source code in the package to be type- - * checked. This list is updated automatically by the package linter - */ - typeDeps: string[]; - /** - * Packages which are required for the source code of the package to run. This - * list is updated automatically by the package linter. - */ - runtimeDeps: string[]; /** * A devOnly package can be used by other devOnly packages (and only * other devOnly packages) and will never be included in the distributable diff --git a/packages/kbn-bazel-packages/tsconfig.json b/packages/kbn-bazel-packages/tsconfig.json index b58cd70b2c65..19c7e8d59f65 100644 --- a/packages/kbn-bazel-packages/tsconfig.json +++ b/packages/kbn-bazel-packages/tsconfig.json @@ -1,10 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, "checkJs": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -13,5 +11,8 @@ "include": [ "**/*.ts", "**/*.js" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-bazel-runner/BUILD.bazel b/packages/kbn-bazel-runner/BUILD.bazel deleted file mode 100644 index 6d5f2efd9def..000000000000 --- a/packages/kbn-bazel-runner/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-bazel-runner" -PKG_REQUIRE_NAME = "@kbn/bazel-runner" - -SOURCE_FILES = glob( - [ - "**/*.js", - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//execa", - "@npm//chalk", - "@npm//rxjs", - "//packages/kbn-dev-utils", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//execa", - "@npm//chalk", - "@npm//rxjs", - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - allow_js = True, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-bazel-runner/kibana.jsonc b/packages/kbn-bazel-runner/kibana.jsonc index b313e99f5b9c..893ce216fc14 100644 --- a/packages/kbn-bazel-runner/kibana.jsonc +++ b/packages/kbn-bazel-runner/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/bazel-runner", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-bazel-runner/package.json b/packages/kbn-bazel-runner/package.json index bf34fa74f8a6..c847ffbf6e90 100644 --- a/packages/kbn-bazel-runner/package.json +++ b/packages/kbn-bazel-runner/package.json @@ -2,7 +2,5 @@ "name": "@kbn/bazel-runner", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-bazel-runner/tsconfig.json b/packages/kbn-bazel-runner/tsconfig.json index 6065463237d1..b19a1a8e8cdd 100644 --- a/packages/kbn-bazel-runner/tsconfig.json +++ b/packages/kbn-bazel-runner/tsconfig.json @@ -1,10 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, "checkJs": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -13,5 +11,10 @@ "include": [ "**/*.js", "**/*.ts" + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-cases-components/BUILD.bazel b/packages/kbn-cases-components/BUILD.bazel deleted file mode 100644 index 742948f37f0f..000000000000 --- a/packages/kbn-cases-components/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-cases-components" -PKG_REQUIRE_NAME = "@kbn/cases-components" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "@npm//@elastic/eui", - "@npm//@testing-library/react", - "@npm//react", -] - -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "@npm//@elastic/eui", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@testing-library/react", - "@npm//tslib", - "@npm//@types/react", - "@npm//@testing-library/jest-dom", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-cases-components/kibana.jsonc b/packages/kbn-cases-components/kibana.jsonc index 6893f2473ed1..8fa02ddd80eb 100644 --- a/packages/kbn-cases-components/kibana.jsonc +++ b/packages/kbn-cases-components/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/cases-components", - "owner": "@elastic/response-ops", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/response-ops" } diff --git a/packages/kbn-cases-components/package.json b/packages/kbn-cases-components/package.json index 09d1d72ea836..392a1a79b204 100644 --- a/packages/kbn-cases-components/package.json +++ b/packages/kbn-cases-components/package.json @@ -2,8 +2,5 @@ "name": "@kbn/cases-components", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-cases-components/tsconfig.json b/packages/kbn-cases-components/tsconfig.json index f48d8e4a548b..3d7519541dc8 100644 --- a/packages/kbn-cases-components/tsconfig.json +++ b/packages/kbn-cases-components/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-chart-icons/BUILD.bazel b/packages/kbn-chart-icons/BUILD.bazel deleted file mode 100644 index d1ef991c0bef..000000000000 --- a/packages/kbn-chart-icons/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-chart-icons" -PKG_REQUIRE_NAME = "@kbn/chart-icons" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx" - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-ui-theme", - "@npm//react", - "@npm//@elastic/eui", - "@npm//@emotion/css", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-ui-theme:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "@npm//@emotion/css", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-chart-icons/kibana.jsonc b/packages/kbn-chart-icons/kibana.jsonc index 47e7394190fa..95089968838f 100644 --- a/packages/kbn-chart-icons/kibana.jsonc +++ b/packages/kbn-chart-icons/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/chart-icons", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-chart-icons/package.json b/packages/kbn-chart-icons/package.json index 901cc41588b0..eb2854aa5612 100644 --- a/packages/kbn-chart-icons/package.json +++ b/packages/kbn-chart-icons/package.json @@ -2,8 +2,5 @@ "name": "@kbn/chart-icons", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-chart-icons/tsconfig.json b/packages/kbn-chart-icons/tsconfig.json index aed4b0c3763d..c4f38f3a8ec9 100644 --- a/packages/kbn-chart-icons/tsconfig.json +++ b/packages/kbn-chart-icons/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/ui-theme" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ci-stats-core/BUILD.bazel b/packages/kbn-ci-stats-core/BUILD.bazel deleted file mode 100644 index 6d68336effc2..000000000000 --- a/packages/kbn-ci-stats-core/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ci-stats-core" -PKG_REQUIRE_NAME = "@kbn/ci-stats-core" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-tooling-log", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-some-dev-log:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ci-stats-core/kibana.jsonc b/packages/kbn-ci-stats-core/kibana.jsonc index 9140ec71ef91..f25ef3ae32e9 100644 --- a/packages/kbn-ci-stats-core/kibana.jsonc +++ b/packages/kbn-ci-stats-core/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ci-stats-core", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ci-stats-core/package.json b/packages/kbn-ci-stats-core/package.json index eb271889023a..3b6f2c9c4c5d 100644 --- a/packages/kbn-ci-stats-core/package.json +++ b/packages/kbn-ci-stats-core/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ci-stats-core", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-ci-stats-core/tsconfig.json b/packages/kbn-ci-stats-core/tsconfig.json index 57c1dd1c94e0..053fda6b3792 100644 --- a/packages/kbn-ci-stats-core/tsconfig.json +++ b/packages/kbn-ci-stats-core/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/some-dev-log" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ci-stats-performance-metrics/BUILD.bazel b/packages/kbn-ci-stats-performance-metrics/BUILD.bazel deleted file mode 100644 index 3b3340c0e6cb..000000000000 --- a/packages/kbn-ci-stats-performance-metrics/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ci-stats-performance-metrics" -PKG_REQUIRE_NAME = "@kbn/ci-stats-performance-metrics" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-dev-cli-errors", - "//packages/kbn-dev-cli-runner", - "//packages/kbn-test", - "//packages/kbn-tooling-log", - "//packages/kbn-ci-stats-reporter", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-test:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-ci-stats-reporter:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ci-stats-performance-metrics/kibana.jsonc b/packages/kbn-ci-stats-performance-metrics/kibana.jsonc index 3c4b4a440a98..720a500b7f28 100644 --- a/packages/kbn-ci-stats-performance-metrics/kibana.jsonc +++ b/packages/kbn-ci-stats-performance-metrics/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ci-stats-performance-metrics", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ci-stats-performance-metrics/package.json b/packages/kbn-ci-stats-performance-metrics/package.json index 6d12a45cc4db..d12d40c45a54 100644 --- a/packages/kbn-ci-stats-performance-metrics/package.json +++ b/packages/kbn-ci-stats-performance-metrics/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ci-stats-performance-metrics", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ci-stats-performance-metrics/tsconfig.json b/packages/kbn-ci-stats-performance-metrics/tsconfig.json index 57c1dd1c94e0..9eb039a7e008 100644 --- a/packages/kbn-ci-stats-performance-metrics/tsconfig.json +++ b/packages/kbn-ci-stats-performance-metrics/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-errors", + "@kbn/dev-cli-runner", + "@kbn/tooling-log", + "@kbn/ci-stats-reporter" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ci-stats-reporter/BUILD.bazel b/packages/kbn-ci-stats-reporter/BUILD.bazel deleted file mode 100644 index 1a43bc14012e..000000000000 --- a/packages/kbn-ci-stats-reporter/BUILD.bazel +++ /dev/null @@ -1,131 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ci-stats-reporter" -PKG_REQUIRE_NAME = "@kbn/ci-stats-reporter" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//axios", - "@npm//execa", - "//packages/kbn-tooling-log", - "//packages/kbn-ci-stats-core", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//axios", - "@npm//execa", - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-ci-stats-core:npm_module_types", - "//packages/kbn-some-dev-log:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ci-stats-reporter/kibana.jsonc b/packages/kbn-ci-stats-reporter/kibana.jsonc index 9991f55a342f..71eff10133dd 100644 --- a/packages/kbn-ci-stats-reporter/kibana.jsonc +++ b/packages/kbn-ci-stats-reporter/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ci-stats-reporter", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ci-stats-reporter/package.json b/packages/kbn-ci-stats-reporter/package.json index b16ac7db77dc..52d6fcea7607 100644 --- a/packages/kbn-ci-stats-reporter/package.json +++ b/packages/kbn-ci-stats-reporter/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ci-stats-reporter", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts b/packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts index f3c80eb3b22e..0f469de2a4eb 100644 --- a/packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts +++ b/packages/kbn-ci-stats-reporter/src/ci_stats_reporter.ts @@ -14,7 +14,7 @@ import crypto from 'crypto'; import execa from 'execa'; import Axios, { AxiosRequestConfig } from 'axios'; -import { REPO_ROOT, kibanaPackageJson } from '@kbn/utils'; +import { REPO_ROOT, kibanaPackageJson } from '@kbn/repo-info'; import { parseConfig, Config, CiStatsMetadata } from '@kbn/ci-stats-core'; import type { SomeDevLog } from '@kbn/some-dev-log'; diff --git a/packages/kbn-ci-stats-reporter/tsconfig.json b/packages/kbn-ci-stats-reporter/tsconfig.json index 57c1dd1c94e0..e72339794726 100644 --- a/packages/kbn-ci-stats-reporter/tsconfig.json +++ b/packages/kbn-ci-stats-reporter/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/ci-stats-core", + "@kbn/some-dev-log", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel deleted file mode 100644 index 399ee78330c6..000000000000 --- a/packages/kbn-cli-dev-mode/BUILD.bazel +++ /dev/null @@ -1,144 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-cli-dev-mode" -PKG_REQUIRE_NAME = "@kbn/cli-dev-mode" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-config", - "//packages/kbn-config-schema", - "//packages/kbn-dev-utils", - "//packages/kbn-logging", - "//packages/kbn-optimizer", - "//packages/kbn-server-http-tools", - "//packages/kbn-std", - "//packages/kbn-utils", - "@npm//@hapi/h2o2", - "@npm//@hapi/hapi", - "@npm//argsplit", - "@npm//chokidar", - "@npm//elastic-apm-node", - "@npm//execa", - "@npm//getopts", - "@npm//lodash", - "@npm//moment", - "@npm//rxjs", - "@npm//supertest", -] - -TYPES_DEPS = [ - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-optimizer:npm_module_types", - "//packages/kbn-server-http-tools:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//argsplit", - "@npm//chokidar", - "@npm//elastic-apm-node", - "@npm//execa", - "@npm//getopts", - "@npm//moment", - "@npm//rxjs", - "@npm//supertest", - "@npm//@types/hapi__h2o2", - "@npm//@types/hapi__hapi", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/supertest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-cli-dev-mode/kibana.jsonc b/packages/kbn-cli-dev-mode/kibana.jsonc index 18c9cb7ba46a..3c55d047b0ef 100644 --- a/packages/kbn-cli-dev-mode/kibana.jsonc +++ b/packages/kbn-cli-dev-mode/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/cli-dev-mode", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-cli-dev-mode/package.json b/packages/kbn-cli-dev-mode/package.json index f799551d83ad..08c4fc3598cd 100644 --- a/packages/kbn-cli-dev-mode/package.json +++ b/packages/kbn-cli-dev-mode/package.json @@ -1,8 +1,6 @@ { "name": "@kbn/cli-dev-mode", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-cli-dev-mode/src/bootstrap.ts b/packages/kbn-cli-dev-mode/src/bootstrap.ts index 0428051b77e3..b4d7324ee726 100644 --- a/packages/kbn-cli-dev-mode/src/bootstrap.ts +++ b/packages/kbn-cli-dev-mode/src/bootstrap.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { CliArgs, Env, RawConfigAdapter } from '@kbn/config'; import { CliDevMode } from './cli_dev_mode'; import { CliLog } from './log'; diff --git a/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts b/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts index 6dd96cbb0634..675ffdc6faa7 100644 --- a/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts +++ b/packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import * as Rx from 'rxjs'; import { createAbsolutePathSerializer, createAnyInstanceSerializer } from '@kbn/jest-serializers'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { TestLog } from './log'; import { CliDevMode, SomeCliArgs } from './cli_dev_mode'; diff --git a/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts b/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts index ccd3e6121446..3edfe5100f3e 100644 --- a/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts +++ b/packages/kbn-cli-dev-mode/src/cli_dev_mode.ts @@ -23,7 +23,7 @@ import { } from 'rxjs/operators'; import { CliArgs } from '@kbn/config'; import { CiStatsReporter } from '@kbn/ci-stats-reporter'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Log, CliLog } from './log'; import { Optimizer } from './optimizer'; diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts index 7cf35cb908e3..3c20254add43 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getServerWatchPaths } from './get_server_watch_paths'; @@ -33,6 +33,14 @@ it('produces the right watch and ignore list', () => { /src/plugins, /test/plugin_functional/plugins, /x-pack/plugins, + /packages, + /packages/shared-ux, + /packages/analytics, + /packages/analytics/shippers, + /packages/analytics/shippers/elastic_v3, + /packages/home, + /packages/content-management, + /x-pack/packages/ml, ] `); diff --git a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts index 452186c5ce17..9c2795482c99 100644 --- a/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts +++ b/packages/kbn-cli-dev-mode/src/get_server_watch_paths.ts @@ -9,7 +9,8 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { BAZEL_PACKAGE_DIRS } from '@kbn/bazel-packages'; interface Options { pluginPaths: string[]; @@ -46,6 +47,7 @@ export function getServerWatchPaths({ pluginPaths, pluginScanDirs }: Options) { fromRoot('config'), ...pluginPaths, ...pluginScanDirs, + ...BAZEL_PACKAGE_DIRS, ].map((path) => Path.resolve(path)) ) ).filter((path) => Fs.existsSync(fromRoot(path))); diff --git a/packages/kbn-cli-dev-mode/tsconfig.json b/packages/kbn-cli-dev-mode/tsconfig.json index 60a261148e76..b43017cae136 100644 --- a/packages/kbn-cli-dev-mode/tsconfig.json +++ b/packages/kbn-cli-dev-mode/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,4 +10,20 @@ "include": [ "**/*.ts" ], + "kbn_references": [ + "@kbn/config", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/optimizer", + "@kbn/server-http-tools", + "@kbn/repo-info", + "@kbn/ci-stats-reporter", + "@kbn/jest-serializers", + "@kbn/stdio-dev-helpers", + "@kbn/bazel-packages", + "@kbn/tooling-log", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-coloring/BUILD.bazel b/packages/kbn-coloring/BUILD.bazel deleted file mode 100644 index 80a1f90ce918..000000000000 --- a/packages/kbn-coloring/BUILD.bazel +++ /dev/null @@ -1,155 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-coloring" -PKG_REQUIRE_NAME = "@kbn/coloring" - -SOURCE_FILES = glob( - [ - "**/*.scss", - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/kbn-interpreter", - "//packages/kbn-utility-types", - "//packages/kbn-shared-ux-utility", - "@npm//chroma-js", - "@npm//@elastic/eui", - "@npm//react-use", - "@npm//react", - "@npm//@emotion/react", - "@npm//@emotion/css", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-interpreter:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "@npm//@types/chroma-js", - "@npm//@types/react", - "@npm//@elastic/eui", - "@npm//react-use", - "@npm//@emotion/react", - "@npm//@emotion/css", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-coloring/kibana.jsonc b/packages/kbn-coloring/kibana.jsonc index 410698f34580..54d8787c964f 100644 --- a/packages/kbn-coloring/kibana.jsonc +++ b/packages/kbn-coloring/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/coloring", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-coloring/package.json b/packages/kbn-coloring/package.json index df816c6e892b..ec8092b3c613 100644 --- a/packages/kbn-coloring/package.json +++ b/packages/kbn-coloring/package.json @@ -2,8 +2,5 @@ "name": "@kbn/coloring", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-coloring/tsconfig.json b/packages/kbn-coloring/tsconfig.json index e0b5f2c05330..54c068f8bd3b 100644 --- a/packages/kbn-coloring/tsconfig.json +++ b/packages/kbn-coloring/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,16 @@ "**/*.scss", "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/interpreter", + "@kbn/utility-types", + "@kbn/shared-ux-utility", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-config-mocks/BUILD.bazel b/packages/kbn-config-mocks/BUILD.bazel deleted file mode 100644 index 5389233b8419..000000000000 --- a/packages/kbn-config-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-config-mocks" -PKG_REQUIRE_NAME = "@kbn/config-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-config", - "//packages/kbn-utils", -] - -TYPES_DEPS = [ - "@npm//rxjs", - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-config-mocks/kibana.jsonc b/packages/kbn-config-mocks/kibana.jsonc index de1d13289e8f..db330e90a69f 100644 --- a/packages/kbn-config-mocks/kibana.jsonc +++ b/packages/kbn-config-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/config-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-config-mocks/package.json b/packages/kbn-config-mocks/package.json index c2bbafd095db..5a6e504f3e4b 100644 --- a/packages/kbn-config-mocks/package.json +++ b/packages/kbn-config-mocks/package.json @@ -2,8 +2,6 @@ "name": "@kbn/config-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-config-mocks/src/env.mock.ts b/packages/kbn-config-mocks/src/env.mock.ts index dd244cbf9500..405a043863a8 100644 --- a/packages/kbn-config-mocks/src/env.mock.ts +++ b/packages/kbn-config-mocks/src/env.mock.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env, type RawPackageInfo, type EnvOptions } from '@kbn/config'; type DeepPartial = { diff --git a/packages/kbn-config-mocks/tsconfig.json b/packages/kbn-config-mocks/tsconfig.json index 57c1dd1c94e0..2594906b1362 100644 --- a/packages/kbn-config-mocks/tsconfig.json +++ b/packages/kbn-config-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config", + "@kbn/utility-types", + "@kbn/doc-links", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-config-schema/BUILD.bazel b/packages/kbn-config-schema/BUILD.bazel deleted file mode 100644 index 64734fa5f133..000000000000 --- a/packages/kbn-config-schema/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-config-schema" -PKG_REQUIRE_NAME = "@kbn/config-schema" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//joi", - "@npm//lodash", - "@npm//moment", - "@npm//tsd", - "@npm//type-detect", -] - -TYPES_DEPS = [ - "@npm//moment", - "@npm//tsd", - "@npm//@types/jest", - "@npm//joi", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/type-detect", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-config-schema/kibana.jsonc b/packages/kbn-config-schema/kibana.jsonc index c88955570867..9c936a1e3fa7 100644 --- a/packages/kbn-config-schema/kibana.jsonc +++ b/packages/kbn-config-schema/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/config-schema", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 4b58a5c55965..ee30ae58be3c 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -1,9 +1,7 @@ { "name": "@kbn/config-schema", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "author": "Kibana Core", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-config-schema/tsconfig.json b/packages/kbn-config-schema/tsconfig.json index 569d575c72bc..ffb5b09f8699 100644 --- a/packages/kbn-config-schema/tsconfig.json +++ b/packages/kbn-config-schema/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": true, "types": [ "jest", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel deleted file mode 100644 index 69436dbcb4f6..000000000000 --- a/packages/kbn-config/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-config" -PKG_REQUIRE_NAME = "@kbn/config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-safer-lodash-set", - "//packages/kbn-config-schema", - "//packages/kbn-logging", - "//packages/kbn-logging-mocks", - "//packages/kbn-std", - "//packages/kbn-utility-types", - "//packages/kbn-i18n", - "//packages/kbn-plugin-discovery", - "//packages/kbn-doc-links", - "@npm//js-yaml", - "@npm//load-json-file", - "@npm//lodash", - "@npm//rxjs", - "@npm//type-detect", -] - -TYPES_DEPS = [ - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-plugin-discovery:npm_module_types", - "//packages/kbn-doc-links:npm_module_types", - "@npm//load-json-file", - "@npm//rxjs", - "@npm//@types/jest", - "@npm//@types/js-yaml", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/type-detect", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-config/kibana.jsonc b/packages/kbn-config/kibana.jsonc index e3bac638520b..c6b4d1dc742c 100644 --- a/packages/kbn-config/kibana.jsonc +++ b/packages/kbn-config/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/config", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-config/package.json b/packages/kbn-config/package.json index 11fabd92af29..fd26081187a8 100644 --- a/packages/kbn-config/package.json +++ b/packages/kbn-config/package.json @@ -1,9 +1,7 @@ { "name": "@kbn/config", - "main": "./target_node/index.js", "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-config/tsconfig.json b/packages/kbn-config/tsconfig.json index 57c1dd1c94e0..0b75e6b015b3 100644 --- a/packages/kbn-config/tsconfig.json +++ b/packages/kbn-config/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,19 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/safer-lodash-set", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/std", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/plugin-discovery", + "@kbn/doc-links" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-crypto-browser/BUILD.bazel b/packages/kbn-crypto-browser/BUILD.bazel deleted file mode 100644 index bf3b4e43ef36..000000000000 --- a/packages/kbn-crypto-browser/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-crypto-browser" -PKG_REQUIRE_NAME = "@kbn/crypto-browser" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-crypto-browser/kibana.jsonc b/packages/kbn-crypto-browser/kibana.jsonc index 9faf12c5f05b..7bcbc106f23a 100644 --- a/packages/kbn-crypto-browser/kibana.jsonc +++ b/packages/kbn-crypto-browser/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/crypto-browser", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-crypto-browser/package.json b/packages/kbn-crypto-browser/package.json index 98bedc14e7b0..6838d31a7a6b 100644 --- a/packages/kbn-crypto-browser/package.json +++ b/packages/kbn-crypto-browser/package.json @@ -2,8 +2,5 @@ "name": "@kbn/crypto-browser", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-crypto-browser/tsconfig.json b/packages/kbn-crypto-browser/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-crypto-browser/tsconfig.json +++ b/packages/kbn-crypto-browser/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel deleted file mode 100644 index fb3bcbcfbd06..000000000000 --- a/packages/kbn-crypto/BUILD.bazel +++ /dev/null @@ -1,113 +0,0 @@ - -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-crypto" -PKG_REQUIRE_NAME = "@kbn/crypto" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "@npm//node-forge", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "@npm//@types/flot", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/node-forge", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-crypto/kibana.jsonc b/packages/kbn-crypto/kibana.jsonc index 21f9cbbc81c7..c5f3a3e89edc 100644 --- a/packages/kbn-crypto/kibana.jsonc +++ b/packages/kbn-crypto/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/crypto", - "owner": "@elastic/kibana-security", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-security" } diff --git a/packages/kbn-crypto/package.json b/packages/kbn-crypto/package.json index 8fa6cd3c232f..f190b6edbd63 100644 --- a/packages/kbn-crypto/package.json +++ b/packages/kbn-crypto/package.json @@ -2,7 +2,5 @@ "name": "@kbn/crypto", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-crypto/tsconfig.json b/packages/kbn-crypto/tsconfig.json index f40f9a4ee1cf..9fbc68fcba64 100644 --- a/packages/kbn-crypto/tsconfig.json +++ b/packages/kbn-crypto/tsconfig.json @@ -1,13 +1,17 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" ] }, - "include": ["**/*.ts"] + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/dev-utils" + ], + "exclude": [ + "target/**/*", + ] } diff --git a/packages/kbn-cypress-config/README.md b/packages/kbn-cypress-config/README.md new file mode 100644 index 000000000000..7c1d1012d2c3 --- /dev/null +++ b/packages/kbn-cypress-config/README.md @@ -0,0 +1,3 @@ +# @kbn/cypress-config + +Empty package generated by @kbn/generate diff --git a/packages/kbn-cypress-config/index.ts b/packages/kbn-cypress-config/index.ts new file mode 100644 index 000000000000..eed0d7128811 --- /dev/null +++ b/packages/kbn-cypress-config/index.ts @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { defineConfig } from 'cypress'; +import wp from '@cypress/webpack-preprocessor'; + +export function defineCypressConfig(options?: Cypress.ConfigOptions) { + return defineConfig({ + ...options, + e2e: { + ...options?.e2e, + setupNodeEvents(on, config) { + on( + 'file:preprocessor', + wp({ + webpackOptions: { + resolve: { + extensions: ['.ts', '.tsx', '.js'], + }, + module: { + rules: [ + { + test: /\.(js|tsx?)$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader', + options: { + babelrc: false, + envName: 'development', + presets: [require.resolve('@kbn/babel-preset/webpack_preset')], + }, + }, + }, + ], + }, + }, + }) + ); + + const external = options?.e2e?.setupNodeEvents; + if (external) { + external((event: any, task: any) => { + if (event === 'file:preprocessor') { + throw new Error('file:preprocessor is defined in @kbn/cypress-config'); + } + + on(event, task); + }, config); + } + }, + }, + }); +} diff --git a/packages/kbn-type-summarizer-core/jest.config.js b/packages/kbn-cypress-config/jest.config.js similarity index 88% rename from packages/kbn-type-summarizer-core/jest.config.js rename to packages/kbn-cypress-config/jest.config.js index 1b0c70131903..80b50e63dd2c 100644 --- a/packages/kbn-type-summarizer-core/jest.config.js +++ b/packages/kbn-cypress-config/jest.config.js @@ -9,5 +9,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../..', - roots: ['/packages/kbn-type-summarizer-core'], + roots: ['/packages/kbn-cypress-config'], }; diff --git a/packages/kbn-cypress-config/kibana.jsonc b/packages/kbn-cypress-config/kibana.jsonc new file mode 100644 index 000000000000..ff6bf9e11ade --- /dev/null +++ b/packages/kbn-cypress-config/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/cypress-config", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-cypress-config/package.json b/packages/kbn-cypress-config/package.json new file mode 100644 index 000000000000..e4dd2c17427d --- /dev/null +++ b/packages/kbn-cypress-config/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/cypress-config", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-cypress-config/tsconfig.json b/packages/kbn-cypress-config/tsconfig.json new file mode 100644 index 000000000000..2f9ddddbeea2 --- /dev/null +++ b/packages/kbn-cypress-config/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/packages/kbn-datemath/BUILD.bazel b/packages/kbn-datemath/BUILD.bazel index 4e33d59d7182..cd0d792c43c9 100644 --- a/packages/kbn-datemath/BUILD.bazel +++ b/packages/kbn-datemath/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "ts_project", "pkg_npm", "pkg_npm_types") -PKG_DIRNAME = "kbn-datemath" -PKG_REQUIRE_NAME = "@kbn/datemath" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", ], @@ -24,82 +19,14 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -TYPES_DEPS = [ +BUNDLER_DEPS = [ "@npm//moment", - "@npm//@types/node", ] -RUNTIME_DEPS = TYPES_DEPS - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig" -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-datemath", + package_name = "@kbn/datemath", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-datemath/kibana.jsonc b/packages/kbn-datemath/kibana.jsonc index 85522ceb11b9..ab8ac6257044 100644 --- a/packages/kbn-datemath/kibana.jsonc +++ b/packages/kbn-datemath/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/datemath", - "owner": "@elastic/kibana-app-services", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-app-services" } diff --git a/packages/kbn-datemath/package.json b/packages/kbn-datemath/package.json index 933620644ddd..e6c119d7a1f8 100644 --- a/packages/kbn-datemath/package.json +++ b/packages/kbn-datemath/package.json @@ -3,9 +3,7 @@ "version": "5.0.4", "description": "elasticsearch datemath parser, used in kibana", "license": "Apache-2.0", - "main": "./target_node/index.js", "peerDependencies": { "moment": "^2.24.0" - }, - "types": "./target_types/index.d.ts" + } } \ No newline at end of file diff --git a/packages/kbn-datemath/tsconfig.json b/packages/kbn-datemath/tsconfig.json index b4316f3d2faa..2649fb45f0a4 100644 --- a/packages/kbn-datemath/tsconfig.json +++ b/packages/kbn-datemath/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node" ] }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-dev-cli-errors/BUILD.bazel b/packages/kbn-dev-cli-errors/BUILD.bazel deleted file mode 100644 index 07b095254a0a..000000000000 --- a/packages/kbn-dev-cli-errors/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-dev-cli-errors" -PKG_REQUIRE_NAME = "@kbn/dev-cli-errors" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-dev-cli-errors/kibana.jsonc b/packages/kbn-dev-cli-errors/kibana.jsonc index 66a63cdce307..86fb72d378b1 100644 --- a/packages/kbn-dev-cli-errors/kibana.jsonc +++ b/packages/kbn-dev-cli-errors/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/dev-cli-errors", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-dev-cli-errors/package.json b/packages/kbn-dev-cli-errors/package.json index a40c9a3bccac..da5f5ff1384d 100644 --- a/packages/kbn-dev-cli-errors/package.json +++ b/packages/kbn-dev-cli-errors/package.json @@ -2,7 +2,5 @@ "name": "@kbn/dev-cli-errors", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-dev-cli-errors/tsconfig.json b/packages/kbn-dev-cli-errors/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-dev-cli-errors/tsconfig.json +++ b/packages/kbn-dev-cli-errors/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-dev-cli-runner/BUILD.bazel b/packages/kbn-dev-cli-runner/BUILD.bazel deleted file mode 100644 index 65036f707097..000000000000 --- a/packages/kbn-dev-cli-runner/BUILD.bazel +++ /dev/null @@ -1,145 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-dev-cli-runner" -PKG_REQUIRE_NAME = "@kbn/dev-cli-runner" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//chalk", - "@npm//dedent", - "@npm//execa", - "@npm//exit-hook", - "@npm//getopts", - "@npm//normalize-path", - "//packages/kbn-dev-cli-errors", - "//packages/kbn-ci-stats-reporter", - "//packages/kbn-dev-proc-runner", - "//packages/kbn-tooling-log", - "//packages/kbn-utils", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/dedent", - "@npm//@types/normalize-path", - "@npm//chalk", - "@npm//execa", - "@npm//exit-hook", - "@npm//getopts", - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-ci-stats-reporter:npm_module_types", - "//packages/kbn-dev-proc-runner:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-dev-cli-runner/kibana.jsonc b/packages/kbn-dev-cli-runner/kibana.jsonc index 43e1b39ab17f..0be99cae70fb 100644 --- a/packages/kbn-dev-cli-runner/kibana.jsonc +++ b/packages/kbn-dev-cli-runner/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/dev-cli-runner", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-dev-cli-runner/package.json b/packages/kbn-dev-cli-runner/package.json index 94e1769933ce..1d6b6fe158e6 100644 --- a/packages/kbn-dev-cli-runner/package.json +++ b/packages/kbn-dev-cli-runner/package.json @@ -2,7 +2,5 @@ "name": "@kbn/dev-cli-runner", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-dev-cli-runner/src/metrics.ts b/packages/kbn-dev-cli-runner/src/metrics.ts index af9ee7478f63..c200a231926f 100644 --- a/packages/kbn-dev-cli-runner/src/metrics.ts +++ b/packages/kbn-dev-cli-runner/src/metrics.ts @@ -9,7 +9,7 @@ import path from 'path'; import normalizePath from 'normalize-path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { CiStatsReporter } from '@kbn/ci-stats-reporter'; import { ToolingLog } from '@kbn/tooling-log'; diff --git a/packages/kbn-dev-cli-runner/tsconfig.json b/packages/kbn-dev-cli-runner/tsconfig.json index 57c1dd1c94e0..326a02a92f2c 100644 --- a/packages/kbn-dev-cli-runner/tsconfig.json +++ b/packages/kbn-dev-cli-runner/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-errors", + "@kbn/ci-stats-reporter", + "@kbn/dev-proc-runner", + "@kbn/tooling-log", + "@kbn/jest-serializers", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-dev-proc-runner/BUILD.bazel b/packages/kbn-dev-proc-runner/BUILD.bazel deleted file mode 100644 index a2a344f41c35..000000000000 --- a/packages/kbn-dev-proc-runner/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-dev-proc-runner" -PKG_REQUIRE_NAME = "@kbn/dev-proc-runner" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//chalk", - "@npm//exit-hook", - "@npm//execa", - "@npm//rxjs", - "@npm//tree-kill", - "//packages/kbn-dev-cli-errors", - "//packages/kbn-tooling-log", - "//packages/kbn-stdio-dev-helpers", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//chalk", - "@npm//exit-hook", - "@npm//execa", - "@npm//rxjs", - "@npm//tree-kill", - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-stdio-dev-helpers:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-dev-proc-runner/kibana.jsonc b/packages/kbn-dev-proc-runner/kibana.jsonc index e028b7e7d795..8f7a5ec07166 100644 --- a/packages/kbn-dev-proc-runner/kibana.jsonc +++ b/packages/kbn-dev-proc-runner/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/dev-proc-runner", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-dev-proc-runner/package.json b/packages/kbn-dev-proc-runner/package.json index bdc3c1793cf3..9052dda12297 100644 --- a/packages/kbn-dev-proc-runner/package.json +++ b/packages/kbn-dev-proc-runner/package.json @@ -2,7 +2,5 @@ "name": "@kbn/dev-proc-runner", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-dev-proc-runner/tsconfig.json b/packages/kbn-dev-proc-runner/tsconfig.json index 57c1dd1c94e0..06d628ebfe73 100644 --- a/packages/kbn-dev-proc-runner/tsconfig.json +++ b/packages/kbn-dev-proc-runner/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-errors", + "@kbn/tooling-log", + "@kbn/stdio-dev-helpers" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel deleted file mode 100644 index acdd6d9d4f55..000000000000 --- a/packages/kbn-dev-utils/BUILD.bazel +++ /dev/null @@ -1,187 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-dev-utils" -PKG_REQUIRE_NAME = "@kbn/dev-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -filegroup( - name = "certs", - srcs = glob( - [ - "certs/**/*", - ], - exclude = [ - "**/README.md" - ], - ), -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-cli-runner", - "//packages/kbn-dev-cli-errors", - "//packages/kbn-dev-proc-runner", - "//packages/kbn-std", - "//packages/kbn-utils", - "//packages/kbn-plugin-discovery", - "//packages/kbn-tooling-log", - "//packages/kbn-stdio-dev-helpers", - "//packages/kbn-ci-stats-reporter", - "//packages/kbn-jest-serializers", - "//packages/kbn-kibana-manifest-schema", - "@npm//@babel/core", - "@npm//axios", - "@npm//chalk", - "@npm//cheerio", - "@npm//dedent", - "@npm//execa", - "@npm//exit-hook", - "@npm//getopts", - "@npm//jest-diff", - "@npm//load-json-file", - "@npm//markdown-it", - "@npm//normalize-path", - "@npm//prettier", - "@npm//rxjs", - "@npm//strip-ansi", - "@npm//sort-package-json", - "@npm//tar", - "@npm//tree-kill", - "@npm//vinyl", - "@npm//yauzl", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-dev-proc-runner:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-plugin-discovery:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-stdio-dev-helpers:npm_module_types", - "//packages/kbn-ci-stats-reporter:npm_module_types", - "//packages/kbn-jest-serializers:npm_module_types", - "//packages/kbn-kibana-manifest-schema:npm_module_types", - "@npm//@babel/parser", - "@npm//@babel/types", - "@npm//@types/babel__core", - "@npm//@types/cheerio", - "@npm//@types/dedent", - "@npm//@types/flot", - "@npm//@types/jest", - "@npm//@types/markdown-it", - "@npm//@types/node", - "@npm//@types/normalize-path", - "@npm//@types/prettier", - "@npm//@types/react", - "@npm//@types/tar", - "@npm//@types/testing-library__jest-dom", - "@npm//@types/vinyl", - "@npm//@types/yauzl", - "@npm//axios", - "@npm//execa", - "@npm//exit-hook", - "@npm//getopts", - "@npm//jest-diff", - "@npm//rxjs", - "@npm//sort-package-json", - "@npm//strip-ansi", - "@npm//tree-kill", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS + [":certs"], - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-dev-utils/index.ts b/packages/kbn-dev-utils/index.ts index d13e1c1f745b..c1ee96a2a35a 100644 --- a/packages/kbn-dev-utils/index.ts +++ b/packages/kbn-dev-utils/index.ts @@ -23,6 +23,5 @@ export * from './src/axios'; export * from './src/ship_ci_stats_cli'; export * from './src/plugin_list'; export * from './src/streams'; -export * from './src/babel'; export * from './src/extract'; export * from './src/diff_strings'; diff --git a/packages/kbn-dev-utils/kibana.jsonc b/packages/kbn-dev-utils/kibana.jsonc index 7a9e4e644dcf..7cb93b0f5a1d 100644 --- a/packages/kbn-dev-utils/kibana.jsonc +++ b/packages/kbn-dev-utils/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/dev-utils", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index b7c8416c7b1a..ee5b938ed863 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -2,7 +2,5 @@ "name": "@kbn/dev-utils", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts index 5f0b623b29b1..f86d535e9291 100644 --- a/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts +++ b/packages/kbn-dev-utils/src/plugin_list/discover_plugins.ts @@ -11,7 +11,7 @@ import Fs from 'fs'; import MarkdownIt from 'markdown-it'; import cheerio from 'cheerio'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { simpleKibanaPlatformPluginDiscovery } from '@kbn/plugin-discovery'; import { extractAsciidocInfo } from './extract_asciidoc_info'; diff --git a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts index 127e2a9904a4..a0562b4ab846 100644 --- a/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts +++ b/packages/kbn-dev-utils/src/plugin_list/generate_plugin_list.ts @@ -9,7 +9,7 @@ import Path from 'path'; import normalizePath from 'normalize-path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Plugins } from './discover_plugins'; diff --git a/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts b/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts index c03658cad8e2..69bcd3389bf1 100644 --- a/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts +++ b/packages/kbn-dev-utils/src/plugin_list/run_plugin_list_cli.ts @@ -8,7 +8,7 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { discoverPlugins } from './discover_plugins'; diff --git a/packages/kbn-dev-utils/src/precommit_hook/cli.ts b/packages/kbn-dev-utils/src/precommit_hook/cli.ts index b0d6e57eee62..c3b1a62fc33f 100644 --- a/packages/kbn-dev-utils/src/precommit_hook/cli.ts +++ b/packages/kbn-dev-utils/src/precommit_hook/cli.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { chmod, writeFile } from 'fs'; import { promisify } from 'util'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-dev-utils/src/precommit_hook/git_utils.ts b/packages/kbn-dev-utils/src/precommit_hook/git_utils.ts index 6ea1b12cbf5d..ce6743ecbded 100644 --- a/packages/kbn-dev-utils/src/precommit_hook/git_utils.ts +++ b/packages/kbn-dev-utils/src/precommit_hook/git_utils.ts @@ -8,7 +8,7 @@ import execa from 'execa'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; // Retrieves the correct location for the .git dir for // every git setup (including git worktree) diff --git a/packages/kbn-dev-utils/tsconfig.json b/packages/kbn-dev-utils/tsconfig.json index 57c1dd1c94e0..a4ad2f1db3a7 100644 --- a/packages/kbn-dev-utils/tsconfig.json +++ b/packages/kbn-dev-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/plugin-discovery", + "@kbn/ci-stats-reporter", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-doc-links/BUILD.bazel b/packages/kbn-doc-links/BUILD.bazel deleted file mode 100644 index af0668f18189..000000000000 --- a/packages/kbn-doc-links/BUILD.bazel +++ /dev/null @@ -1,116 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-doc-links" -PKG_REQUIRE_NAME = "@kbn/doc-links" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "//packages/kbn-std:npm_module_types", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-doc-links/kibana.jsonc b/packages/kbn-doc-links/kibana.jsonc index a3af199f6c32..3fed0ac08449 100644 --- a/packages/kbn-doc-links/kibana.jsonc +++ b/packages/kbn-doc-links/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/doc-links", - "owner": "@elastic/kibana-docs", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-docs" } diff --git a/packages/kbn-doc-links/package.json b/packages/kbn-doc-links/package.json index f041cf1b37dd..169bc7043e26 100644 --- a/packages/kbn-doc-links/package.json +++ b/packages/kbn-doc-links/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/doc-links", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-doc-links/tsconfig.json b/packages/kbn-doc-links/tsconfig.json index 60a261148e76..df789404c43f 100644 --- a/packages/kbn-doc-links/tsconfig.json +++ b/packages/kbn-doc-links/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,4 +10,10 @@ "include": [ "**/*.ts" ], + "kbn_references": [ + "@kbn/std" + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel deleted file mode 100644 index 6add8283f964..000000000000 --- a/packages/kbn-docs-utils/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-docs-utils" -PKG_REQUIRE_NAME = "@kbn/docs-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/snapshots/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-plugin-discovery", - "//packages/kbn-dev-utils", - "//packages/kbn-utils", - "@npm//dedent", - "@npm//ts-morph", -] - -TYPES_DEPS = [ - "//packages/kbn-plugin-discovery:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "@npm//ts-morph", - "@npm//@types/dedent", - "@npm//@types/jest", - "@npm//@types/js-yaml", - "@npm//@types/node", - "@npm//globby", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-docs-utils/kibana.jsonc b/packages/kbn-docs-utils/kibana.jsonc index 5e0ea2367d53..9700d3341a77 100644 --- a/packages/kbn-docs-utils/kibana.jsonc +++ b/packages/kbn-docs-utils/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/docs-utils", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-docs-utils/package.json b/packages/kbn-docs-utils/package.json index 7f0c60985ad6..7449ac47a234 100644 --- a/packages/kbn-docs-utils/package.json +++ b/packages/kbn-docs-utils/package.json @@ -2,7 +2,5 @@ "name": "@kbn/docs-utils", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": "true", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" + "private": "true" } \ No newline at end of file diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.test.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.test.ts index 04a5101360a9..22d4d021198c 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/extract_import_refs.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; import { getPluginApiDocId } from '../utils'; import { extractImportReferences } from './extract_import_refs'; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts index 76328a314b06..eca5f4598bfb 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ParameterDeclaration, ClassMemberTypes, Node } from 'ts-morph'; import { BuildApiDecOpts } from './types'; import { isNamedNode } from '../tsmorph_utils'; diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts index 97a94c469b0a..e76fffe77ad2 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts @@ -13,7 +13,7 @@ import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; import { CiStatsReporter } from '@kbn/ci-stats-reporter'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Project } from 'ts-morph'; import { writePluginDocs } from './mdx/write_plugin_mdx_docs'; diff --git a/packages/kbn-docs-utils/src/api_docs/find_plugins.ts b/packages/kbn-docs-utils/src/api_docs/find_plugins.ts index 6ba699d1466d..a6f0a75cfe7a 100644 --- a/packages/kbn-docs-utils/src/api_docs/find_plugins.ts +++ b/packages/kbn-docs-utils/src/api_docs/find_plugins.ts @@ -12,7 +12,7 @@ import globby from 'globby'; import loadJsonFile from 'load-json-file'; import { getPluginSearchPaths, simpleKibanaPlatformPluginDiscovery } from '@kbn/plugin-discovery'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ApiScope, PluginOrPackage } from './types'; export function findPlugins(): PluginOrPackage[] { diff --git a/packages/kbn-docs-utils/src/api_docs/trim_deleted_docs_from_nav.ts b/packages/kbn-docs-utils/src/api_docs/trim_deleted_docs_from_nav.ts index 2aa7dbf58f6f..c6d9edbd483a 100644 --- a/packages/kbn-docs-utils/src/api_docs/trim_deleted_docs_from_nav.ts +++ b/packages/kbn-docs-utils/src/api_docs/trim_deleted_docs_from_nav.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fsp from 'fs/promises'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; import { getAllDocFileIds } from './mdx/get_all_doc_file_ids'; diff --git a/packages/kbn-docs-utils/tsconfig.json b/packages/kbn-docs-utils/tsconfig.json index 884ead81c781..8d8d715372cd 100644 --- a/packages/kbn-docs-utils/tsconfig.json +++ b/packages/kbn-docs-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -13,6 +11,16 @@ "**/*.ts", ], "exclude": [ - "**/__fixtures__/**" + "**/__fixtures__/**", + "target/**/*", + ], + "kbn_references": [ + "@kbn/plugin-discovery", + "@kbn/tooling-log", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/ci-stats-reporter", + "@kbn/repo-info", + "@kbn/std", ] } diff --git a/packages/kbn-ebt-tools/BUILD.bazel b/packages/kbn-ebt-tools/BUILD.bazel deleted file mode 100644 index 07908d50346e..000000000000 --- a/packages/kbn-ebt-tools/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ebt-tools" -PKG_REQUIRE_NAME = "@kbn/ebt-tools" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [] - -TYPES_DEPS = [ - "//packages/analytics/client:npm_module_types", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ebt-tools/kibana.jsonc b/packages/kbn-ebt-tools/kibana.jsonc index f9fde6d48f04..8c063d20246e 100644 --- a/packages/kbn-ebt-tools/kibana.jsonc +++ b/packages/kbn-ebt-tools/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ebt-tools", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-ebt-tools/package.json b/packages/kbn-ebt-tools/package.json index c3c73a542d01..39d718e0783b 100644 --- a/packages/kbn-ebt-tools/package.json +++ b/packages/kbn-ebt-tools/package.json @@ -2,8 +2,5 @@ "name": "@kbn/ebt-tools", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-ebt-tools/tsconfig.json b/packages/kbn-ebt-tools/tsconfig.json index 57c1dd1c94e0..278801bc74c5 100644 --- a/packages/kbn-ebt-tools/tsconfig.json +++ b/packages/kbn-ebt-tools/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/analytics-client", + "@kbn/logging-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ecs/BUILD.bazel b/packages/kbn-ecs/BUILD.bazel deleted file mode 100644 index c6701f62915c..000000000000 --- a/packages/kbn-ecs/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ecs" -PKG_REQUIRE_NAME = "@kbn/ecs" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ecs/kibana.jsonc b/packages/kbn-ecs/kibana.jsonc index 34d275e79c10..380147ef4b20 100644 --- a/packages/kbn-ecs/kibana.jsonc +++ b/packages/kbn-ecs/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ecs", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-ecs/package.json b/packages/kbn-ecs/package.json index 9a00ecaa5c17..6b925c18388a 100644 --- a/packages/kbn-ecs/package.json +++ b/packages/kbn-ecs/package.json @@ -3,7 +3,5 @@ "version": "1.0.0", "private": true, "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-ecs/tsconfig.json b/packages/kbn-ecs/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-ecs/tsconfig.json +++ b/packages/kbn-ecs/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel deleted file mode 100644 index 835821233144..000000000000 --- a/packages/kbn-es-archiver/BUILD.bazel +++ /dev/null @@ -1,128 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-es-archiver" -PKG_REQUIRE_NAME = "@kbn/es-archiver" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__", - "**/__mocks__", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-test", - "//packages/kbn-utils", - "@npm//@elastic/elasticsearch", - "@npm//aggregate-error", - "@npm//chance", - "@npm//globby", - "@npm//json-stable-stringify", - "@npm//lodash", - "@npm//sinon", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-test:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//aggregate-error", - "@npm//globby", - "@npm//@types/chance", - "@npm//@types/jest", - "@npm//@types/json-stable-stringify", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/sinon", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-es-archiver/kibana.jsonc b/packages/kbn-es-archiver/kibana.jsonc index cc2b4530ea55..d8cc353c5635 100644 --- a/packages/kbn-es-archiver/kibana.jsonc +++ b/packages/kbn-es-archiver/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/es-archiver", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-es-archiver/package.json b/packages/kbn-es-archiver/package.json index 5fd04d0f1b69..13346ad4f834 100644 --- a/packages/kbn-es-archiver/package.json +++ b/packages/kbn-es-archiver/package.json @@ -2,7 +2,5 @@ "name": "@kbn/es-archiver", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": "true", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" -} + "private": "true" +} \ No newline at end of file diff --git a/packages/kbn-es-archiver/src/actions/load.ts b/packages/kbn-es-archiver/src/actions/load.ts index 82462a942152..b6a4c46d4274 100644 --- a/packages/kbn-es-archiver/src/actions/load.ts +++ b/packages/kbn-es-archiver/src/actions/load.ts @@ -10,8 +10,8 @@ import { resolve, relative } from 'path'; import { createReadStream } from 'fs'; import { Readable } from 'stream'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; -import { KbnClient } from '@kbn/test'; +import { REPO_ROOT } from '@kbn/repo-info'; +import type { KbnClient } from '@kbn/test'; import type { Client } from '@elastic/elasticsearch'; import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils'; import { ES_CLIENT_HEADERS } from '../client_headers'; diff --git a/packages/kbn-es-archiver/src/actions/rebuild_all.ts b/packages/kbn-es-archiver/src/actions/rebuild_all.ts index 74062125fd79..ac5b75336c61 100644 --- a/packages/kbn-es-archiver/src/actions/rebuild_all.ts +++ b/packages/kbn-es-archiver/src/actions/rebuild_all.ts @@ -11,7 +11,8 @@ import { Stats, createReadStream, createWriteStream } from 'fs'; import { stat, rename } from 'fs/promises'; import { Readable, Writable } from 'stream'; import { ToolingLog } from '@kbn/tooling-log'; -import { createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; +import { createPromiseFromStreams } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { prioritizeMappings, readDirectory, diff --git a/packages/kbn-es-archiver/src/actions/save.ts b/packages/kbn-es-archiver/src/actions/save.ts index 9fcbe45946eb..b0a7c8153eeb 100644 --- a/packages/kbn-es-archiver/src/actions/save.ts +++ b/packages/kbn-es-archiver/src/actions/save.ts @@ -11,7 +11,8 @@ import { createWriteStream, mkdirSync } from 'fs'; import { Readable, Writable } from 'stream'; import type { Client } from '@elastic/elasticsearch'; import { ToolingLog } from '@kbn/tooling-log'; -import { createListStream, createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; +import { createListStream, createPromiseFromStreams } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createStats, diff --git a/packages/kbn-es-archiver/src/actions/unload.ts b/packages/kbn-es-archiver/src/actions/unload.ts index e564bcbb1a70..f8e3118a9a04 100644 --- a/packages/kbn-es-archiver/src/actions/unload.ts +++ b/packages/kbn-es-archiver/src/actions/unload.ts @@ -11,8 +11,9 @@ import { createReadStream } from 'fs'; import { Readable, Writable } from 'stream'; import type { Client } from '@elastic/elasticsearch'; import { ToolingLog } from '@kbn/tooling-log'; -import { KbnClient } from '@kbn/test'; -import { createPromiseFromStreams, REPO_ROOT } from '@kbn/utils'; +import type { KbnClient } from '@kbn/test'; +import { createPromiseFromStreams } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { isGzip, diff --git a/packages/kbn-es-archiver/src/es_archiver.ts b/packages/kbn-es-archiver/src/es_archiver.ts index 0a9937ca3d9b..65de41148d8d 100644 --- a/packages/kbn-es-archiver/src/es_archiver.ts +++ b/packages/kbn-es-archiver/src/es_archiver.ts @@ -11,7 +11,7 @@ import Path from 'path'; import type { Client } from '@elastic/elasticsearch'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { KbnClient } from '@kbn/test'; import { diff --git a/packages/kbn-es-archiver/src/lib/archives/parse.test.ts b/packages/kbn-es-archiver/src/lib/archives/parse.test.ts index ae8fc7216ba2..40ac21d666a9 100644 --- a/packages/kbn-es-archiver/src/lib/archives/parse.test.ts +++ b/packages/kbn-es-archiver/src/lib/archives/parse.test.ts @@ -9,12 +9,8 @@ import Stream, { PassThrough, Readable, Writable, Transform } from 'stream'; import { createGzip } from 'zlib'; -import { - createConcatStream, - createListStream, - createPromiseFromStreams, - kibanaPackageJson, -} from '@kbn/utils'; +import { createConcatStream, createListStream, createPromiseFromStreams } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { createParseArchiveStreams } from './parse'; diff --git a/packages/kbn-es-archiver/src/lib/archives/parse.ts b/packages/kbn-es-archiver/src/lib/archives/parse.ts index a2657fbd661a..d84846f3503d 100644 --- a/packages/kbn-es-archiver/src/lib/archives/parse.ts +++ b/packages/kbn-es-archiver/src/lib/archives/parse.ts @@ -13,8 +13,8 @@ import { createSplitStream, createReplaceStream, createMapStream, - kibanaPackageJson, } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { RECORD_SEPARATOR } from './constants'; diff --git a/packages/kbn-es-archiver/tsconfig.json b/packages/kbn-es-archiver/tsconfig.json index 57c1dd1c94e0..0301480548fc 100644 --- a/packages/kbn-es-archiver/tsconfig.json +++ b/packages/kbn-es-archiver/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-utils", + "@kbn/test", + "@kbn/tooling-log", + "@kbn/utils", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/repo-info", + "@kbn/jest-serializers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-es-errors/BUILD.bazel b/packages/kbn-es-errors/BUILD.bazel deleted file mode 100644 index 0da72c1c1310..000000000000 --- a/packages/kbn-es-errors/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-es-errors" -PKG_REQUIRE_NAME = "@kbn/es-errors" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//@elastic/elasticsearch" -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/elasticsearch" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-es-errors/kibana.jsonc b/packages/kbn-es-errors/kibana.jsonc index 3a121caaf95c..aacc61f02c28 100644 --- a/packages/kbn-es-errors/kibana.jsonc +++ b/packages/kbn-es-errors/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/es-errors", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-es-errors/package.json b/packages/kbn-es-errors/package.json index 91cd12e91b80..cb1314e45e6b 100644 --- a/packages/kbn-es-errors/package.json +++ b/packages/kbn-es-errors/package.json @@ -2,8 +2,6 @@ "name": "@kbn/es-errors", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-es-errors/tsconfig.json b/packages/kbn-es-errors/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-es-errors/tsconfig.json +++ b/packages/kbn-es-errors/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index 95e7dcdcbe3c..8d064f3e1262 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-es-query" -PKG_REQUIRE_NAME = "@kbn/es-query" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", "**/grammar.peggy.config.json", @@ -28,20 +23,7 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-utility-types", +BUNDLER_DEPS = [ "//packages/kbn-i18n", "@npm//@elastic/elasticsearch", "@npm//load-json-file", @@ -49,90 +31,10 @@ RUNTIME_DEPS = [ "@npm//moment-timezone", ] -TYPES_DEPS = [ - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ambient-common-types:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//moment-timezone", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-es-query", + package_name = "@kbn/es-query", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-es-query/kibana.jsonc b/packages/kbn-es-query/kibana.jsonc index 2bd959eec53e..727aad02554f 100644 --- a/packages/kbn-es-query/kibana.jsonc +++ b/packages/kbn-es-query/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/es-query", - "owner": "@elastic/kibana-app-services", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-app-services" } diff --git a/packages/kbn-es-query/package.json b/packages/kbn-es-query/package.json index 026ceae873e3..7894764af2d8 100644 --- a/packages/kbn-es-query/package.json +++ b/packages/kbn-es-query/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/es-query", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-es-query/src/filters/helpers/compare_filters.test.ts b/packages/kbn-es-query/src/filters/helpers/compare_filters.test.ts index a7328758ec42..fb715039a518 100644 --- a/packages/kbn-es-query/src/filters/helpers/compare_filters.test.ts +++ b/packages/kbn-es-query/src/filters/helpers/compare_filters.test.ts @@ -14,7 +14,7 @@ import { buildQueryFilter, FilterStateStore, } from '..'; -import { DataViewBase } from '@kbn/es-query'; +import { DataViewBase } from '../../..'; describe('filter manager utilities', () => { describe('compare filters', () => { diff --git a/packages/kbn-es-query/src/kuery/grammar/__mocks__/index.ts b/packages/kbn-es-query/src/kuery/grammar/__mocks__/index.ts index 9103c852c484..c8466fead14a 100644 --- a/packages/kbn-es-query/src/kuery/grammar/__mocks__/index.ts +++ b/packages/kbn-es-query/src/kuery/grammar/__mocks__/index.ts @@ -5,5 +5,5 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -// @ts-expect-error + export { parse } from './grammar'; diff --git a/packages/kbn-es-query/tsconfig.json b/packages/kbn-es-query/tsconfig.json index 8561f4bdc4a3..07000887f13f 100644 --- a/packages/kbn-es-query/tsconfig.json +++ b/packages/kbn-es-query/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts", + "**/*.js", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-es-types/BUILD.bazel b/packages/kbn-es-types/BUILD.bazel deleted file mode 100644 index 77db3b126b12..000000000000 --- a/packages/kbn-es-types/BUILD.bazel +++ /dev/null @@ -1,105 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-es-types" -PKG_REQUIRE_NAME = "@kbn/es-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//utility-types", - "@npm//@elastic/elasticsearch", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-es-types/kibana.jsonc b/packages/kbn-es-types/kibana.jsonc index 18af5562c4ee..1c00cab81d2c 100644 --- a/packages/kbn-es-types/kibana.jsonc +++ b/packages/kbn-es-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/es-types", - "owner": ["@elastic/kibana-core", "@elastic/apm-ui"], - "runtimeDeps": [], - "typeDeps": [], + "owner": ["@elastic/kibana-core", "@elastic/apm-ui"] } diff --git a/packages/kbn-es-types/package.json b/packages/kbn-es-types/package.json index 1e5c96097567..b8cae07fc5ab 100644 --- a/packages/kbn-es-types/package.json +++ b/packages/kbn-es-types/package.json @@ -2,8 +2,6 @@ "name": "@kbn/es-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-es-types/tsconfig.json b/packages/kbn-es-types/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-es-types/tsconfig.json +++ b/packages/kbn-es-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-es/BUILD.bazel b/packages/kbn-es/BUILD.bazel deleted file mode 100644 index 2aeaee4071d5..000000000000 --- a/packages/kbn-es/BUILD.bazel +++ /dev/null @@ -1,78 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm") - -PKG_DIRNAME = "kbn-es" -PKG_REQUIRE_NAME = "@kbn/es" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.js", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//@elastic/elasticsearch", - "@npm//abort-controller", - "@npm//chalk", - "@npm//dedent", - "@npm//del", - "@npm//execa", - "@npm//getopts", - "@npm//globby", - "@npm//node-fetch", - "@npm//simple-git", - "@npm//tree-kill", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-es/index.ts b/packages/kbn-es/index.ts index 7ec9f4482ea5..aed2ab7af41c 100644 --- a/packages/kbn-es/index.ts +++ b/packages/kbn-es/index.ts @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -// @ts-expect-error not typed yet export { run } from './src/cli'; -// @ts-expect-error not typed yet export { Cluster } from './src/cluster'; export { SYSTEM_INDICES_SUPERUSER } from './src/utils'; diff --git a/packages/kbn-es/kibana.jsonc b/packages/kbn-es/kibana.jsonc index 6407107c3639..d575c727ef33 100644 --- a/packages/kbn-es/kibana.jsonc +++ b/packages/kbn-es/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/es", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-es/package.json b/packages/kbn-es/package.json index 38c138d68836..f3f33cf5e1ff 100644 --- a/packages/kbn-es/package.json +++ b/packages/kbn-es/package.json @@ -1,6 +1,5 @@ { "name": "@kbn/es", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "private": true diff --git a/packages/kbn-es/src/cli.js b/packages/kbn-es/src/cli.ts similarity index 74% rename from packages/kbn-es/src/cli.js rename to packages/kbn-es/src/cli.ts index a57b99ce9ca1..d58a485f45f6 100644 --- a/packages/kbn-es/src/cli.js +++ b/packages/kbn-es/src/cli.ts @@ -6,18 +6,20 @@ * Side Public License, v 1. */ -const chalk = require('chalk'); -const getopts = require('getopts'); -const dedent = require('dedent'); -const commands = require('./cli_commands'); -const { isCliError } = require('./errors'); -const { log } = require('./utils'); +import chalk from 'chalk'; +import getopts from 'getopts'; +import dedent from 'dedent'; +import { commands } from './cli_commands'; +import { isCliError } from './errors'; +import { log } from './utils'; + +const isCmdName = (string: any): string is keyof typeof commands => Object.hasOwn(commands, string); +const commandNames = Object.keys(commands).filter(isCmdName); function help() { - const availableCommands = Object.keys(commands).map( - (name) => `${name} - ${commands[name].description}` - ); + const availableCommands = commandNames.map((name) => `${name} - ${commands[name].description}`); + // eslint-disable-next-line no-console console.log(dedent` usage: es [] @@ -33,7 +35,7 @@ function help() { `); } -exports.run = async (defaults = {}) => { +export async function run(defaults = {}) { try { const argv = process.argv.slice(2); const options = getopts(argv, { @@ -51,13 +53,12 @@ exports.run = async (defaults = {}) => { return; } - const command = commands[commandName]; - - if (command === undefined) { + if (!isCmdName(commandName)) { log.error(chalk.red(`[${commandName}] is not a valid command, see 'es --help'`)); process.exitCode = 1; return; } + const command = commands[commandName]; if (commandName && options.help) { log.write(dedent` @@ -83,4 +84,4 @@ exports.run = async (defaults = {}) => { process.exitCode = 1; } -}; +} diff --git a/packages/kbn-es/src/cli_commands/archive.js b/packages/kbn-es/src/cli_commands/archive.js deleted file mode 100644 index 96ffc1fec34c..000000000000 --- a/packages/kbn-es/src/cli_commands/archive.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const dedent = require('dedent'); -const getopts = require('getopts'); -const { Cluster } = require('../cluster'); -const { createCliError } = require('../errors'); -const { parseTimeoutToMs } = require('../utils'); - -exports.description = 'Install and run from an Elasticsearch tar'; - -exports.usage = 'es archive []'; - -exports.help = (defaults = {}) => { - const { password = 'changeme', 'base-path': basePath } = defaults; - - return dedent` - Options: - - --base-path Path containing cache/installations [default: ${basePath}] - --install-path Installation path, defaults to 'source' within base-path - --password Sets password for elastic user [default: ${password}] - --password.[user] Sets password for native realm user [default: ${password}] - --ssl Sets up SSL on Elasticsearch - -E Additional key=value settings to pass to Elasticsearch - --skip-ready-check Disable the ready check, - --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m - - Example: - - es archive ../elasticsearch.tar.gz -E cluster.name=test -E path.data=/tmp/es-data - `; -}; - -exports.run = async (defaults = {}) => { - const argv = process.argv.slice(2); - const options = getopts(argv, { - alias: { - basePath: 'base-path', - installPath: 'install-path', - esArgs: 'E', - skipReadyCheck: 'skip-ready-check', - readyTimeout: 'ready-timeout', - }, - - string: ['ready-timeout'], - boolean: ['skip-ready-check'], - - default: defaults, - }); - - const cluster = new Cluster({ ssl: options.ssl }); - const [, path] = options._; - - if (!path || !path.endsWith('tar.gz')) { - throw createCliError('you must provide a path to an ES tar file'); - } - - const { installPath } = await cluster.installArchive(path, options); - await cluster.run(installPath, { - ...options, - readyTimeout: parseTimeoutToMs(options.readyTimeout), - }); -}; diff --git a/packages/kbn-es/src/cli_commands/archive.ts b/packages/kbn-es/src/cli_commands/archive.ts new file mode 100644 index 000000000000..af697975c59e --- /dev/null +++ b/packages/kbn-es/src/cli_commands/archive.ts @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; +import getopts from 'getopts'; +import { Cluster } from '../cluster'; +import { createCliError } from '../errors'; +import { parseTimeoutToMs } from '../utils'; + +export const archive = { + description: 'Install and run from an Elasticsearch tar', + usage: 'es archive []', + help: (defaults: Record = {}) => { + const { password = 'changeme', 'base-path': basePath } = defaults; + + return dedent` + Options: + + --base-path Path containing cache/installations [default: ${basePath}] + --install-path Installation path, defaults to 'source' within base-path + --password Sets password for elastic user [default: ${password}] + --password.[user] Sets password for native realm user [default: ${password}] + --ssl Sets up SSL on Elasticsearch + -E Additional key=value settings to pass to Elasticsearch + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m + + Example: + + es archive ../elasticsearch.tar.gz -E cluster.name=test -E path.data=/tmp/es-data + `; + }, + run: async (defaults = {}) => { + const argv = process.argv.slice(2); + const options = getopts(argv, { + alias: { + basePath: 'base-path', + installPath: 'install-path', + esArgs: 'E', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', + }, + + string: ['ready-timeout'], + boolean: ['skip-ready-check'], + + default: defaults, + }); + + const cluster = new Cluster({ ssl: options.ssl }); + const [, path] = options._; + + if (!path || !path.endsWith('tar.gz')) { + throw createCliError('you must provide a path to an ES tar file'); + } + + const { installPath } = await cluster.installArchive(path, options); + await cluster.run(installPath, { + ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), + }); + }, +}; diff --git a/packages/kbn-es/src/cli_commands/build_snapshots.js b/packages/kbn-es/src/cli_commands/build_snapshots.js deleted file mode 100644 index b4a15a0645cc..000000000000 --- a/packages/kbn-es/src/cli_commands/build_snapshots.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const dedent = require('dedent'); -const { resolve, basename } = require('path'); -const { createHash } = require('crypto'); -const { promisify } = require('util'); -const { pipeline, Transform } = require('stream'); -const Fs = require('fs'); - -const getopts = require('getopts'); -const del = require('del'); - -const { buildSnapshot, log } = require('../utils'); - -const pipelineAsync = promisify(pipeline); - -exports.description = 'Build and collect ES snapshots'; - -exports.help = () => dedent` - Options: - - --output Path to create the built elasticsearch snapshots - --source-path Path where the elasticsearch repository is checked out - - Example: - - es build_snapshots --source-path=/path/to/es/checked/repo --output=/tmp/es-built-snapshots - `; - -exports.run = async (defaults = {}) => { - const argv = process.argv.slice(2); - const options = getopts(argv, { - alias: { - sourcePath: 'source-path', - }, - default: { - ...defaults, - output: 'es_snapshots', - }, - }); - - const outputDir = resolve(process.cwd(), options.output); - del.sync(outputDir); - Fs.mkdirSync(outputDir, { recursive: true }); - - for (const license of ['oss', 'trial']) { - for (const platform of ['darwin', 'win32', 'linux']) { - log.info('Building', platform, license === 'trial' ? 'default' : 'oss', 'snapshot'); - await log.indent(4, async () => { - const snapshotPath = await buildSnapshot({ - license, - sourcePath: options.sourcePath, - log, - platform, - }); - - const filename = basename(snapshotPath); - const outputPath = resolve(outputDir, filename); - const hash = createHash('sha512'); - await pipelineAsync( - Fs.createReadStream(snapshotPath), - new Transform({ - transform(chunk, _, cb) { - hash.update(chunk); - cb(undefined, chunk); - }, - }), - Fs.createWriteStream(outputPath) - ); - - Fs.writeFileSync(`${outputPath}.sha512`, `${hash.digest('hex')} ${filename}`); - log.success('snapshot and shasum written to', outputPath); - }); - } - } -}; diff --git a/packages/kbn-es/src/cli_commands/build_snapshots.ts b/packages/kbn-es/src/cli_commands/build_snapshots.ts new file mode 100644 index 000000000000..cc730418af33 --- /dev/null +++ b/packages/kbn-es/src/cli_commands/build_snapshots.ts @@ -0,0 +1,83 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; +import { resolve, basename } from 'path'; +import { createHash } from 'crypto'; +import { promisify } from 'util'; +import { pipeline, Transform } from 'stream'; +import Fs from 'fs'; + +import getopts from 'getopts'; +import del from 'del'; + +import { buildSnapshot, log } from '../utils'; +import { Command } from './types'; + +const pipelineAsync = promisify(pipeline); + +export const buildSnapshots: Command = { + description: 'Build and collect ES snapshots', + help: () => dedent` + Options: + + --output Path to create the built elasticsearch snapshots + --source-path Path where the elasticsearch repository is checked out + + Example: + + es build_snapshots --source-path=/path/to/es/checked/repo --output=/tmp/es-built-snapshots + `, + run: async (defaults = {}) => { + const argv = process.argv.slice(2); + const options = getopts(argv, { + alias: { + sourcePath: 'source-path', + }, + default: { + ...defaults, + output: 'es_snapshots', + }, + }); + + const outputDir = resolve(process.cwd(), options.output); + del.sync(outputDir); + Fs.mkdirSync(outputDir, { recursive: true }); + + for (const license of ['oss', 'trial']) { + for (const platform of ['darwin', 'win32', 'linux']) { + log.info('Building', platform, license === 'trial' ? 'default' : 'oss', 'snapshot'); + await log.indent(4, async () => { + const snapshotPath = await buildSnapshot({ + license, + sourcePath: options.sourcePath, + log, + platform, + }); + + const filename = basename(snapshotPath); + const outputPath = resolve(outputDir, filename); + const hash = createHash('sha512'); + await pipelineAsync( + Fs.createReadStream(snapshotPath), + new Transform({ + transform(chunk, _, cb) { + hash.update(chunk); + cb(undefined, chunk); + }, + }), + Fs.createWriteStream(outputPath) + ); + + Fs.writeFileSync(`${outputPath}.sha512`, `${hash.digest('hex')} ${filename}`); + log.success('snapshot and shasum written to', outputPath); + }); + } + } + }, +}; diff --git a/packages/kbn-es/src/cli_commands/index.ts b/packages/kbn-es/src/cli_commands/index.ts new file mode 100644 index 000000000000..f83829476563 --- /dev/null +++ b/packages/kbn-es/src/cli_commands/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { snapshot } from './snapshot'; +import { source } from './source'; +import { archive } from './archive'; +import { buildSnapshots } from './build_snapshots'; + +export const commands = { + snapshot, + source, + archive, + build_snapshots: buildSnapshots, +}; diff --git a/packages/kbn-es/src/cli_commands/snapshot.js b/packages/kbn-es/src/cli_commands/snapshot.js deleted file mode 100644 index c0256fafbae7..000000000000 --- a/packages/kbn-es/src/cli_commands/snapshot.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const dedent = require('dedent'); -const getopts = require('getopts'); -import { ToolingLog } from '@kbn/tooling-log'; -import { getTimeReporter } from '@kbn/ci-stats-reporter'; -const { Cluster } = require('../cluster'); -const { parseTimeoutToMs } = require('../utils'); - -exports.description = 'Downloads and run from a nightly snapshot'; - -exports.help = (defaults = {}) => { - const { license = 'basic', password = 'changeme', 'base-path': basePath } = defaults; - - return dedent` - Options: - - --license Run with a 'oss', 'basic', or 'trial' license [default: ${license}] - --version Version of ES to download [default: ${defaults.version}] - --base-path Path containing cache/installations [default: ${basePath}] - --install-path Installation path, defaults to 'source' within base-path - --data-archive Path to zip or tarball containing an ES data directory to seed the cluster with. - --password Sets password for elastic user [default: ${password}] - --password.[user] Sets password for native realm user [default: ${password}] - -E Additional key=value settings to pass to Elasticsearch - --download-only Download the snapshot but don't actually start it - --ssl Sets up SSL on Elasticsearch - --use-cached Skips cache verification and use cached ES snapshot. - --skip-ready-check Disable the ready check, - --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m - --plugins Comma seperated list of Elasticsearch plugins to install - --secure-files Comma seperated list of secure_setting_name=/path pairs - - Example: - - es snapshot --version 5.6.8 -E cluster.name=test -E path.data=/tmp/es-data - `; -}; - -exports.run = async (defaults = {}) => { - const runStartTime = Date.now(); - const log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); - const reportTime = getTimeReporter(log, 'scripts/es snapshot'); - - const argv = process.argv.slice(2); - const options = getopts(argv, { - alias: { - basePath: 'base-path', - installPath: 'install-path', - dataArchive: 'data-archive', - esArgs: 'E', - useCached: 'use-cached', - skipReadyCheck: 'skip-ready-check', - readyTimeout: 'ready-timeout', - secureFiles: 'secure-files', - }, - - string: ['version', 'ready-timeout'], - boolean: ['download-only', 'use-cached', 'skip-ready-check'], - - default: defaults, - }); - - const cluster = new Cluster({ ssl: options.ssl }); - if (options['download-only']) { - await cluster.downloadSnapshot(options); - } else { - const installStartTime = Date.now(); - const { installPath } = await cluster.installSnapshot(options); - - if (options.dataArchive) { - await cluster.extractDataDirectory(installPath, options.dataArchive); - } - if (options.plugins) { - await cluster.installPlugins(installPath, options.plugins, options); - } - if (options.secureFiles) { - const pairs = options.secureFiles.split(',').map((kv) => kv.split('=').map((v) => v.trim())); - await cluster.configureKeystoreWithSecureSettingsFiles(installPath, pairs); - } - - reportTime(installStartTime, 'installed', { - success: true, - ...options, - }); - - await cluster.run(installPath, { - reportTime, - startTime: runStartTime, - ...options, - readyTimeout: parseTimeoutToMs(options.readyTimeout), - }); - } -}; diff --git a/packages/kbn-es/src/cli_commands/snapshot.ts b/packages/kbn-es/src/cli_commands/snapshot.ts new file mode 100644 index 000000000000..837acc3395e6 --- /dev/null +++ b/packages/kbn-es/src/cli_commands/snapshot.ts @@ -0,0 +1,107 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; +import getopts from 'getopts'; +import { ToolingLog } from '@kbn/tooling-log'; +import { getTimeReporter } from '@kbn/ci-stats-reporter'; + +import { Cluster } from '../cluster'; +import { parseTimeoutToMs } from '../utils'; +import { Command } from './types'; + +export const snapshot: Command = { + description: 'Downloads and run from a nightly snapshot', + help: (defaults = {}) => { + const { license = 'basic', password = 'changeme', 'base-path': basePath } = defaults; + + return dedent` + Options: + + --license Run with a 'oss', 'basic', or 'trial' license [default: ${license}] + --version Version of ES to download [default: ${defaults.version}] + --base-path Path containing cache/installations [default: ${basePath}] + --install-path Installation path, defaults to 'source' within base-path + --data-archive Path to zip or tarball containing an ES data directory to seed the cluster with. + --password Sets password for elastic user [default: ${password}] + --password.[user] Sets password for native realm user [default: ${password}] + -E Additional key=value settings to pass to Elasticsearch + --download-only Download the snapshot but don't actually start it + --ssl Sets up SSL on Elasticsearch + --use-cached Skips cache verification and use cached ES snapshot. + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m + --plugins Comma seperated list of Elasticsearch plugins to install + --secure-files Comma seperated list of secure_setting_name=/path pairs + + Example: + + es snapshot --version 5.6.8 -E cluster.name=test -E path.data=/tmp/es-data + `; + }, + run: async (defaults = {}) => { + const runStartTime = Date.now(); + const log = new ToolingLog({ + level: 'info', + writeTo: process.stdout, + }); + const reportTime = getTimeReporter(log, 'scripts/es snapshot'); + + const argv = process.argv.slice(2); + const options = getopts(argv, { + alias: { + basePath: 'base-path', + installPath: 'install-path', + dataArchive: 'data-archive', + esArgs: 'E', + useCached: 'use-cached', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', + secureFiles: 'secure-files', + }, + + string: ['version', 'ready-timeout'], + boolean: ['download-only', 'use-cached', 'skip-ready-check'], + + default: defaults, + }); + + const cluster = new Cluster({ ssl: options.ssl }); + if (options['download-only']) { + await cluster.downloadSnapshot(options); + } else { + const installStartTime = Date.now(); + const { installPath } = await cluster.installSnapshot(options); + + if (options.dataArchive) { + await cluster.extractDataDirectory(installPath, options.dataArchive); + } + if (options.plugins) { + await cluster.installPlugins(installPath, options.plugins, options); + } + if (typeof options.secureFiles === 'string' && options.secureFiles) { + const pairs = options.secureFiles + .split(',') + .map((kv) => kv.split('=').map((v) => v.trim())); + await cluster.configureKeystoreWithSecureSettingsFiles(installPath, pairs); + } + + reportTime(installStartTime, 'installed', { + success: true, + ...options, + }); + + await cluster.run(installPath, { + reportTime, + startTime: runStartTime, + ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), + }); + } + }, +}; diff --git a/packages/kbn-es/src/cli_commands/source.js b/packages/kbn-es/src/cli_commands/source.js deleted file mode 100644 index d1f8e02b5568..000000000000 --- a/packages/kbn-es/src/cli_commands/source.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const dedent = require('dedent'); -const getopts = require('getopts'); -const { Cluster } = require('../cluster'); -const { parseTimeoutToMs } = require('../utils'); - -exports.description = 'Build and run from source'; - -exports.help = (defaults = {}) => { - const { license = 'basic', password = 'changeme', 'base-path': basePath } = defaults; - - return dedent` - Options: - - --license Run with a 'oss', 'basic', or 'trial' license [default: ${license}] - --source-path Path to ES source [default: ${defaults['source-path']}] - --base-path Path containing cache/installations [default: ${basePath}] - --install-path Installation path, defaults to 'source' within base-path - --data-archive Path to zip or tarball containing an ES data directory to seed the cluster with. - --password Sets password for elastic user [default: ${password}] - --password.[user] Sets password for native realm user [default: ${password}] - --ssl Sets up SSL on Elasticsearch - --plugins Comma seperated list of Elasticsearch plugins to install - --secure-files Comma seperated list of secure_setting_name=/path pairs - -E Additional key=value settings to pass to Elasticsearch - --skip-ready-check Disable the ready check, - --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m - - Example: - - es snapshot --source-path=../elasticsearch -E cluster.name=test -E path.data=/tmp/es-data - `; -}; - -exports.run = async (defaults = {}) => { - const argv = process.argv.slice(2); - const options = getopts(argv, { - alias: { - basePath: 'base-path', - installPath: 'install-path', - sourcePath: 'source-path', - dataArchive: 'data-archive', - skipReadyCheck: 'skip-ready-check', - readyTimeout: 'ready-timeout', - secureFiles: 'secure-files', - esArgs: 'E', - }, - - string: ['ready-timeout'], - boolean: ['skip-ready-check'], - - default: defaults, - }); - - const cluster = new Cluster({ ssl: options.ssl }); - const { installPath } = await cluster.installSource(options); - - if (options.dataArchive) { - await cluster.extractDataDirectory(installPath, options.dataArchive); - } - if (options.plugins) { - await cluster.installPlugins(installPath, options.plugins, options); - } - if (options.secureFiles) { - const pairs = options.secureFiles.split(',').map((kv) => kv.split('=').map((v) => v.trim())); - await cluster.configureKeystoreWithSecureSettingsFiles(installPath, pairs); - } - - await cluster.run(installPath, { - ...options, - readyTimeout: parseTimeoutToMs(options.readyTimeout), - }); -}; diff --git a/packages/kbn-es/src/cli_commands/source.ts b/packages/kbn-es/src/cli_commands/source.ts new file mode 100644 index 000000000000..19bb59c057ac --- /dev/null +++ b/packages/kbn-es/src/cli_commands/source.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; +import getopts from 'getopts'; +import { Cluster } from '../cluster'; +import { parseTimeoutToMs } from '../utils'; +import { Command } from './types'; + +export const source: Command = { + description: 'Build and run from source', + help: (defaults: Record = {}) => { + const { license = 'basic', password = 'changeme', 'base-path': basePath } = defaults; + + return dedent` + Options: + + --license Run with a 'oss', 'basic', or 'trial' license [default: ${license}] + --source-path Path to ES source [default: ${defaults['source-path']}] + --base-path Path containing cache/installations [default: ${basePath}] + --install-path Installation path, defaults to 'source' within base-path + --data-archive Path to zip or tarball containing an ES data directory to seed the cluster with. + --password Sets password for elastic user [default: ${password}] + --password.[user] Sets password for native realm user [default: ${password}] + --ssl Sets up SSL on Elasticsearch + --plugins Comma seperated list of Elasticsearch plugins to install + --secure-files Comma seperated list of secure_setting_name=/path pairs + -E Additional key=value settings to pass to Elasticsearch + --skip-ready-check Disable the ready check, + --ready-timeout Customize the ready check timeout, in seconds or "Xm" format, defaults to 1m + + Example: + + es snapshot --source-path=../elasticsearch -E cluster.name=test -E path.data=/tmp/es-data + `; + }, + run: async (defaults = {}) => { + const argv = process.argv.slice(2); + const options = getopts(argv, { + alias: { + basePath: 'base-path', + installPath: 'install-path', + sourcePath: 'source-path', + dataArchive: 'data-archive', + skipReadyCheck: 'skip-ready-check', + readyTimeout: 'ready-timeout', + secureFiles: 'secure-files', + esArgs: 'E', + }, + + string: ['ready-timeout'], + boolean: ['skip-ready-check'], + + default: defaults, + }); + + const cluster = new Cluster({ ssl: options.ssl }); + const { installPath } = await cluster.installSource(options); + + if (options.dataArchive) { + await cluster.extractDataDirectory(installPath, options.dataArchive); + } + if (options.plugins) { + await cluster.installPlugins(installPath, options.plugins, options); + } + if (typeof options.secureFiles === 'string' && options.secureFiles) { + const pairs = options.secureFiles.split(',').map((kv) => kv.split('=').map((v) => v.trim())); + await cluster.configureKeystoreWithSecureSettingsFiles(installPath, pairs); + } + + await cluster.run(installPath, { + ...options, + readyTimeout: parseTimeoutToMs(options.readyTimeout), + }); + }, +}; diff --git a/packages/kbn-monaco/src/worker.d.ts b/packages/kbn-es/src/cli_commands/types.ts similarity index 66% rename from packages/kbn-monaco/src/worker.d.ts rename to packages/kbn-es/src/cli_commands/types.ts index 6544070c684d..46ee273c3738 100644 --- a/packages/kbn-monaco/src/worker.d.ts +++ b/packages/kbn-es/src/cli_commands/types.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ -declare module '!!raw-loader!*.editor.worker.js' { - const contents: string; - - // eslint-disable-next-line import/no-default-export - export default contents; +export interface Command { + description: string; + usage?: string; + help: (defaults: Record) => string; + run: (defaults: Record) => Promise; } diff --git a/packages/kbn-es/src/cluster_exec_options.ts b/packages/kbn-es/src/cluster_exec_options.ts index da21aaf05b13..f1b91bb52ff7 100644 --- a/packages/kbn-es/src/cluster_exec_options.ts +++ b/packages/kbn-es/src/cluster_exec_options.ts @@ -16,4 +16,5 @@ export interface EsClusterExecOptions { skipReadyCheck?: boolean; readyTimeout?: number; onEarlyExit?: (msg: string) => void; + writeLogsToPath?: string; } diff --git a/packages/kbn-es/src/integration_tests/cluster.test.js b/packages/kbn-es/src/integration_tests/cluster.test.js index 1a871667bd7a..9f62e0c46a01 100644 --- a/packages/kbn-es/src/integration_tests/cluster.test.js +++ b/packages/kbn-es/src/integration_tests/cluster.test.js @@ -59,6 +59,7 @@ function mockEsBin({ exitCode, start }) { jest.requireActual('execa')( process.execPath, [ + '--require=@kbn/babel-register/install', require.resolve('./__fixtures__/es_bin.js'), JSON.stringify({ exitCode, diff --git a/packages/kbn-es/src/utils/extract_config_files.js b/packages/kbn-es/src/utils/extract_config_files.ts similarity index 77% rename from packages/kbn-es/src/utils/extract_config_files.js rename to packages/kbn-es/src/utils/extract_config_files.ts index 16cd2514f7a4..ff07c77258d0 100644 --- a/packages/kbn-es/src/utils/extract_config_files.js +++ b/packages/kbn-es/src/utils/extract_config_files.ts @@ -6,20 +6,22 @@ * Side Public License, v 1. */ -const path = require('path'); -const fs = require('fs'); +import path from 'path'; +import fs from 'fs'; +import type { ToolingLog } from '@kbn/tooling-log'; /** * Copies config references to an absolute path to * the provided destination. This is necessary as ES security * requires files to be within the installation directory - * - * @param {Array} config - * @param {String} dest */ -exports.extractConfigFiles = function extractConfigFiles(config, dest, options = {}) { +export function extractConfigFiles( + config: string | string[], + dest: string, + options?: { log: ToolingLog } +) { const originalConfig = typeof config === 'string' ? [config] : config; - const localConfig = []; + const localConfig: string[] = []; originalConfig.forEach((prop) => { const [key, value] = prop.split('='); @@ -29,9 +31,7 @@ exports.extractConfigFiles = function extractConfigFiles(config, dest, options = const destPath = path.resolve(dest, 'config', filename); copyFileSync(value, destPath); - if (options.log) { - options.log.info('moved %s in config to %s', value, destPath); - } + options?.log.info('moved %s in config to %s', value, destPath); localConfig.push(`${key}=${filename}`); } else { @@ -40,13 +40,13 @@ exports.extractConfigFiles = function extractConfigFiles(config, dest, options = }); return localConfig; -}; +} function isFile(dest = '') { return path.isAbsolute(dest) && path.extname(dest).length > 0 && fs.existsSync(dest); } -function copyFileSync(src, dest) { +function copyFileSync(src: string, dest: string) { const destPath = path.dirname(dest); if (!fs.existsSync(destPath)) { diff --git a/packages/kbn-es/src/utils/index.ts b/packages/kbn-es/src/utils/index.ts index 4e75d1d81f6f..79a57846cc00 100644 --- a/packages/kbn-es/src/utils/index.ts +++ b/packages/kbn-es/src/utils/index.ts @@ -8,10 +8,8 @@ export { cache } from './cache'; export { log } from './log'; -// @ts-expect-error not typed yet export { parseEsLog } from './parse_es_log'; export { findMostRecentlyChanged } from './find_most_recently_changed'; -// @ts-expect-error not typed yet export { extractConfigFiles } from './extract_config_files'; // @ts-expect-error not typed yet export { NativeRealm, SYSTEM_INDICES_SUPERUSER } from './native_realm'; diff --git a/packages/kbn-es/src/utils/parse_es_log.js b/packages/kbn-es/src/utils/parse_es_log.ts similarity index 87% rename from packages/kbn-es/src/utils/parse_es_log.js rename to packages/kbn-es/src/utils/parse_es_log.ts index bf2c6769a07c..b5862495f647 100644 --- a/packages/kbn-es/src/utils/parse_es_log.js +++ b/packages/kbn-es/src/utils/parse_es_log.ts @@ -6,13 +6,12 @@ * Side Public License, v 1. */ -const chalk = require('chalk'); +import chalk from 'chalk'; /** - * @param {String} data - * @returns {Array} lines + * extract useful info about an es log line */ -exports.parseEsLog = function parseEsLog(data) { +export function parseEsLog(data: string) { const lines = []; const regex = /\[([0-9-T:,]+)\]\[([A-Z]+)\s?\]\[([A-Za-z0-9.]+)\s*\]\s?([\S\s]+?(?=$|\n\[))/g; let capture = regex.exec(data); @@ -40,9 +39,9 @@ exports.parseEsLog = function parseEsLog(data) { capture = regex.exec(data); } while (capture); return lines; -}; +} -function colorForLevel(level) { +function colorForLevel(level: string) { switch (level) { case 'WARN': return chalk.yellow; diff --git a/packages/kbn-es/tsconfig.json b/packages/kbn-es/tsconfig.json index a47c95fc504e..95253080f47b 100644 --- a/packages/kbn-es/tsconfig.json +++ b/packages/kbn-es/tsconfig.json @@ -1,10 +1,20 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "target_types" + "outDir": "target/types" }, "include": [ "**/*.ts", "**/*.js" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/dev-utils", + "@kbn/dev-proc-runner", + "@kbn/ci-stats-reporter", + "@kbn/jest-serializers", ] } diff --git a/packages/kbn-eslint-config/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js index f10e5f233efa..e7ae18281748 100644 --- a/packages/kbn-eslint-config/.eslintrc.js +++ b/packages/kbn-eslint-config/.eslintrc.js @@ -258,6 +258,17 @@ module.exports = { 'ProcRunner', ] }, + { + fromPackage: '@kbn/utils', + toPackage: '@kbn/repo-info', + exportNames: [ + 'REPO_ROOT', + 'UPSTREAM_BRANCH', + 'kibanaPackageJson', + 'isKibanaDistributable', + 'fromRoot', + ] + }, ]], '@kbn/disable/no_protected_eslint_disable': 'error', diff --git a/packages/kbn-eslint-config/BUILD.bazel b/packages/kbn-eslint-config/BUILD.bazel deleted file mode 100644 index 708136256498..000000000000 --- a/packages/kbn-eslint-config/BUILD.bazel +++ /dev/null @@ -1,57 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-eslint-config" -PKG_REQUIRE_NAME = "@kbn/eslint-config" - -SOURCE_FILES = glob([ - ".eslintrc.js", - "javascript.js", - "jest.js", - "react.js", - "restricted_globals.js", - "typescript.js", -]) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-babel-preset", - "//packages/kbn-dev-utils", - "//packages/kbn-eslint-plugin-disable", - "//packages/kbn-eslint-plugin-imports", - "@npm//eslint-config-prettier", - "@npm//semver", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-eslint-config/kibana.jsonc b/packages/kbn-eslint-config/kibana.jsonc index 3afe0461c486..057d11ec43db 100644 --- a/packages/kbn-eslint-config/kibana.jsonc +++ b/packages/kbn-eslint-config/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/eslint-config", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-eslint-config/react.js b/packages/kbn-eslint-config/react.js index 0b1cce15de9a..c5db0546630a 100644 --- a/packages/kbn-eslint-config/react.js +++ b/packages/kbn-eslint-config/react.js @@ -1,5 +1,5 @@ const semver = require('semver'); -const { kibanaPackageJson: PKG } = require('@kbn/utils'); +const { PKG_JSON } = require('@kbn/repo-info'); module.exports = { plugins: [ @@ -16,7 +16,7 @@ module.exports = { settings: { react: { - version: semver.valid(semver.coerce(PKG.dependencies.react)), + version: semver.valid(semver.coerce(PKG_JSON.dependencies.react)), }, }, diff --git a/packages/kbn-eslint-config/typescript.js b/packages/kbn-eslint-config/typescript.js index 76506b640746..04e847224df5 100644 --- a/packages/kbn-eslint-config/typescript.js +++ b/packages/kbn-eslint-config/typescript.js @@ -3,9 +3,6 @@ // Some IDEs could not be running eslint with the correct extensions yet // as this package was moved from typescript-eslint-parser to @typescript-eslint/parser -const semver = require('semver'); -const { kibanaPackageJson: PKG } = require('@kbn/utils'); - const eslintConfigPrettierRules = require('eslint-config-prettier').rules; // The current implementation excluded all the variables matching the regexp. diff --git a/packages/kbn-eslint-plugin-disable/BUILD.bazel b/packages/kbn-eslint-plugin-disable/BUILD.bazel deleted file mode 100644 index 9fb19d53e2c1..000000000000 --- a/packages/kbn-eslint-plugin-disable/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-eslint-plugin-disable" -PKG_REQUIRE_NAME = "@kbn/eslint-plugin-disable" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//eslint", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//tslib", - "@npm//@types/eslint", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-eslint-plugin-disable/kibana.jsonc b/packages/kbn-eslint-plugin-disable/kibana.jsonc index 43a4d8f8f90b..312829bbd628 100644 --- a/packages/kbn-eslint-plugin-disable/kibana.jsonc +++ b/packages/kbn-eslint-plugin-disable/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/eslint-plugin-disable", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-eslint-plugin-disable/package.json b/packages/kbn-eslint-plugin-disable/package.json index aab648cd1d4a..439b5959642c 100644 --- a/packages/kbn-eslint-plugin-disable/package.json +++ b/packages/kbn-eslint-plugin-disable/package.json @@ -2,7 +2,5 @@ "name": "@kbn/eslint-plugin-disable", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-eslint-plugin-disable/tsconfig.json b/packages/kbn-eslint-plugin-disable/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-eslint-plugin-disable/tsconfig.json +++ b/packages/kbn-eslint-plugin-disable/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-eslint-plugin-eslint/BUILD.bazel b/packages/kbn-eslint-plugin-eslint/BUILD.bazel deleted file mode 100644 index 0bb2ff549c9f..000000000000 --- a/packages/kbn-eslint-plugin-eslint/BUILD.bazel +++ /dev/null @@ -1,69 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-eslint-plugin-eslint" -PKG_REQUIRE_NAME = "@kbn/eslint-plugin-eslint" - -SOURCE_FILES = glob( - [ - "rules/**/*.js", - "helpers/**/*.js", - "index.js", - "lib.js", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-utils", - "@npm//@babel/eslint-parser", - "@npm//dedent", - "@npm//eslint", - "@npm//eslint-module-utils", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-eslint-plugin-eslint/helpers/exports.js b/packages/kbn-eslint-plugin-eslint/helpers/exports.js index 971364633356..ade2fb57ebad 100644 --- a/packages/kbn-eslint-plugin-eslint/helpers/exports.js +++ b/packages/kbn-eslint-plugin-eslint/helpers/exports.js @@ -9,7 +9,7 @@ const Fs = require('fs'); const Path = require('path'); const ts = require('typescript'); -const { REPO_ROOT } = require('@kbn/utils'); +const { REPO_ROOT } = require('@kbn/repo-info'); const { ExportSet } = require('./export_set'); /** @typedef {import("@typescript-eslint/types").TSESTree.ExportAllDeclaration} ExportAllDeclaration */ diff --git a/packages/kbn-eslint-plugin-eslint/kibana.jsonc b/packages/kbn-eslint-plugin-eslint/kibana.jsonc index fc9c384c4156..9ee29217efea 100644 --- a/packages/kbn-eslint-plugin-eslint/kibana.jsonc +++ b/packages/kbn-eslint-plugin-eslint/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/eslint-plugin-eslint", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-eslint-plugin-imports/BUILD.bazel b/packages/kbn-eslint-plugin-imports/BUILD.bazel deleted file mode 100644 index dab195054dda..000000000000 --- a/packages/kbn-eslint-plugin-imports/BUILD.bazel +++ /dev/null @@ -1,137 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-eslint-plugin-imports" -PKG_REQUIRE_NAME = "@kbn/eslint-plugin-imports" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-utils", - "//packages/kbn-import-resolver", - "@npm//resolve", - "@npm//@typescript-eslint/typescript-estree", - "@npm//eslint", - "@npm//normalize-path", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", # only required for the tests, which are excluded except on windows - "//packages/kbn-import-resolver:npm_module_types", - "//packages/kbn-repo-source-classifier:npm_module_types", - "@npm//dedent", # only required for the tests, which are excluded except on windows - "@npm//@types/eslint", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/normalize-path", - "@npm//@types/resolve", - "@npm//@typescript-eslint/typescript-estree", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-eslint-plugin-imports/kibana.jsonc b/packages/kbn-eslint-plugin-imports/kibana.jsonc index 658733d10535..093ab0f5b59a 100644 --- a/packages/kbn-eslint-plugin-imports/kibana.jsonc +++ b/packages/kbn-eslint-plugin-imports/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/eslint-plugin-imports", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-eslint-plugin-imports/package.json b/packages/kbn-eslint-plugin-imports/package.json index bf29c788f413..6e38ed0f036a 100644 --- a/packages/kbn-eslint-plugin-imports/package.json +++ b/packages/kbn-eslint-plugin-imports/package.json @@ -2,7 +2,5 @@ "name": "@kbn/eslint-plugin-imports", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-eslint-plugin-imports/src/get_import_resolver.ts b/packages/kbn-eslint-plugin-imports/src/get_import_resolver.ts index 331232288aef..fa1f12181f74 100644 --- a/packages/kbn-eslint-plugin-imports/src/get_import_resolver.ts +++ b/packages/kbn-eslint-plugin-imports/src/get_import_resolver.ts @@ -7,7 +7,7 @@ */ import { ImportResolver } from '@kbn/import-resolver'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Rule } from 'eslint'; import { RUNNING_IN_EDITOR } from './helpers/running_in_editor'; diff --git a/packages/kbn-eslint-plugin-imports/src/rules/uniform_imports.ts b/packages/kbn-eslint-plugin-imports/src/rules/uniform_imports.ts index 5d6daad4cfde..d853c791640e 100644 --- a/packages/kbn-eslint-plugin-imports/src/rules/uniform_imports.ts +++ b/packages/kbn-eslint-plugin-imports/src/rules/uniform_imports.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Eslint from 'eslint'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getRelativeImportReq, getPackageRelativeImportReq } from '@kbn/import-resolver'; import { report } from '../helpers/report'; @@ -54,8 +54,9 @@ export const UniformImportsRule: Eslint.Rule.RuleModule = { return; } - const packageId = resolver.getPackageIdForPath(absolute); - if (ownPackageId && !packageId) { + const { pkgId } = result; + + if (ownPackageId && !pkgId) { // special cases, files that aren't in packages but packages are allowed to import them if ( absolute === PKGJSON_PATH || @@ -74,11 +75,12 @@ export const UniformImportsRule: Eslint.Rule.RuleModule = { } } - if (packageId === ownPackageId || !packageId) { + if (pkgId === ownPackageId || !pkgId) { const correct = getRelativeImportReq({ ...result, original: req, dirname: sourceDirname, + sourcePath, type, }); @@ -92,11 +94,11 @@ export const UniformImportsRule: Eslint.Rule.RuleModule = { return; } - const packageDir = resolver.getAbsolutePackageDir(packageId); + const packageDir = resolver.getAbsolutePackageDir(pkgId); if (!packageDir) { report(context, { node, - message: `Unable to determine location of package [${packageId}]`, + message: `Unable to determine location of package [${pkgId}]`, }); return; } @@ -104,9 +106,10 @@ export const UniformImportsRule: Eslint.Rule.RuleModule = { const correct = getPackageRelativeImportReq({ ...result, packageDir, - packageId, + pkgId, type, }); + if (req !== correct) { report(context, { node, diff --git a/packages/kbn-eslint-plugin-imports/tsconfig.json b/packages/kbn-eslint-plugin-imports/tsconfig.json index 57c1dd1c94e0..087d77fbfe43 100644 --- a/packages/kbn-eslint-plugin-imports/tsconfig.json +++ b/packages/kbn-eslint-plugin-imports/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/import-resolver", + "@kbn/repo-source-classifier", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-expect/BUILD.bazel b/packages/kbn-expect/BUILD.bazel deleted file mode 100644 index 70ed34ad091c..000000000000 --- a/packages/kbn-expect/BUILD.bazel +++ /dev/null @@ -1,44 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-expect" -PKG_REQUIRE_NAME = "@kbn/expect" - -SOURCE_FILES = glob([ - "expect.js", - "expect.d.ts", -]) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "LICENSE.txt", - "package.json", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-expect/kibana.jsonc b/packages/kbn-expect/kibana.jsonc index 53f789961dd3..86eae76001f8 100644 --- a/packages/kbn-expect/kibana.jsonc +++ b/packages/kbn-expect/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/expect", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-expect/tsconfig.json b/packages/kbn-expect/tsconfig.json index 5ad392a7d8d5..4346803ced34 100644 --- a/packages/kbn-expect/tsconfig.json +++ b/packages/kbn-expect/tsconfig.json @@ -1,9 +1,12 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "skipLibCheck": false + "outDir": "target/types" }, "include": [ "expect.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-failed-test-reporter-cli/BUILD.bazel b/packages/kbn-failed-test-reporter-cli/BUILD.bazel deleted file mode 100644 index 9cbd8ec6b0bc..000000000000 --- a/packages/kbn-failed-test-reporter-cli/BUILD.bazel +++ /dev/null @@ -1,144 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-failed-test-reporter-cli" -PKG_REQUIRE_NAME = "@kbn/failed-test-reporter-cli" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.html", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-ci-stats-reporter:npm_module_types", - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-ftr-screenshot-filename:npm_module_types", - "//packages/kbn-jest-serializers:npm_module_types", - "//packages/kbn-journeys:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//@types/node", - "@npm//@types/he", - "@npm//@types/jest", - "@npm//strip-ansi", - "@npm//@types/normalize-path", - "@npm//@types/xml2js", - "@npm//axios", - "@npm//dedent", - "@npm//globby", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts index b105b6d80ac3..1c81df82ef66 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/failed_tests_reporter_cli.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { createFailError, createFlagError } from '@kbn/dev-cli-errors'; import { CiStatsReporter } from '@kbn/ci-stats-reporter'; diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts index da643164a14a..ab54d7f60dfe 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts @@ -12,7 +12,7 @@ import { createHash } from 'crypto'; import globby from 'globby'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { escape } from 'he'; import { FtrScreenshotFilename } from '@kbn/ftr-screenshot-filename'; import { JourneyScreenshots } from '@kbn/journeys'; diff --git a/packages/kbn-failed-test-reporter-cli/kibana.jsonc b/packages/kbn-failed-test-reporter-cli/kibana.jsonc index dfaa875e1273..9dbfec546ed1 100644 --- a/packages/kbn-failed-test-reporter-cli/kibana.jsonc +++ b/packages/kbn-failed-test-reporter-cli/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/failed-test-reporter-cli", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-failed-test-reporter-cli/package.json b/packages/kbn-failed-test-reporter-cli/package.json index 1aec5a4e73a0..5f40a008317a 100644 --- a/packages/kbn-failed-test-reporter-cli/package.json +++ b/packages/kbn-failed-test-reporter-cli/package.json @@ -2,7 +2,5 @@ "name": "@kbn/failed-test-reporter-cli", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-failed-test-reporter-cli/tsconfig.json b/packages/kbn-failed-test-reporter-cli/tsconfig.json index 292157c18591..13a5510a4ed5 100644 --- a/packages/kbn-failed-test-reporter-cli/tsconfig.json +++ b/packages/kbn-failed-test-reporter-cli/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,19 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/ci-stats-reporter", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/dev-utils", + "@kbn/tooling-log", + "@kbn/ftr-screenshot-filename", + "@kbn/jest-serializers", + "@kbn/journeys", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-field-types/BUILD.bazel b/packages/kbn-field-types/BUILD.bazel deleted file mode 100644 index c6186d28953d..000000000000 --- a/packages/kbn-field-types/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ - -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library",) -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-field-types" -PKG_REQUIRE_NAME = "@kbn/field-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "@npm//jest-styled-components", - "@npm//node-forge", -] - -TYPES_DEPS = [ - "@npm//@types/flot", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/node-forge", - "@npm//@types/testing-library__jest-dom", - "@npm//@emotion/react", - "@npm//jest-styled-components", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-field-types/kibana.jsonc b/packages/kbn-field-types/kibana.jsonc index 5bcf17403700..fadb82dabf4a 100644 --- a/packages/kbn-field-types/kibana.jsonc +++ b/packages/kbn-field-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/field-types", - "owner": "@elastic/kibana-app-services", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-app-services" } diff --git a/packages/kbn-field-types/package.json b/packages/kbn-field-types/package.json index 5e8205f07c8e..520429bbe081 100644 --- a/packages/kbn-field-types/package.json +++ b/packages/kbn-field-types/package.json @@ -2,8 +2,5 @@ "name": "@kbn/field-types", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-field-types/tsconfig.json b/packages/kbn-field-types/tsconfig.json index 1cc4616a7ee4..6818562972f0 100644 --- a/packages/kbn-field-types/tsconfig.json +++ b/packages/kbn-field-types/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "target_types", - "declaration": true, - "emitDeclarationOnly": true, + "outDir": "target/types", "types": [ "jest", ], }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-find-used-node-modules/BUILD.bazel b/packages/kbn-find-used-node-modules/BUILD.bazel deleted file mode 100644 index f8ae0bb461b1..000000000000 --- a/packages/kbn-find-used-node-modules/BUILD.bazel +++ /dev/null @@ -1,130 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-find-used-node-modules" -PKG_REQUIRE_NAME = "@kbn/find-used-node-modules" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-babel-preset", - "@npm//@babel/core", - "@npm//@babel/types", - "@npm//@babel/traverse", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-import-resolver:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/babel__core", - "@npm//@babel/traverse", - "@npm//@babel/types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-find-used-node-modules/kibana.jsonc b/packages/kbn-find-used-node-modules/kibana.jsonc index d5c72f592773..77c4e5d64e79 100644 --- a/packages/kbn-find-used-node-modules/kibana.jsonc +++ b/packages/kbn-find-used-node-modules/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/find-used-node-modules", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-find-used-node-modules/package.json b/packages/kbn-find-used-node-modules/package.json index 2d5c10aab337..d78d27e88aa0 100644 --- a/packages/kbn-find-used-node-modules/package.json +++ b/packages/kbn-find-used-node-modules/package.json @@ -2,7 +2,5 @@ "name": "@kbn/find-used-node-modules", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-find-used-node-modules/src/find_used_node_modules.test.ts b/packages/kbn-find-used-node-modules/src/find_used_node_modules.test.ts index a5175c873418..c336927c9e6d 100644 --- a/packages/kbn-find-used-node-modules/src/find_used_node_modules.test.ts +++ b/packages/kbn-find-used-node-modules/src/find_used_node_modules.test.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import * as Rx from 'rxjs'; import { findUsedNodeModules } from './find_used_node_modules'; import { ImportResolver } from '@kbn/import-resolver'; @@ -36,14 +37,16 @@ const RESOLVER = new MockResolver(); beforeEach(() => { jest.resetAllMocks(); - jest.requireMock('./fs').readFile.mockImplementation((path: string) => { + jest.requireMock('./fs').readFile$.mockImplementation((path: string) => { if (Object.hasOwn(FILES, path)) { - return FILES[path]; + return Rx.of(FILES[path]); } - const error: any = new Error(`ENOENT, missing file [${path}]`); - error.code = 'ENOENT'; - throw error; + return Rx.throwError(() => { + const error: any = new Error(`ENOENT, missing file [${path}]`); + error.code = 'ENOENT'; + return error; + }); }); }); diff --git a/packages/kbn-find-used-node-modules/src/find_used_node_modules.ts b/packages/kbn-find-used-node-modules/src/find_used_node_modules.ts index d02cc084e890..0ecb7f10bb09 100644 --- a/packages/kbn-find-used-node-modules/src/find_used_node_modules.ts +++ b/packages/kbn-find-used-node-modules/src/find_used_node_modules.ts @@ -8,27 +8,15 @@ import Path from 'path'; -import { asyncForEachWithLimit } from '@kbn/std'; +import * as Rx from 'rxjs'; import type { ImportResolver } from '@kbn/import-resolver'; -import { readFile, readFileSync } from './fs'; -import { getImportRequests } from './get_import_requests'; +import { readFile$ } from './fs'; function isObj(v: any): v is Record { return typeof v === 'object' && v !== null; } -function getPeerDeps(thisNodeModule: string) { - const pkgPath = require.resolve(`${thisNodeModule}/package.json`); - const pkg = JSON.parse(readFileSync(pkgPath)); - - if (isObj(pkg) && isObj(pkg.peerDependencies)) { - return Object.keys(pkg.peerDependencies); - } else { - return []; - } -} - interface Options { resolver: ImportResolver; entryPaths: string[]; @@ -55,83 +43,130 @@ interface Options { * solve this by scanning the node_modules directory for all the packages which are used but that * was much slower and lead to extra entries in package.json. */ -export async function findUsedNodeModules(options: Options) { - const queue = new Set(options.entryPaths); - const results = new Set(); +import { getImportRequests } from './get_import_requests'; + +export async function findUsedNodeModules(options: Options) { + const results = new Set(); const entryPathsIntoNodeModules = new Map>(); - for (const path of queue) { - if (Path.extname(path) !== '.js') { - continue; - } + const path$ = new Rx.Subject(); - const dirname = Path.dirname(path); - const code = await readFile(path); - const reqs = getImportRequests(code); + let inputs = 0; + let outputs = 0; + const promise = Rx.lastValueFrom( + path$.pipe( + Rx.filter((path) => Path.extname(path) === '.js'), + Rx.distinct(), + Rx.tap(() => { + inputs += 1; + }), + Rx.mergeMap((path) => readFile$(path, 'utf8').pipe(Rx.map((code) => ({ code, path })))), + Rx.mergeMap(async ({ path, code }) => { + const reqs = getImportRequests(code); + const dirname = Path.dirname(path); - for (const req of reqs) { - // resolve the request to it's actual file on dist - const result = options.resolver.resolve(req, dirname); + for (const req of reqs) { + // resolve the request to it's actual file on dist + const result = options.resolver.resolve(req, dirname); - // ignore non-file resolution results, these represent files which aren't on - // the file-system yet (like during the build) built-ins, explicitily ignored - // files, and @types only imports - if (result?.type !== 'file') { - continue; - } + // ignore non-file resolution results, these represent files which aren't on + // the file-system yet (like during the build) built-ins, explicitily ignored + // files, and @types only imports + if (result?.type !== 'file') { + continue; + } - // if the result points to a node_module (or another node_module)... - if (result.nodeModule && result.nodeModule !== options.thisNodeModule) { - // add it to the results - results.add(result.nodeModule); + if (result.pkgId) { + results.add(result.pkgId); + path$.next(result.absolute); + continue; + } - // record this absolute path as an entry path into the node module from our entries, if we - // need to scan this node_module for used deps we need to know how we access it. - const nmEntries = entryPathsIntoNodeModules.get(result.nodeModule); - if (!nmEntries) { - entryPathsIntoNodeModules.set(result.nodeModule, new Set([result.absolute])); - } else { - nmEntries.add(result.absolute); + // if the result points to a node_module (or another node_module)... + if (result.nodeModule && result.nodeModule !== options.thisNodeModule) { + // add it to the results + results.add(result.nodeModule); + + // record this absolute path as an entry path into the node module from our entries, if we + // need to scan this node_module for used deps we need to know how we access it. + const nmEntries = entryPathsIntoNodeModules.get(result.nodeModule); + if (!nmEntries) { + entryPathsIntoNodeModules.set(result.nodeModule, new Set([result.absolute])); + } else { + nmEntries.add(result.absolute); + } + } + + // no need to scan node_modules unless they're bazel packages + if ( + !result.nodeModule || + result.nodeModule === options.thisNodeModule || + options.resolver.isBazelPackage(result.nodeModule) + ) { + path$.next(result.absolute); + continue; + } } - } + }, 40), + Rx.tap(() => { + outputs += 1; + if (inputs === outputs) { + path$.complete(); + } + }) + ) + ); - // no need to scan node_modules unless they're bazel packages - if ( - !result.nodeModule || - result.nodeModule === options.thisNodeModule || - options.resolver.isBazelPackage(result.nodeModule) - ) { - queue.add(result.absolute); - } - } + for (const path of options.entryPaths) { + path$.next(path); } + await promise; + if (options.findUsedPeers) { - await asyncForEachWithLimit(results, 10, async (dep) => { - const entryPaths = entryPathsIntoNodeModules.get(dep); - if (!entryPaths?.size) { - return; - } + await Rx.lastValueFrom( + Rx.from(results).pipe( + Rx.mergeMap((dep) => { + const entryPaths = entryPathsIntoNodeModules.get(dep); + if (!entryPaths?.size) { + return Rx.EMPTY; + } - const peerDeps = getPeerDeps(dep); - if (!peerDeps.length) { - return; - } + const pkgPath = require.resolve(`${dep}/package.json`); + return readFile$(pkgPath, 'utf8').pipe( + Rx.mergeMap((pkgJson) => { + const pkg = JSON.parse(pkgJson); - const usedInside = await findUsedNodeModules({ - resolver: options.resolver, - entryPaths: Array.from(entryPaths), - findUsedPeers: false, - thisNodeModule: dep, - }); + if (!isObj(pkg) || !isObj(pkg.peerDependencies)) { + return Rx.EMPTY; + } - for (const peer of peerDeps) { - if (usedInside.includes(peer)) { - results.add(peer); - } - } - }); + const peerDeps = Object.keys(pkg.peerDependencies); + if (!peerDeps.length) { + return Rx.EMPTY; + } + + return Rx.of({ entryPaths, dep, peerDeps }); + }) + ); + }, 50), + Rx.concatMap(async ({ entryPaths, dep, peerDeps }) => { + const usedInside = await findUsedNodeModules({ + resolver: options.resolver, + entryPaths: Array.from(entryPaths), + findUsedPeers: false, + thisNodeModule: dep, + }); + + for (const peer of peerDeps) { + if (usedInside.includes(peer)) { + results.add(peer); + } + } + }) + ) + ); } return Array.from(results).sort((a, b) => a.localeCompare(b)); diff --git a/packages/kbn-find-used-node-modules/src/fs.ts b/packages/kbn-find-used-node-modules/src/fs.ts index e0e9c9690803..13d36697df2e 100644 --- a/packages/kbn-find-used-node-modules/src/fs.ts +++ b/packages/kbn-find-used-node-modules/src/fs.ts @@ -7,12 +7,6 @@ */ import Fs from 'fs'; -import Fsp from 'fs/promises'; +import * as Rx from 'rxjs'; -export function readFileSync(path: string) { - return Fs.readFileSync(path, 'utf8'); -} - -export function readFile(path: string) { - return Fsp.readFile(path, 'utf8'); -} +export const readFile$ = Rx.bindNodeCallback<[string, BufferEncoding], [string]>(Fs.readFile); diff --git a/packages/kbn-find-used-node-modules/src/get_import_requests.ts b/packages/kbn-find-used-node-modules/src/get_import_requests.ts index 03de25f7fb92..5ae08f77645e 100644 --- a/packages/kbn-find-used-node-modules/src/get_import_requests.ts +++ b/packages/kbn-find-used-node-modules/src/get_import_requests.ts @@ -8,7 +8,6 @@ import * as parser from '@babel/parser'; import traverse from '@babel/traverse'; -// @ts-expect-error Not available with types import babelParserOptions from '@kbn/babel-preset/common_babel_parser_options'; import { importVisitor } from './import_visitor'; diff --git a/packages/kbn-find-used-node-modules/tsconfig.json b/packages/kbn-find-used-node-modules/tsconfig.json index 57c1dd1c94e0..b43f686f3385 100644 --- a/packages/kbn-find-used-node-modules/tsconfig.json +++ b/packages/kbn-find-used-node-modules/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/import-resolver", + "@kbn/babel-preset", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-flot-charts/BUILD.bazel b/packages/kbn-flot-charts/BUILD.bazel index ec2655bc2bbf..88b7b4a553e3 100644 --- a/packages/kbn-flot-charts/BUILD.bazel +++ b/packages/kbn-flot-charts/BUILD.bazel @@ -34,16 +34,3 @@ js_library( package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-flot-charts/kibana.jsonc b/packages/kbn-flot-charts/kibana.jsonc index ad96bcf118b1..5176e4a96d9f 100644 --- a/packages/kbn-flot-charts/kibana.jsonc +++ b/packages/kbn-flot-charts/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/flot-charts", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-flot-charts/tsconfig.json b/packages/kbn-flot-charts/tsconfig.json new file mode 100644 index 000000000000..7718842c7491 --- /dev/null +++ b/packages/kbn-flot-charts/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.js" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/i18n" + ] +} diff --git a/packages/kbn-ftr-common-functional-services/BUILD.bazel b/packages/kbn-ftr-common-functional-services/BUILD.bazel deleted file mode 100644 index 37e6f35ae240..000000000000 --- a/packages/kbn-ftr-common-functional-services/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ftr-common-functional-services" -PKG_REQUIRE_NAME = "@kbn/ftr-common-functional-services" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-es-archiver:npm_module_types", - "//packages/kbn-test:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ftr-common-functional-services/kibana.jsonc b/packages/kbn-ftr-common-functional-services/kibana.jsonc index 5ceecdcda861..c8f706e5acf3 100644 --- a/packages/kbn-ftr-common-functional-services/kibana.jsonc +++ b/packages/kbn-ftr-common-functional-services/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ftr-common-functional-services", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-ftr-common-functional-services/package.json b/packages/kbn-ftr-common-functional-services/package.json index 0de1d379fff8..7821b80e36ba 100644 --- a/packages/kbn-ftr-common-functional-services/package.json +++ b/packages/kbn-ftr-common-functional-services/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ftr-common-functional-services", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ftr-common-functional-services/tsconfig.json b/packages/kbn-ftr-common-functional-services/tsconfig.json index 292157c18591..639991bb2ce7 100644 --- a/packages/kbn-ftr-common-functional-services/tsconfig.json +++ b/packages/kbn-ftr-common-functional-services/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/es-archiver", + "@kbn/test" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ftr-screenshot-filename/BUILD.bazel b/packages/kbn-ftr-screenshot-filename/BUILD.bazel deleted file mode 100644 index 5ac795bfe2e0..000000000000 --- a/packages/kbn-ftr-screenshot-filename/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-ftr-screenshot-filename" -PKG_REQUIRE_NAME = "@kbn/ftr-screenshot-filename" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ftr-screenshot-filename/kibana.jsonc b/packages/kbn-ftr-screenshot-filename/kibana.jsonc index 61ce39de5a62..5429602d9c0e 100644 --- a/packages/kbn-ftr-screenshot-filename/kibana.jsonc +++ b/packages/kbn-ftr-screenshot-filename/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/ftr-screenshot-filename", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-ftr-screenshot-filename/package.json b/packages/kbn-ftr-screenshot-filename/package.json index 060e1ca7018b..16e6a60922fb 100644 --- a/packages/kbn-ftr-screenshot-filename/package.json +++ b/packages/kbn-ftr-screenshot-filename/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ftr-screenshot-filename", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ftr-screenshot-filename/tsconfig.json b/packages/kbn-ftr-screenshot-filename/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-ftr-screenshot-filename/tsconfig.json +++ b/packages/kbn-ftr-screenshot-filename/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-generate/BUILD.bazel b/packages/kbn-generate/BUILD.bazel deleted file mode 100644 index 3a470bc08ffb..000000000000 --- a/packages/kbn-generate/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-generate" -PKG_REQUIRE_NAME = "@kbn/generate" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = glob(["templates/**/*"]) + [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-bazel-packages", - "//packages/kbn-utils", - "//packages/kbn-sort-package-json", - "@npm//ejs", - "@npm//micromatch", - "@npm//normalize-path", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-bazel-packages:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-sort-package-json:npm_module_types", - "@npm//@types/micromatch", - "@npm//ejs", - "@npm//micromatch", - "@npm//normalize-path", - "@npm//@types/ejs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-generate/kibana.jsonc b/packages/kbn-generate/kibana.jsonc index d7d38e4822cb..26a6f52e21c3 100644 --- a/packages/kbn-generate/kibana.jsonc +++ b/packages/kbn-generate/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/generate", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-generate/package.json b/packages/kbn-generate/package.json index bd92463816ca..b0d3896e4115 100644 --- a/packages/kbn-generate/package.json +++ b/packages/kbn-generate/package.json @@ -2,7 +2,5 @@ "name": "@kbn/generate", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-generate/src/cli.ts b/packages/kbn-generate/src/cli.ts index d3d1366682fe..e31d651f955b 100644 --- a/packages/kbn-generate/src/cli.ts +++ b/packages/kbn-generate/src/cli.ts @@ -13,7 +13,6 @@ import { ContextExtensions } from './generate_command'; import { PackageCommand } from './commands/package_command'; import { CodeownersCommand } from './commands/codeowners_command'; -import { PackagesBuildManifestCommand } from './commands/packages_build_manifest_command'; /** * Runs the generate CLI. Called by `node scripts/generate` and not intended for use outside of that script @@ -28,6 +27,6 @@ export function runGenerateCli() { }; }, }, - [PackageCommand, PackagesBuildManifestCommand, CodeownersCommand] + [PackageCommand, CodeownersCommand] ).execute(); } diff --git a/packages/kbn-generate/src/commands/codeowners_command.ts b/packages/kbn-generate/src/commands/codeowners_command.ts index f1c42dc54173..27b81ada9466 100644 --- a/packages/kbn-generate/src/commands/codeowners_command.ts +++ b/packages/kbn-generate/src/commands/codeowners_command.ts @@ -9,7 +9,7 @@ import Fsp from 'fs/promises'; import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { discoverBazelPackages } from '@kbn/bazel-packages'; import type { GenerateCommand } from '../generate_command'; diff --git a/packages/kbn-generate/src/commands/package_command.ts b/packages/kbn-generate/src/commands/package_command.ts index 4d09ab45c972..0fbf960899e2 100644 --- a/packages/kbn-generate/src/commands/package_command.ts +++ b/packages/kbn-generate/src/commands/package_command.ts @@ -14,13 +14,13 @@ import globby from 'globby'; import { ESLint } from 'eslint'; import micromatch from 'micromatch'; -import { REPO_ROOT } from '@kbn/utils'; -import { discoverBazelPackages, BAZEL_PACKAGE_DIRS } from '@kbn/bazel-packages'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { BAZEL_PACKAGE_DIRS } from '@kbn/bazel-packages'; import { createFailError, createFlagError, isFailError } from '@kbn/dev-cli-errors'; import { sortPackageJson } from '@kbn/sort-package-json'; import { validateElasticTeam } from '../lib/validate_elastic_team'; -import { TEMPLATE_DIR, ROOT_PKG_DIR, PKG_TEMPLATE_DIR } from '../paths'; +import { ROOT_PKG_DIR, PKG_TEMPLATE_DIR } from '../paths'; import type { GenerateCommand } from '../generate_command'; import { ask } from '../lib/ask'; @@ -180,21 +180,12 @@ ${BAZEL_PACKAGE_DIRS.map((dir) => ` ./${dir}/*\n`).join ? [packageJson.devDependencies, packageJson.dependencies] : [packageJson.dependencies, packageJson.devDependencies]; - addDeps[pkgId] = `link:bazel-bin/${normalizedRepoRelativeDir}`; + addDeps[pkgId] = `link:${normalizedRepoRelativeDir}`; delete removeDeps[pkgId]; await Fsp.writeFile(packageJsonPath, sortPackageJson(JSON.stringify(packageJson))); log.info('Updated package.json file'); - await render.toFile( - Path.resolve(TEMPLATE_DIR, 'packages_BUILD.bazel.ejs'), - Path.resolve(REPO_ROOT, 'packages/BUILD.bazel'), - { - packages: await discoverBazelPackages(REPO_ROOT), - } - ); - log.info('Updated packages/BUILD.bazel'); - log.success(`Generated ${pkgId}! Please bootstrap to make sure it works.`); }, }; diff --git a/packages/kbn-generate/src/commands/packages_build_manifest_command.ts b/packages/kbn-generate/src/commands/packages_build_manifest_command.ts deleted file mode 100644 index 4e2775347985..000000000000 --- a/packages/kbn-generate/src/commands/packages_build_manifest_command.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fsp from 'fs/promises'; - -import { REPO_ROOT } from '@kbn/utils'; -import { discoverBazelPackages } from '@kbn/bazel-packages'; - -import { TEMPLATE_DIR } from '../paths'; -import { GenerateCommand } from '../generate_command'; - -const USAGE = `node scripts/generate packages_build_manifest`; - -export const PackagesBuildManifestCommand: GenerateCommand = { - name: 'packages_build_manifest', - usage: USAGE, - description: 'Generate the packages/BUILD.bazel file', - async run({ log, render }) { - const packages = await discoverBazelPackages(REPO_ROOT); - const dest = Path.resolve(REPO_ROOT, 'packages/BUILD.bazel'); - const relDest = Path.relative(process.cwd(), dest); - - const content = await render.toString( - Path.join(TEMPLATE_DIR, 'packages_BUILD.bazel.ejs'), - dest, - { packages } - ); - - let existing; - try { - existing = await Fsp.readFile(dest, 'utf8'); - } catch { - // noop - } - - if (existing === content) { - log.success(relDest, 'is already updated'); - return; - } - - await Fsp.writeFile(dest, content); - log.info(relDest, 'updated'); - }, -}; diff --git a/packages/kbn-generate/src/lib/render.ts b/packages/kbn-generate/src/lib/render.ts index 33c6a903875f..ada8316ba4b2 100644 --- a/packages/kbn-generate/src/lib/render.ts +++ b/packages/kbn-generate/src/lib/render.ts @@ -13,7 +13,7 @@ import Ejs from 'ejs'; import normalizePath from 'normalize-path'; import { ToolingLog } from '@kbn/tooling-log'; import { sortPackageJson } from '@kbn/sort-package-json'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export type Vars = Record; export interface RenderContext extends Vars { diff --git a/packages/kbn-generate/src/paths.ts b/packages/kbn-generate/src/paths.ts index 79319f58d067..d73bd60cc16b 100644 --- a/packages/kbn-generate/src/paths.ts +++ b/packages/kbn-generate/src/paths.ts @@ -8,8 +8,8 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export const ROOT_PKG_DIR = Path.resolve(REPO_ROOT, 'packages'); -export const TEMPLATE_DIR = Path.resolve(__dirname, '../../templates'); +export const TEMPLATE_DIR = Path.resolve(__dirname, '../templates'); export const PKG_TEMPLATE_DIR = Path.resolve(TEMPLATE_DIR, 'package'); diff --git a/packages/kbn-generate/templates/package/BUILD.bazel.ejs b/packages/kbn-generate/templates/package/BUILD.bazel.ejs deleted file mode 100644 index 404638599855..000000000000 --- a/packages/kbn-generate/templates/package/BUILD.bazel.ejs +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = <%- json(pkg.directoryName) %> -PKG_REQUIRE_NAME = <%- json(pkg.id) %> - -SOURCE_FILES = glob( - [ - "**/*.ts", - <%_ if (pkg.web) { _%> - "**/*.tsx", - <%_ } _%> - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -<%_ if (pkg.web) { _%> - "@npm//react" -<%_ } _%> -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -<%_ if (pkg.web) { _%> - "@npm//@types/react" -<%_ } _%> -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) -<% if (pkg.web) { %> -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) -<% } %> -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + <%- pkg.web ? '[":target_node", ":target_web"]' : '[":target_node"]' %>, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + <%- pkg.web ? '[":target_node", ":target_web", ":tsc_types"]' : '[":target_node", ":tsc_types"]' %>, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-generate/templates/package/kibana.jsonc.ejs b/packages/kbn-generate/templates/package/kibana.jsonc.ejs index f39655160f82..48ef56f462fc 100644 --- a/packages/kbn-generate/templates/package/kibana.jsonc.ejs +++ b/packages/kbn-generate/templates/package/kibana.jsonc.ejs @@ -1,8 +1,6 @@ { "type": "shared-common", "id": <%- json(pkg.id) %>, - "owner": <%- json(pkg.owner) %>,<% if (pkg.dev) { %> - "devOnly": true,<% } %> - "runtimeDeps": [], - "typeDeps": [], + "owner": <%- json(pkg.owner) %><% if (pkg.dev) { %>, + "devOnly": true<% } %> } diff --git a/packages/kbn-generate/templates/package/package.json.ejs b/packages/kbn-generate/templates/package/package.json.ejs index 7ab4cb3dfc20..af66105cb2cb 100644 --- a/packages/kbn-generate/templates/package/package.json.ejs +++ b/packages/kbn-generate/templates/package/package.json.ejs @@ -2,10 +2,5 @@ "name": <%- json(pkg.id) %>, "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" - <%_ if (pkg.web) { %>, - "browser": "./target_web/index.js" - <%_ } %> + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-generate/templates/package/tsconfig.json.ejs b/packages/kbn-generate/templates/package/tsconfig.json.ejs index 2b1e544d3423..29693643cbd3 100644 --- a/packages/kbn-generate/templates/package/tsconfig.json.ejs +++ b/packages/kbn-generate/templates/package/tsconfig.json.ejs @@ -1,9 +1,7 @@ { - "extends": "<%- relativePathTo("tsconfig.bazel.json") %>", + "extends": "<%- relativePathTo("tsconfig.base.json") %>", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ <%_ if (pkg.web) { _%> "jest", @@ -20,5 +18,9 @@ <%_ if (pkg.web) { _%> "**/*.tsx", <%_ } _%> - ] + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] } diff --git a/packages/kbn-generate/templates/packages_BUILD.bazel.ejs b/packages/kbn-generate/templates/packages_BUILD.bazel.ejs deleted file mode 100644 index 2656c97ad40e..000000000000 --- a/packages/kbn-generate/templates/packages_BUILD.bazel.ejs +++ /dev/null @@ -1,42 +0,0 @@ -################ -################ -## This file is automatically generated, to create a new package use `node scripts/generate package --help` or run -## `node scripts/generate packages_build_manifest` to regenerate it from the current state of the repo -################ -################ - -# It will build all declared code packages -filegroup( - name = "build_pkg_code", - srcs = [ -<% for (const p of packages.filter(p => p.hasBuildRule())) { _%> - "//<%- p.normalizedRepoRelativeDir %>:build", -<% } _%> - ], -) - -# It will build all declared package types -filegroup( - name = "build_pkg_types", - srcs = [ -<% for (const p of packages.filter(p => p.hasBuildTypesRule())) { _%> - "//<%- p.normalizedRepoRelativeDir %>:build_types", -<% } _%> - ], -) - -# Grouping target to call all underlying packages js builds -filegroup( - name = "build", - srcs = [ - ":build_pkg_code" - ], -) - -# Grouping target to call all underlying packages ts builds -filegroup( - name = "build_types", - srcs = [ - ":build_pkg_types" - ], -) diff --git a/packages/kbn-generate/tsconfig.json b/packages/kbn-generate/tsconfig.json index 57c1dd1c94e0..4ecb368ed162 100644 --- a/packages/kbn-generate/tsconfig.json +++ b/packages/kbn-generate/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/bazel-packages", + "@kbn/sort-package-json", + "@kbn/dev-cli-runner", + "@kbn/repo-info", + "@kbn/dev-cli-errors", + "@kbn/tooling-log", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-get-repo-files/BUILD.bazel b/packages/kbn-get-repo-files/BUILD.bazel deleted file mode 100644 index 215dc3efda88..000000000000 --- a/packages/kbn-get-repo-files/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-get-repo-files" -PKG_REQUIRE_NAME = "@kbn/get-repo-files" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//execa", - "//packages/kbn-utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-get-repo-files/kibana.jsonc b/packages/kbn-get-repo-files/kibana.jsonc index 44ee4e026ba7..9bf339cc5c32 100644 --- a/packages/kbn-get-repo-files/kibana.jsonc +++ b/packages/kbn-get-repo-files/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/get-repo-files", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-get-repo-files/package.json b/packages/kbn-get-repo-files/package.json index 10613d821446..d16a1b7dbe66 100644 --- a/packages/kbn-get-repo-files/package.json +++ b/packages/kbn-get-repo-files/package.json @@ -2,7 +2,5 @@ "name": "@kbn/get-repo-files", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-get-repo-files/src/get_repo_files.ts b/packages/kbn-get-repo-files/src/get_repo_files.ts index f63018b99e0d..f0b52b502151 100644 --- a/packages/kbn-get-repo-files/src/get_repo_files.ts +++ b/packages/kbn-get-repo-files/src/get_repo_files.ts @@ -10,14 +10,8 @@ import Path from 'path'; import Fs from 'fs'; import execa from 'execa'; -import { REPO_ROOT } from '@kbn/utils'; - -interface RepoPath { - /** repo-relative path to the file */ - repoRel: string; - /** absolute path to the file */ - abs: string; -} +import { REPO_ROOT } from '@kbn/repo-info'; +import { RepoPath } from '@kbn/repo-path'; /** * List the files in the repo, only including files which are manged by version @@ -47,7 +41,7 @@ export async function getRepoFiles(include?: string[], exclude?: string[]) { const repoRel = line.slice(2); // trim the single char status and separating space from the line const existingPath = paths.get(repoRel); - const path = existingPath ?? { repoRel, abs: Path.resolve(REPO_ROOT, repoRel) }; + const path = existingPath ?? new RepoPath(REPO_ROOT, repoRel); if (!existingPath) { paths.set(repoRel, path); } diff --git a/packages/kbn-get-repo-files/tsconfig.json b/packages/kbn-get-repo-files/tsconfig.json index 57c1dd1c94e0..4c74f7e7042c 100644 --- a/packages/kbn-get-repo-files/tsconfig.json +++ b/packages/kbn-get-repo-files/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/repo-info", + "@kbn/repo-path", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-guided-onboarding/BUILD.bazel b/packages/kbn-guided-onboarding/BUILD.bazel deleted file mode 100644 index 9e3bde78c5d2..000000000000 --- a/packages/kbn-guided-onboarding/BUILD.bazel +++ /dev/null @@ -1,150 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-guided-onboarding" -PKG_REQUIRE_NAME = "@kbn/guided-onboarding" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//enzyme", - "@npm//react", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/core/http/core-http-browser", - "//packages/core/ui-settings/core-ui-settings-browser", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@elastic/eui", - "@npm//@types/enzyme", - "@npm//@types/react", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/core/http/core-http-browser:npm_module_types", - "//packages/core/ui-settings/core-ui-settings-browser:npm_module_types", - "//packages/core/application/core-application-browser:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-guided-onboarding/kibana.jsonc b/packages/kbn-guided-onboarding/kibana.jsonc index 4715fec8fbd5..6f9768ce87ce 100644 --- a/packages/kbn-guided-onboarding/kibana.jsonc +++ b/packages/kbn-guided-onboarding/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/guided-onboarding", - "owner": "@elastic/platform-onboarding", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/platform-onboarding" } diff --git a/packages/kbn-guided-onboarding/package.json b/packages/kbn-guided-onboarding/package.json index f0f92c8a130e..d25b7c04bc4a 100644 --- a/packages/kbn-guided-onboarding/package.json +++ b/packages/kbn-guided-onboarding/package.json @@ -2,8 +2,5 @@ "name": "@kbn/guided-onboarding", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-guided-onboarding/tsconfig.json b/packages/kbn-guided-onboarding/tsconfig.json index 16588a28c9bf..5f0ba6f1c54f 100644 --- a/packages/kbn-guided-onboarding/tsconfig.json +++ b/packages/kbn-guided-onboarding/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/core-application-browser" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-handlebars/BUILD.bazel b/packages/kbn-handlebars/BUILD.bazel deleted file mode 100644 index 2588bbe7857c..000000000000 --- a/packages/kbn-handlebars/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-handlebars" -PKG_REQUIRE_NAME = "@kbn/handlebars" -TYPES_PKG_REQUIRE_NAME = "@types/kbn__handlebars" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__jest__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//handlebars", -] - -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "@npm//handlebars", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-handlebars/kibana.jsonc b/packages/kbn-handlebars/kibana.jsonc index 64249345bce8..59b3c28ddb39 100644 --- a/packages/kbn-handlebars/kibana.jsonc +++ b/packages/kbn-handlebars/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/handlebars", - "owner": "@elastic/kibana-security", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-security" } diff --git a/packages/kbn-handlebars/package.json b/packages/kbn-handlebars/package.json index 85a52e60d749..46ca823a476d 100644 --- a/packages/kbn-handlebars/package.json +++ b/packages/kbn-handlebars/package.json @@ -2,8 +2,5 @@ "name": "@kbn/handlebars", "version": "1.0.0", "private": true, - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "types": "./target_types/index.d.ts", "license": "MIT" -} +} \ No newline at end of file diff --git a/packages/kbn-handlebars/tsconfig.json b/packages/kbn-handlebars/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-handlebars/tsconfig.json +++ b/packages/kbn-handlebars/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-hapi-mocks/BUILD.bazel b/packages/kbn-hapi-mocks/BUILD.bazel deleted file mode 100644 index 120a4fc0b0d9..000000000000 --- a/packages/kbn-hapi-mocks/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-hapi-mocks" -PKG_REQUIRE_NAME = "@kbn/hapi-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@hapi/hapi", - "@npm//@types/hapi__hapi", - "//packages/kbn-utility-types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-hapi-mocks/kibana.jsonc b/packages/kbn-hapi-mocks/kibana.jsonc index 9a2632c95d81..f88e6e29df49 100644 --- a/packages/kbn-hapi-mocks/kibana.jsonc +++ b/packages/kbn-hapi-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/hapi-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-hapi-mocks/package.json b/packages/kbn-hapi-mocks/package.json index 67968be61182..f2b3ea9de9e1 100644 --- a/packages/kbn-hapi-mocks/package.json +++ b/packages/kbn-hapi-mocks/package.json @@ -2,7 +2,5 @@ "name": "@kbn/hapi-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-hapi-mocks/tsconfig.json b/packages/kbn-hapi-mocks/tsconfig.json index 57c1dd1c94e0..11f148d713b3 100644 --- a/packages/kbn-hapi-mocks/tsconfig.json +++ b/packages/kbn-hapi-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/utility-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-health-gateway-server/BUILD.bazel b/packages/kbn-health-gateway-server/BUILD.bazel deleted file mode 100644 index 1273cc7a0d7a..000000000000 --- a/packages/kbn-health-gateway-server/BUILD.bazel +++ /dev/null @@ -1,127 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-health-gateway-server" -PKG_REQUIRE_NAME = "@kbn/health-gateway-server" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//@hapi/hapi", - "@npm//node-fetch", - "//packages/kbn-config", - "//packages/kbn-config-mocks", - "//packages/kbn-config-schema", - "//packages/kbn-logging-mocks", - "//packages/kbn-server-http-tools", - "//packages/kbn-utils", - "//packages/core/logging/core-logging-server-internal", -] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/hapi__hapi", - "@npm//@types/node-fetch", - "@npm//moment", - "//packages/core/base/core-base-server-internal:npm_module_types", - "//packages/core/logging/core-logging-server-internal:npm_module_types", - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-logging:npm_module_types", - "//packages/kbn-logging-mocks:npm_module_types", - "//packages/kbn-server-http-tools:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utility-types-jest:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-health-gateway-server/kibana.jsonc b/packages/kbn-health-gateway-server/kibana.jsonc index 5c31c05c8246..6f9470fac54e 100644 --- a/packages/kbn-health-gateway-server/kibana.jsonc +++ b/packages/kbn-health-gateway-server/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-server", "id": "@kbn/health-gateway-server", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-health-gateway-server/package.json b/packages/kbn-health-gateway-server/package.json index d38191a879a8..8e11c679f325 100644 --- a/packages/kbn-health-gateway-server/package.json +++ b/packages/kbn-health-gateway-server/package.json @@ -2,11 +2,9 @@ "name": "@kbn/health-gateway-server", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", "scripts": { - "start": "node ../../bazel-bin/packages/kbn-health-gateway-server/target_node/scripts/init.js" - }, - "types": "./target_types/index.d.ts" -} + "start": "node -r '@kbn/babel-register/install' ./scripts/init" + } +} \ No newline at end of file diff --git a/packages/kbn-health-gateway-server/src/config/config_service.test.ts b/packages/kbn-health-gateway-server/src/config/config_service.test.ts index 351467085195..b686b2ec171a 100644 --- a/packages/kbn-health-gateway-server/src/config/config_service.test.ts +++ b/packages/kbn-health-gateway-server/src/config/config_service.test.ts @@ -12,7 +12,7 @@ import { rawConfigServiceMock, } from './config_service.test.mocks'; import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { getConfigService } from './config_service'; const DEFAULT_CONFIG_PATH = fromRoot('config/gateway.yml'); diff --git a/packages/kbn-health-gateway-server/src/config/config_service.ts b/packages/kbn-health-gateway-server/src/config/config_service.ts index 059a1773d29c..4b2b4b68f91f 100644 --- a/packages/kbn-health-gateway-server/src/config/config_service.ts +++ b/packages/kbn-health-gateway-server/src/config/config_service.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { fromRoot, REPO_ROOT } from '@kbn/utils'; +import { fromRoot, REPO_ROOT } from '@kbn/repo-info'; import type { LoggerFactory } from '@kbn/logging'; import { ConfigService as KbnConfigService, CliArgs, Env, RawConfigService } from '@kbn/config'; import { getArgValues } from './read_argv'; diff --git a/packages/kbn-health-gateway-server/tsconfig.json b/packages/kbn-health-gateway-server/tsconfig.json index 98e6b09c1c81..02a2f9c776b2 100644 --- a/packages/kbn-health-gateway-server/tsconfig.json +++ b/packages/kbn-health-gateway-server/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -12,5 +10,20 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-base-server-internal", + "@kbn/core-logging-server-internal", + "@kbn/config", + "@kbn/config-mocks", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/server-http-tools", + "@kbn/utility-types", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-i18n-react/BUILD.bazel b/packages/kbn-i18n-react/BUILD.bazel index 644507b4a45b..b2c2dff7eaba 100644 --- a/packages/kbn-i18n-react/BUILD.bazel +++ b/packages/kbn-i18n-react/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-i18n-react" -PKG_REQUIRE_NAME = "@kbn/i18n-react" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", "**/*.tsx", @@ -25,99 +20,17 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "//packages/kbn-i18n", "@npm//prop-types", "@npm//react", "@npm//react-intl" ] -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/prop-types", - "@npm//@types/react", - "@npm//@types/react-intl", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-i18n-react", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + package_name = "@kbn/i18n-react", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n-react/kibana.jsonc b/packages/kbn-i18n-react/kibana.jsonc index 296e7295e52b..090a4f0fa61b 100644 --- a/packages/kbn-i18n-react/kibana.jsonc +++ b/packages/kbn-i18n-react/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/i18n-react", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-i18n-react/package.json b/packages/kbn-i18n-react/package.json index d0f23a32a555..ae9e5d36beff 100644 --- a/packages/kbn-i18n-react/package.json +++ b/packages/kbn-i18n-react/package.json @@ -1,10 +1,7 @@ { "name": "@kbn/i18n-react", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-i18n-react/tsconfig.json b/packages/kbn-i18n-react/tsconfig.json index 14bb804696bb..74fb754fc3d2 100644 --- a/packages/kbn-i18n-react/tsconfig.json +++ b/packages/kbn-i18n-react/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -13,4 +11,10 @@ "**/*.ts", "**/*.tsx", ], + "kbn_references": [ + "@kbn/i18n" + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 1cf9837ec074..3df0fa95e05f 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-i18n" -PKG_REQUIRE_NAME = "@kbn/i18n" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", "**/*.tsx", @@ -27,97 +22,16 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "GUIDELINE.md", - "README.md" -] - -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "@npm//intl-format-cache", "@npm//intl-messageformat", "@npm//intl-relativeformat", ] -TYPES_DEPS = [ - "@npm//intl-messageformat", - "@npm//tslib", - "@npm//@types/intl-relativeformat", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-i18n", + package_name = "@kbn/i18n", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-i18n/kibana.jsonc b/packages/kbn-i18n/kibana.jsonc index cd5613bc493c..8d4bdf6f003c 100644 --- a/packages/kbn-i18n/kibana.jsonc +++ b/packages/kbn-i18n/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/i18n", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 26a8aeb99dc3..d15b66768fd3 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -1,10 +1,8 @@ { "name": "@kbn/i18n", - "browser": "./target_web/src/browser.js", - "main": "./target_node/index.js", + "browser": "./src/browser", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "author": "Kibana Core", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index 90a2bc53a9b1..b3ffcae3f1c2 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -1,21 +1,21 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" ] }, "include": [ + "**/*.js", "**/*.ts", "**/*.tsx", "types/intl_format_cache.d.ts", "types/intl_relativeformat.d.ts" ], "exclude": [ - "**/__fixtures__/**/*" + "**/__fixtures__/**/*", + "target/**/*", ] } diff --git a/packages/kbn-import-resolver/BUILD.bazel b/packages/kbn-import-resolver/BUILD.bazel deleted file mode 100644 index c32b02f8ba82..000000000000 --- a/packages/kbn-import-resolver/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-import-resolver" -PKG_REQUIRE_NAME = "@kbn/import-resolver" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-bazel-packages", - "//packages/kbn-utils", - "//packages/kbn-synthetic-package-map", - "@npm//resolve", - "@npm//normalize-path", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-bazel-packages:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", # needed for testing, only required for windows dev - "//packages/kbn-synthetic-package-map:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/resolve", - "@npm//@types/normalize-path", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-import-resolver/kibana.jsonc b/packages/kbn-import-resolver/kibana.jsonc index 9e0598696621..6b7ae00f9da8 100644 --- a/packages/kbn-import-resolver/kibana.jsonc +++ b/packages/kbn-import-resolver/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/import-resolver", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-import-resolver/package.json b/packages/kbn-import-resolver/package.json index bb114bbc0175..21a8f5362436 100644 --- a/packages/kbn-import-resolver/package.json +++ b/packages/kbn-import-resolver/package.json @@ -2,7 +2,5 @@ "name": "@kbn/import-resolver", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-import-resolver/src/helpers/import_req.ts b/packages/kbn-import-resolver/src/helpers/import_req.ts index 5844f47e880f..98a394ae1431 100644 --- a/packages/kbn-import-resolver/src/helpers/import_req.ts +++ b/packages/kbn-import-resolver/src/helpers/import_req.ts @@ -24,10 +24,19 @@ const EXT_RE = /\.(jsx?|(d\.)?tsx?)$/; const INDEX_IN_INDEX_RE = /\/index\/index(\.jsx?|\.d\.tsx?|\.tsx?)$/; const INCLUDES_FILENAME_RE = /\/.*\..{2,4}$/; -export function reduceImportRequest(req: string, type: ImportType, original?: string) { +export function reduceImportRequest( + req: string, + type: ImportType, + original?: string, + sourceExt?: string +) { let reduced = req; - if (type === 'require-resolve' && original && original.match(INCLUDES_FILENAME_RE)) { + if ( + original && + (type === 'require-resolve' || sourceExt === '.mjs') && + original.match(INCLUDES_FILENAME_RE) + ) { // require.resolve() can be a complicated, it's often used in config files and // sometimes we don't have babel to help resolve .ts to .js, so we try to rely // on the original request and keep the filename listed if it's in the original @@ -65,6 +74,7 @@ interface RelativeImportReqOptions extends WrapOptions { dirname: string; absolute: string; type: ImportType; + sourcePath?: string; original?: string; } @@ -74,7 +84,8 @@ export function getRelativeImportReq(options: RelativeImportReqOptions) { reduceImportRequest( relative.startsWith('.') ? relative : `./${relative}`, options.type, - options.original + options.original, + options.sourcePath ? Path.extname(options.sourcePath) : undefined ), options ); @@ -82,19 +93,43 @@ export function getRelativeImportReq(options: RelativeImportReqOptions) { interface PackageRelativeImportReqOptions extends WrapOptions { packageDir: string; - packageId: string; absolute: string; + pkgId: string; type: ImportType; } +const pkgMainCache = new Map(); +function getPkgMain(pkgDir: string) { + const cached = pkgMainCache.get(pkgDir); + if (cached !== undefined) { + return cached; + } + try { + const main = require.resolve(pkgDir); + pkgMainCache.set(pkgDir, main); + return main; + } catch (error) { + if (error.code === 'MODULE_NOT_FOUND') { + pkgMainCache.set(pkgDir, null); + return null; + } + + throw error; + } +} + export function getPackageRelativeImportReq(options: PackageRelativeImportReqOptions) { + if (options.absolute === getPkgMain(options.packageDir)) { + return wrap(options.pkgId, options); + } + const relative = normalizePath(Path.relative(options.packageDir, options.absolute)); if (!relative) { - return wrap(options.packageId, options); + return wrap(options.pkgId, options); } const subPath = reduceImportRequest(relative, options.type); - return wrap(subPath ? `${options.packageId}/${subPath}` : options.packageId, options); + return wrap(subPath ? `${options.pkgId}/${subPath}` : options.pkgId, options); } diff --git a/packages/kbn-import-resolver/src/import_resolver.ts b/packages/kbn-import-resolver/src/import_resolver.ts index bab9a9000dd6..ca37341b2e4f 100644 --- a/packages/kbn-import-resolver/src/import_resolver.ts +++ b/packages/kbn-import-resolver/src/import_resolver.ts @@ -7,13 +7,12 @@ */ import Path from 'path'; +import Fs from 'fs'; import Resolve from 'resolve'; -import { readPackageManifest } from '@kbn/bazel-packages'; -import { REPO_ROOT } from '@kbn/utils'; -import normalizePath from 'normalize-path'; -import { discoverPackageManifestPaths } from '@kbn/bazel-packages'; -import { readPackageMap, PackageMap } from '@kbn/synthetic-package-map'; +import { readPackageManifest, type KibanaPackageManifest } from '@kbn/bazel-packages'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { readPackageMap, PackageMap } from '@kbn/package-map'; import { safeStat, readFileSync } from './helpers/fs'; import { ResolveResult } from './resolve_result'; @@ -24,14 +23,20 @@ const NODE_MODULE_SEG = Path.sep + 'node_modules' + Path.sep; export class ImportResolver { static create(repoRoot: string) { - const pkgMap = new Map(); - for (const manifestPath of discoverPackageManifestPaths(REPO_ROOT)) { - const relativeBazelPackageDir = Path.relative(REPO_ROOT, Path.dirname(manifestPath)); - const pkg = readPackageManifest(manifestPath); - pkgMap.set(pkg.id, normalizePath(relativeBazelPackageDir)); - } + const pkgMap = readPackageMap(); - return new ImportResolver(repoRoot, pkgMap, readPackageMap()); + const manifests = new Map( + Array.from(pkgMap.entries()).flatMap(([id, repoRelPath]) => { + const manifestPath = Path.resolve(repoRoot, repoRelPath, 'kibana.jsonc'); + if (!Fs.existsSync(manifestPath)) { + return []; + } + + return [[id, readPackageManifest(manifestPath)] as const]; + }) + ); + + return new ImportResolver(repoRoot, pkgMap, manifests); } private safeStat = memoize(safeStat); @@ -61,52 +66,62 @@ export class ImportResolver { */ private readonly cwd: string, /** - * Map of actual package names to normalized root-relative directories + * Map of package ids to normalized root-relative directories * for each package */ private readonly pkgMap: PackageMap, /** - * Map of synthetic package names to normalized root-relative directories - * for each simulated package + * Map of package ids to pkg manifests, if there is no manifest it is + * assumed to be a legacy plugin */ - private readonly synthPkgMap: PackageMap - ) {} + private readonly pkgManifests: Map + ) { + // invert the pkgMap, we will update this map with new results as we determine them. + this._dirToPkgId = new Map(Array.from(this.pkgMap).map(([k, v]) => [v, k])); + } + + private readonly _dirToPkgId: Map; + private pkgIdForDir(dir: string): string | null { + const cached = this._dirToPkgId.get(dir); + if (cached !== undefined) { + return cached; + } + + const parent = Path.dirname(dir); + if (parent === '.') { + this._dirToPkgId.set(dir, null); + return null; + } + + const pkgId = this.pkgIdForDir(parent); + this._dirToPkgId.set(dir, pkgId); + return pkgId; + } getPackageIdForPath(path: string) { - const relative = normalizePath(Path.relative(this.cwd, path)); + const relative = Path.relative(this.cwd, path); if (relative.startsWith('..')) { - throw new Error(`path is outside of cwd [${this.cwd}]`); + return null; } - for (const [synthPkgId, dir] of this.synthPkgMap) { - if (relative === dir || relative.startsWith(dir + '/')) { - return synthPkgId; - } - } - - for (const [pkgId, dir] of this.pkgMap) { - if (relative === dir || relative.startsWith(dir + '/')) { - return pkgId; - } - } - - return null; + return this.pkgIdForDir(Path.dirname(relative)); } getAbsolutePackageDir(pkgId: string) { - const dir = this.synthPkgMap.get(pkgId) ?? this.pkgMap.get(pkgId); - if (!dir) { - return null; - } - return Path.resolve(this.cwd, dir); + const dir = this.pkgMap.get(pkgId); + return dir ? Path.resolve(this.cwd, dir) : null; } + /** + * Is the package a bazel package? + * @deprecated + */ isBazelPackage(pkgId: string) { - return this.pkgMap.has(pkgId); + return !!this.getPkgManifest(pkgId); } - isSyntheticPackage(pkgId: string) { - return this.synthPkgMap.has(pkgId); + getPkgManifest(pkgId: string) { + return this.pkgManifests.get(pkgId); } private shouldIgnore(req: string): boolean { @@ -125,13 +140,6 @@ export class ImportResolver { return true; } - // ignore requests to bazel target dirs, these files are only available in the build output - // and will never resolve in dev. We will validate that people don't import these files from - // outside the package in another rule - if (req.includes('/target_workers/') || req.includes('/target_node/')) { - return true; - } - // typescript validates these imports fine and they're purely virtual thanks to ambient type definitions in @elastic/eui so /shrug if ( req.startsWith('@elastic/eui/src/components/') || @@ -180,6 +188,15 @@ export class ImportResolver { }; } + const pkgId = this.getPackageIdForPath(path); + if (pkgId) { + return { + type: 'file', + absolute: path, + pkgId, + }; + } + const lastNmSeg = path.lastIndexOf(NODE_MODULE_SEG); if (lastNmSeg !== -1) { const segs = path.slice(lastNmSeg + NODE_MODULE_SEG.length).split(Path.sep); @@ -252,15 +269,14 @@ export class ImportResolver { if (req[0] !== '.') { const parts = req.split('/'); const pkgId = parts[0].startsWith('@') ? `${parts[0]}/${parts[1]}` : `${parts[0]}`; - if (this.synthPkgMap.has(pkgId)) { + if (this.pkgMap.has(pkgId)) { const pkgDir = this.getAbsolutePackageDir(pkgId); if (pkgDir) { return this.resolve( - getRelativeImportReq({ - absolute: parts.length > 2 ? Path.resolve(pkgDir, ...parts.slice(2)) : pkgDir, + `./${Path.relative( dirname, - type: 'esm', - }), + parts.length > 2 ? Path.resolve(pkgDir, ...parts.slice(2)) : pkgDir + )}`, dirname ); } diff --git a/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts b/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts index a6a3a84602cd..4fbedcaf3851 100644 --- a/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts +++ b/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts @@ -17,8 +17,20 @@ expect.addSnapshotSerializer(createAbsolutePathSerializer()); const resolver = new ImportResolver( FIXTURES_DIR, - new Map([['@pkg/box', 'packages/box']]), - new Map([['@synth/bar', 'src/bar']]) + new Map([ + ['@synth/bar', 'src/bar'], + ['@pkg/box', 'packages/box'], + ]), + new Map([ + [ + '@pkg/box', + { + id: '@pkg/box', + type: 'shared-common', + owner: [], + }, + ], + ]) ); describe('#resolve()', () => { @@ -26,16 +38,17 @@ describe('#resolve()', () => { expect(resolver.resolve('@synth/bar', FIXTURES_DIR)).toMatchInlineSnapshot(` Object { "absolute": /packages/kbn-import-resolver/src/__fixtures__/src/bar/index.js, + "pkgId": "@synth/bar", "type": "file", } `); }); - it('resolves imports to bazel packages that are also found in node_modules', () => { + it('resolves imports to bazel packages', () => { expect(resolver.resolve('@pkg/box', FIXTURES_DIR)).toMatchInlineSnapshot(` Object { - "absolute": /packages/kbn-import-resolver/src/__fixtures__/node_modules/@pkg/box/index.js, - "nodeModule": "@pkg/box", + "absolute": /packages/kbn-import-resolver/src/__fixtures__/packages/box/index.js, + "pkgId": "@pkg/box", "type": "file", } `); @@ -64,6 +77,7 @@ describe('#resolve()', () => { expect(resolver.resolve('./bar', Path.resolve(FIXTURES_DIR, 'src/bar'))).toMatchInlineSnapshot(` Object { "absolute": /packages/kbn-import-resolver/src/__fixtures__/src/bar/bar.js, + "pkgId": "@synth/bar", "type": "file", } `); @@ -169,18 +183,3 @@ describe('#isBazelPackage()', () => { expect(resolver.isBazelPackage('@kbn/invalid')).toBe(false); }); }); - -describe('#isSyntheticPackage()', () => { - it('returns true for synth packages', () => { - expect(resolver.isSyntheticPackage('@synth/bar')).toBe(true); - }); - it('returns false for bazel packages', () => { - expect(resolver.isSyntheticPackage('@pkg/box')).toBe(false); - }); - it('returns false for node_modules packages', () => { - expect(resolver.isSyntheticPackage('foo')).toBe(false); - }); - it('returns false for unknown packages', () => { - expect(resolver.isSyntheticPackage('@kbn/invalid')).toBe(false); - }); -}); diff --git a/packages/kbn-import-resolver/src/resolve_result.ts b/packages/kbn-import-resolver/src/resolve_result.ts index 3174da55fb58..2f9602758b0c 100644 --- a/packages/kbn-import-resolver/src/resolve_result.ts +++ b/packages/kbn-import-resolver/src/resolve_result.ts @@ -49,6 +49,7 @@ export interface TypesResult { export interface FileResult { type: 'file'; absolute: string; + pkgId?: string; nodeModule?: string; prefix?: string; postfix?: string; diff --git a/packages/kbn-import-resolver/tsconfig.json b/packages/kbn-import-resolver/tsconfig.json index 57c1dd1c94e0..d9efcd9bf27b 100644 --- a/packages/kbn-import-resolver/tsconfig.json +++ b/packages/kbn-import-resolver/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/bazel-packages", + "@kbn/package-map", + "@kbn/repo-info", + "@kbn/jest-serializers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-interpreter/BUILD.bazel b/packages/kbn-interpreter/BUILD.bazel deleted file mode 100644 index 26a359a89cbe..000000000000 --- a/packages/kbn-interpreter/BUILD.bazel +++ /dev/null @@ -1,130 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-interpreter" -PKG_REQUIRE_NAME = "@kbn/interpreter" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.js", - "**/grammar.peggy.config.json", - "**/grammar.peggy", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -TYPE_FILES = [] - -SRCS = SOURCE_FILES + TYPE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//lodash", -] - -TYPES_DEPS = [ - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "//packages/kbn-ambient-common-types:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - allow_js = True, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-interpreter/kibana.jsonc b/packages/kbn-interpreter/kibana.jsonc index 0326ff88e9f5..9f11015263cf 100644 --- a/packages/kbn-interpreter/kibana.jsonc +++ b/packages/kbn-interpreter/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/interpreter", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-interpreter/package.json b/packages/kbn-interpreter/package.json index 3f7bad2a4e2d..ea1c3343312e 100644 --- a/packages/kbn-interpreter/package.json +++ b/packages/kbn-interpreter/package.json @@ -1,10 +1,7 @@ { "name": "@kbn/interpreter", "author": "Visualizations", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-interpreter/src/common/lib/ast/from_expression.test.js b/packages/kbn-interpreter/src/common/lib/ast/from_expression.test.js index 24a652e29bb0..2aa240956fa6 100644 --- a/packages/kbn-interpreter/src/common/lib/ast/from_expression.test.js +++ b/packages/kbn-interpreter/src/common/lib/ast/from_expression.test.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { fromExpression } from '@kbn/interpreter'; +import { fromExpression } from './from_expression'; import { getType } from '../get_type'; describe('fromExpression', () => { diff --git a/packages/kbn-interpreter/src/common/lib/ast/to_expression.test.js b/packages/kbn-interpreter/src/common/lib/ast/to_expression.test.js index 18e6b8fe88cf..98d2cfa1153f 100644 --- a/packages/kbn-interpreter/src/common/lib/ast/to_expression.test.js +++ b/packages/kbn-interpreter/src/common/lib/ast/to_expression.test.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { toExpression } from '@kbn/interpreter'; +import { toExpression } from './to_expression'; import { cloneDeep, set, unset } from 'lodash'; describe('toExpression', () => { diff --git a/packages/kbn-interpreter/tsconfig.json b/packages/kbn-interpreter/tsconfig.json index e3b4140d0582..8af1ae01dce1 100644 --- a/packages/kbn-interpreter/tsconfig.json +++ b/packages/kbn-interpreter/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,10 @@ "include": [ "**/*.ts", "**/*.js" + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-io-ts-utils/BUILD.bazel b/packages/kbn-io-ts-utils/BUILD.bazel deleted file mode 100644 index dd1b7b1d9250..000000000000 --- a/packages/kbn-io-ts-utils/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-io-ts-utils" -PKG_REQUIRE_NAME = "@kbn/io-ts-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-config-schema", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//lodash", - "@npm//tslib", -] - -TYPES_DEPS = [ - "//packages/kbn-config-schema:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-io-ts-utils/kibana.jsonc b/packages/kbn-io-ts-utils/kibana.jsonc index f903e878366b..7d03717a5315 100644 --- a/packages/kbn-io-ts-utils/kibana.jsonc +++ b/packages/kbn-io-ts-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/io-ts-utils", - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-io-ts-utils/package.json b/packages/kbn-io-ts-utils/package.json index 65fd13e60533..d62960217f94 100644 --- a/packages/kbn-io-ts-utils/package.json +++ b/packages/kbn-io-ts-utils/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/io-ts-utils", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 57c1dd1c94e0..d5fd475db97a 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-jest-serializers/BUILD.bazel b/packages/kbn-jest-serializers/BUILD.bazel deleted file mode 100644 index edfae6d725f9..000000000000 --- a/packages/kbn-jest-serializers/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-jest-serializers" -PKG_REQUIRE_NAME = "@kbn/jest-serializers" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//strip-ansi", - "//packages/kbn-utils", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//strip-ansi", - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-jest-serializers/kibana.jsonc b/packages/kbn-jest-serializers/kibana.jsonc index 2742ade92e31..b10e32373357 100644 --- a/packages/kbn-jest-serializers/kibana.jsonc +++ b/packages/kbn-jest-serializers/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/jest-serializers", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-jest-serializers/package.json b/packages/kbn-jest-serializers/package.json index 8c3ac00c0fd4..36830b86ec5a 100644 --- a/packages/kbn-jest-serializers/package.json +++ b/packages/kbn-jest-serializers/package.json @@ -2,7 +2,5 @@ "name": "@kbn/jest-serializers", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-jest-serializers/src/absolute_path_serializer.ts b/packages/kbn-jest-serializers/src/absolute_path_serializer.ts index 4af98494dc78..ab1c957497a4 100644 --- a/packages/kbn-jest-serializers/src/absolute_path_serializer.ts +++ b/packages/kbn-jest-serializers/src/absolute_path_serializer.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export function createAbsolutePathSerializer( rootPath: string = REPO_ROOT, diff --git a/packages/kbn-jest-serializers/tsconfig.json b/packages/kbn-jest-serializers/tsconfig.json index 57c1dd1c94e0..f87610efe52d 100644 --- a/packages/kbn-jest-serializers/tsconfig.json +++ b/packages/kbn-jest-serializers/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-journeys/BUILD.bazel b/packages/kbn-journeys/BUILD.bazel deleted file mode 100644 index 298b36dbca2e..000000000000 --- a/packages/kbn-journeys/BUILD.bazel +++ /dev/null @@ -1,132 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-journeys" -PKG_REQUIRE_NAME = "@kbn/journeys" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//playwright", - "@npm//uuid", - "@npm//axios", - "@npm//callsites", - "@npm//rxjs", - "@npm//elastic-apm-node", - "//packages/kbn-ftr-common-functional-services:npm_module_types", - "//packages/kbn-ftr-screenshot-filename:npm_module_types", - "//packages/kbn-test:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-ambient-ftr-types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-journeys/journey/journey_config.ts b/packages/kbn-journeys/journey/journey_config.ts index e23b2a748fbe..5323d7989bdf 100644 --- a/packages/kbn-journeys/journey/journey_config.ts +++ b/packages/kbn-journeys/journey/journey_config.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { BaseStepCtx } from './journey'; diff --git a/packages/kbn-journeys/journey/journey_ftr_config.ts b/packages/kbn-journeys/journey/journey_ftr_config.ts index 2a80c20c7949..ad85bb426fe4 100644 --- a/packages/kbn-journeys/journey/journey_ftr_config.ts +++ b/packages/kbn-journeys/journey/journey_ftr_config.ts @@ -9,8 +9,8 @@ import Path from 'path'; import { v4 as uuidV4 } from 'uuid'; -import { REPO_ROOT } from '@kbn/utils'; -import { FtrConfigProviderContext, FtrConfigProvider } from '@kbn/test'; +import { REPO_ROOT } from '@kbn/repo-info'; +import type { FtrConfigProviderContext, FtrConfigProvider } from '@kbn/test'; import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; import { AnyStep } from './journey'; diff --git a/packages/kbn-journeys/journey/journey_screenshots.ts b/packages/kbn-journeys/journey/journey_screenshots.ts index 955d00ca4c37..9adb8cbec176 100644 --- a/packages/kbn-journeys/journey/journey_screenshots.ts +++ b/packages/kbn-journeys/journey/journey_screenshots.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fsp from 'fs/promises'; import * as Rx from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { FtrScreenshotFilename } from '@kbn/ftr-screenshot-filename'; import type { AnyStep } from './journey'; diff --git a/packages/kbn-journeys/kibana.jsonc b/packages/kbn-journeys/kibana.jsonc index ab8a15547c15..f27a7c228cb4 100644 --- a/packages/kbn-journeys/kibana.jsonc +++ b/packages/kbn-journeys/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/journeys", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-journeys/package.json b/packages/kbn-journeys/package.json index 728e8e8bdebd..e9404f05989a 100644 --- a/packages/kbn-journeys/package.json +++ b/packages/kbn-journeys/package.json @@ -2,7 +2,5 @@ "name": "@kbn/journeys", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-journeys/tsconfig.json b/packages/kbn-journeys/tsconfig.json index 7e77ca978f3e..461260f7364b 100644 --- a/packages/kbn-journeys/tsconfig.json +++ b/packages/kbn-journeys/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "@kbn/ambient-ftr-types", @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/ftr-common-functional-services", + "@kbn/ftr-screenshot-filename", + "@kbn/test", + "@kbn/tooling-log", + "@kbn/repo-info", + "@kbn/std", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-kibana-manifest-schema/BUILD.bazel b/packages/kbn-kibana-manifest-schema/BUILD.bazel deleted file mode 100644 index c0a8ff97d7fe..000000000000 --- a/packages/kbn-kibana-manifest-schema/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-kibana-manifest-schema" -PKG_REQUIRE_NAME = "@kbn/kibana-manifest-schema" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//dedent", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/dedent", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/json-schema", - "@npm//json-schema-typed", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-kibana-manifest-schema/kibana.jsonc b/packages/kbn-kibana-manifest-schema/kibana.jsonc index 5ddba1f9529a..e615498fe7e9 100644 --- a/packages/kbn-kibana-manifest-schema/kibana.jsonc +++ b/packages/kbn-kibana-manifest-schema/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/kibana-manifest-schema", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-kibana-manifest-schema/package.json b/packages/kbn-kibana-manifest-schema/package.json index 127b9fc74fad..16d5198ad1a3 100644 --- a/packages/kbn-kibana-manifest-schema/package.json +++ b/packages/kbn-kibana-manifest-schema/package.json @@ -2,7 +2,5 @@ "name": "@kbn/kibana-manifest-schema", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-kibana-manifest-schema/src/kibana_json_v2_schema.ts b/packages/kbn-kibana-manifest-schema/src/kibana_json_v2_schema.ts index 21b3b3b71738..71df5b4449bf 100644 --- a/packages/kbn-kibana-manifest-schema/src/kibana_json_v2_schema.ts +++ b/packages/kbn-kibana-manifest-schema/src/kibana_json_v2_schema.ts @@ -13,7 +13,7 @@ export const PLUGIN_ID_PATTERN = /^[a-z][a-zA-Z_]*$/; export const MANIFEST_V2: JSONSchema = { type: 'object', - required: ['id', 'type', 'owner', 'typeDeps', 'runtimeDeps'], + required: ['id', 'type', 'owner'], // @ts-expect-error VSCode specific JSONSchema extension allowTrailingCommas: true, properties: { @@ -47,26 +47,6 @@ export const MANIFEST_V2: JSONSchema = { For additional codeowners, the value can be an array of user/team names. `, }, - typeDeps: { - type: 'array', - description: desc` - Packages which are required for the source code in the package to be - type-checked. This list is updated automatically by the package linter. - `, - items: { - type: 'string', - }, - }, - runtimeDeps: { - type: 'array', - description: desc` - Packages which are required for the source code in the package to run. This list - is updated automatically by the package linter. - `, - items: { - type: 'string', - }, - }, devOnly: { type: 'boolean', description: desc` diff --git a/packages/kbn-kibana-manifest-schema/tsconfig.json b/packages/kbn-kibana-manifest-schema/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-kibana-manifest-schema/tsconfig.json +++ b/packages/kbn-kibana-manifest-schema/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-language-documentation-popover/BUILD.bazel b/packages/kbn-language-documentation-popover/BUILD.bazel deleted file mode 100644 index 86a6a03388a4..000000000000 --- a/packages/kbn-language-documentation-popover/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-language-documentation-popover" -PKG_REQUIRE_NAME = "@kbn/language-documentation-popover" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "@npm//@elastic/eui", - "@npm//classnames", - "@npm//prop-types", - "@npm//react", -] - -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "@npm//tslib", - "@npm//@elastic/eui", - "@npm//@types/classnames", - "@npm//@types/jest", - "@npm//@types/prop-types", - "@npm//@types/node", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_webpack", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_webpack"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_webpack", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-language-documentation-popover/kibana.jsonc b/packages/kbn-language-documentation-popover/kibana.jsonc index 45b3f21296bd..49dcff96d5f8 100644 --- a/packages/kbn-language-documentation-popover/kibana.jsonc +++ b/packages/kbn-language-documentation-popover/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/language-documentation-popover", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-language-documentation-popover/package.json b/packages/kbn-language-documentation-popover/package.json index a710551dd055..dfa1e7e4fd37 100644 --- a/packages/kbn-language-documentation-popover/package.json +++ b/packages/kbn-language-documentation-popover/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/language-documentation-popover", - "main": "./target_node/index.js", - "browser": "./target_webpack/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-language-documentation-popover/tsconfig.json b/packages/kbn-language-documentation-popover/tsconfig.json index ab59ea0429ac..82710b41d10b 100644 --- a/packages/kbn-language-documentation-popover/tsconfig.json +++ b/packages/kbn-language-documentation-popover/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,4 +11,11 @@ "**/*.ts", "**/*.tsx", ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-logging-mocks/BUILD.bazel b/packages/kbn-logging-mocks/BUILD.bazel deleted file mode 100644 index 10dcbe3f6950..000000000000 --- a/packages/kbn-logging-mocks/BUILD.bazel +++ /dev/null @@ -1,106 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-logging-mocks" -PKG_REQUIRE_NAME = "@kbn/logging-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-logging" -] - -TYPES_DEPS = [ - "//packages/kbn-logging:npm_module_types", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-logging-mocks/kibana.jsonc b/packages/kbn-logging-mocks/kibana.jsonc index 6b95f3a750f2..78fdda54a8a9 100644 --- a/packages/kbn-logging-mocks/kibana.jsonc +++ b/packages/kbn-logging-mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/logging-mocks", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-logging-mocks/package.json b/packages/kbn-logging-mocks/package.json index 30bd2b81ce50..a16fe51ba5c1 100644 --- a/packages/kbn-logging-mocks/package.json +++ b/packages/kbn-logging-mocks/package.json @@ -3,7 +3,5 @@ "version": "1.0.0", "private": true, "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-logging-mocks/tsconfig.json b/packages/kbn-logging-mocks/tsconfig.json index 57c1dd1c94e0..10cff0e73883 100644 --- a/packages/kbn-logging-mocks/tsconfig.json +++ b/packages/kbn-logging-mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/logging" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-logging/BUILD.bazel b/packages/kbn-logging/BUILD.bazel deleted file mode 100644 index d4938c14c824..000000000000 --- a/packages/kbn-logging/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-logging" -PKG_REQUIRE_NAME = "@kbn/logging" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", - "//packages/kbn-ecs" -] - -TYPES_DEPS = [ - "//packages/kbn-std:npm_module_types", - "@npm//@types/jest", - "@npm//@types/node", - "//packages/kbn-ecs:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-logging/kibana.jsonc b/packages/kbn-logging/kibana.jsonc index ab4df8442093..77e12786e908 100644 --- a/packages/kbn-logging/kibana.jsonc +++ b/packages/kbn-logging/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/logging", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-logging/package.json b/packages/kbn-logging/package.json index 837a9aab9498..7ffb4903932d 100644 --- a/packages/kbn-logging/package.json +++ b/packages/kbn-logging/package.json @@ -3,7 +3,5 @@ "version": "1.0.0", "private": true, "author": "Kibana Core", - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-logging/tsconfig.json b/packages/kbn-logging/tsconfig.json index 57c1dd1c94e0..4c2b00ad2791 100644 --- a/packages/kbn-logging/tsconfig.json +++ b/packages/kbn-logging/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/ecs", + "@kbn/std" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-managed-vscode-config-cli/BUILD.bazel b/packages/kbn-managed-vscode-config-cli/BUILD.bazel deleted file mode 100644 index a6ebbf057fc9..000000000000 --- a/packages/kbn-managed-vscode-config-cli/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-managed-vscode-config-cli" -PKG_REQUIRE_NAME = "@kbn/managed-vscode-config-cli" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//dedent", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-managed-vscode-config:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-managed-vscode-config-cli/index.ts b/packages/kbn-managed-vscode-config-cli/index.ts index deb829da7640..5b1c7cdc8426 100644 --- a/packages/kbn-managed-vscode-config-cli/index.ts +++ b/packages/kbn-managed-vscode-config-cli/index.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fsp from 'fs/promises'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import dedent from 'dedent'; import { run } from '@kbn/dev-cli-runner'; diff --git a/packages/kbn-managed-vscode-config-cli/kibana.jsonc b/packages/kbn-managed-vscode-config-cli/kibana.jsonc index 1cbb5cb7ce7c..3ca5963ba3b9 100644 --- a/packages/kbn-managed-vscode-config-cli/kibana.jsonc +++ b/packages/kbn-managed-vscode-config-cli/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/managed-vscode-config-cli", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-managed-vscode-config-cli/package.json b/packages/kbn-managed-vscode-config-cli/package.json index ad22c98077e2..dd2b5fabee94 100644 --- a/packages/kbn-managed-vscode-config-cli/package.json +++ b/packages/kbn-managed-vscode-config-cli/package.json @@ -2,7 +2,5 @@ "name": "@kbn/managed-vscode-config-cli", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-managed-vscode-config-cli/tsconfig.json b/packages/kbn-managed-vscode-config-cli/tsconfig.json index 57c1dd1c94e0..e5ff31a29b3f 100644 --- a/packages/kbn-managed-vscode-config-cli/tsconfig.json +++ b/packages/kbn-managed-vscode-config-cli/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-runner", + "@kbn/managed-vscode-config", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-managed-vscode-config/BUILD.bazel b/packages/kbn-managed-vscode-config/BUILD.bazel deleted file mode 100644 index 1225a95d6c3f..000000000000 --- a/packages/kbn-managed-vscode-config/BUILD.bazel +++ /dev/null @@ -1,128 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-managed-vscode-config" -PKG_REQUIRE_NAME = "@kbn/managed-vscode-config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@babel/parser", - "@npm//@babel/types", - "@npm//@types/babel__generator", - "@npm//@types/prettier", - "@npm//tslib", - "//packages/kbn-kibana-manifest-schema:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-managed-vscode-config/kibana.jsonc b/packages/kbn-managed-vscode-config/kibana.jsonc index c973127eb548..ce565e9ed301 100644 --- a/packages/kbn-managed-vscode-config/kibana.jsonc +++ b/packages/kbn-managed-vscode-config/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/managed-vscode-config", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-managed-vscode-config/package.json b/packages/kbn-managed-vscode-config/package.json index 9e260b8a64a5..951b90336351 100644 --- a/packages/kbn-managed-vscode-config/package.json +++ b/packages/kbn-managed-vscode-config/package.json @@ -2,7 +2,5 @@ "name": "@kbn/managed-vscode-config", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-managed-vscode-config/tsconfig.json b/packages/kbn-managed-vscode-config/tsconfig.json index 57c1dd1c94e0..d57e4bb9718b 100644 --- a/packages/kbn-managed-vscode-config/tsconfig.json +++ b/packages/kbn-managed-vscode-config/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/kibana-manifest-schema" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-mapbox-gl/BUILD.bazel b/packages/kbn-mapbox-gl/BUILD.bazel deleted file mode 100644 index d72e79f8f539..000000000000 --- a/packages/kbn-mapbox-gl/BUILD.bazel +++ /dev/null @@ -1,118 +0,0 @@ - -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-mapbox-gl" -PKG_REQUIRE_NAME = "@kbn/mapbox-gl" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "@npm//@mapbox/mapbox-gl-rtl-text", - "@npm//file-loader", - "@npm//maplibre-gl", -] - -TYPES_DEPS = [ - "@npm//@mapbox/mapbox-gl-rtl-text", - "@npm//file-loader", - "@npm//maplibre-gl", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-mapbox-gl/kibana.jsonc b/packages/kbn-mapbox-gl/kibana.jsonc index 35ffb25b0b11..4238b33f6aef 100644 --- a/packages/kbn-mapbox-gl/kibana.jsonc +++ b/packages/kbn-mapbox-gl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/mapbox-gl", - "owner": "@elastic/kibana-gis", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-gis" } diff --git a/packages/kbn-mapbox-gl/package.json b/packages/kbn-mapbox-gl/package.json index e21ea665ef26..f791e3d3b5f2 100644 --- a/packages/kbn-mapbox-gl/package.json +++ b/packages/kbn-mapbox-gl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/mapbox-gl", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-mapbox-gl/tsconfig.json b/packages/kbn-mapbox-gl/tsconfig.json index 6a59fac1e024..225d37d8136e 100644 --- a/packages/kbn-mapbox-gl/tsconfig.json +++ b/packages/kbn-mapbox-gl/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index 35da648bccb5..8d13702e7458 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -1,15 +1,11 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") +load("@npm//webpack-cli:index.bzl", "webpack_cli") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-monaco" -PKG_REQUIRE_NAME = "@kbn/monaco" - -SOURCE_FILES = glob( +SRCS = glob( [ "src/**/*", - "**/*.ts", + "index.ts", + "server.ts", ], exclude = [ "**/*.config.js", @@ -27,59 +23,24 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-babel-preset", +SHARED_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-ui-theme", - "@npm//@babel/runtime", "@npm//antlr4ts", - "@npm//babel-loader", "@npm//monaco-editor", "@npm//monaco-yaml", - "@npm//raw-loader", - "@npm//rxjs", ] -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ui-theme:npm_module_types", - "@npm//antlr4ts", - "@npm//monaco-editor", - "@npm//rxjs", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -webpack( +webpack_cli( name = "target_workers", - data = RUNTIME_DEPS + [ - ":src", + data = SRCS + SHARED_DEPS + [ + "//:.browserslistrc", + "//packages/kbn-babel-preset", + "@npm//@babel/runtime", + "@npm//babel-loader", + "@npm//raw-loader", + "@npm//rxjs", + "webpack.config.js", ], output_dir = True, @@ -90,61 +51,23 @@ webpack( "$(@D)", "--env", "prod", - "--no-stats" + "--stats=errors-only" ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":target_workers"], - package_name = PKG_REQUIRE_NAME, + env = select({ + "//:dist": { + "NODE_ENV": "production", + }, + "//conditions:default": { + "NODE_ENV": "development", + }, + }), visibility = ["//visibility:public"], ) js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":target_workers", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-monaco", + package_name = "@kbn/monaco", + srcs = ["package.json"] + SRCS, + deps = SHARED_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-monaco/index.ts b/packages/kbn-monaco/index.ts index a2c4d18b57cf..057ea84d0709 100644 --- a/packages/kbn-monaco/index.ts +++ b/packages/kbn-monaco/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -// global setup for supported languages import './src/register_globals'; export { monaco } from './src/monaco_imports'; diff --git a/packages/kbn-monaco/kibana.jsonc b/packages/kbn-monaco/kibana.jsonc index 0634c00ae6f7..c258ae7584a5 100644 --- a/packages/kbn-monaco/kibana.jsonc +++ b/packages/kbn-monaco/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/monaco", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index 05717e4922a6..fc546d73017c 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -2,14 +2,10 @@ "name": "@kbn/monaco", "version": "1.0.0", "private": true, - "browser": "target_web/index.js", - "main": "target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0", "scripts": { "build:antlr4ts:painless": "../../node_modules/antlr4ts-cli/antlr4ts ./src/painless/antlr/painless_lexer.g4 ./src/painless/antlr/painless_parser.g4 && node ./scripts/fix_generated_antlr.js painless", "build:antlr4ts:esql": "../../node_modules/antlr4ts-cli/antlr4ts src/esql/antlr/esql_lexer.g4 src/esql/antlr/esql_parser.g4 && node ./scripts/fix_generated_antlr.js esql", "build:antlr4ts": "npm run build:antlr4ts:painless && npm run build:antlr4ts:esql" - - }, - "types": "./target_types/index.d.ts" + } } diff --git a/packages/kbn-monaco/server.ts b/packages/kbn-monaco/server.ts new file mode 100644 index 000000000000..71313c13d543 --- /dev/null +++ b/packages/kbn-monaco/server.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import Fs from 'fs'; + +import { REPO_ROOT } from '@kbn/repo-info'; + +const localBundles = Path.resolve(__dirname, './target_workers'); +const bazelBundles = Path.resolve(REPO_ROOT, 'bazel-bin', Path.relative(REPO_ROOT, localBundles)); + +// extracted const vars +export const bundleDir = Fs.existsSync(localBundles) ? localBundles : bazelBundles; diff --git a/packages/kbn-monaco/src/register_globals.ts b/packages/kbn-monaco/src/register_globals.ts index 7754b140305a..ad5645df31be 100644 --- a/packages/kbn-monaco/src/register_globals.ts +++ b/packages/kbn-monaco/src/register_globals.ts @@ -12,43 +12,15 @@ import { SQLLang } from './sql'; import { monaco } from './monaco_imports'; import { ESQL_THEME_ID, ESQLLang, buildESQlTheme } from './esql'; import { registerLanguage, registerTheme } from './helpers'; -import { createWorkersRegistry } from './workers_registry'; export const DEFAULT_WORKER_ID = 'default'; - -const Yaml = 'yaml'; - -const workerRegistry = createWorkersRegistry(DEFAULT_WORKER_ID); - -workerRegistry.register( - DEFAULT_WORKER_ID, - async () => await import('!!raw-loader!../../target_workers/default.editor.worker.js') -); - -workerRegistry.register( +const langSpecificWorkerIds = [ XJsonLang.ID, - async () => await import('!!raw-loader!../../target_workers/xjson.editor.worker.js') -); - -workerRegistry.register( PainlessLang.ID, - async () => await import('!!raw-loader!../../target_workers/painless.editor.worker.js') -); - -workerRegistry.register( ESQLLang.ID, - async () => await import('!!raw-loader!../../target_workers/esql.editor.worker.js') -); - -workerRegistry.register( monaco.languages.json.jsonDefaults.languageId, - async () => await import('!!raw-loader!../../target_workers/json.editor.worker.js') -); - -workerRegistry.register( - Yaml, - async () => await import('!!raw-loader!../../target_workers/yaml.editor.worker.js') -); + 'yaml', +]; /** * Register languages and lexer rules @@ -63,9 +35,18 @@ registerLanguage(ESQLLang); */ registerTheme(ESQL_THEME_ID, buildESQlTheme()); +const monacoBundleDir = (window as any).__kbnPublicPath__?.['kbn-monaco']; + // @ts-ignore window.MonacoEnvironment = { // needed for functional tests so that we can get value from 'editor' monaco, - getWorker: workerRegistry.getWorker, + getWorkerUrl: monacoBundleDir + ? (_: string, languageId: string) => { + const workerId = langSpecificWorkerIds.includes(languageId) + ? languageId + : DEFAULT_WORKER_ID; + return `${monacoBundleDir}${workerId}.editor.worker.js`; + } + : () => undefined, }; diff --git a/packages/kbn-monaco/src/workers_registry.ts b/packages/kbn-monaco/src/workers_registry.ts deleted file mode 100644 index 474e531dee55..000000000000 --- a/packages/kbn-monaco/src/workers_registry.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export const createWorkersRegistry = (defaultWorkerId: string) => { - const registry = new Map Promise>(); - - return { - register: (languageId: string, getWorkerSrc: () => Promise) => { - registry.set(languageId, getWorkerSrc); - }, - - getWorker: async (module: string, languageId: string) => { - const getWorkerSrc = registry.get(languageId) || registry.get(defaultWorkerId); - if (getWorkerSrc) { - const src = await getWorkerSrc(); - - const blob = new Blob([src.default], { type: 'application/javascript' }); - return new Worker(URL.createObjectURL(blob)); - } else { - throw new Error(`Worker for ${languageId} is not registered`); - } - }, - }; -}; - -export type WorkersRegistry = ReturnType; diff --git a/packages/kbn-monaco/tsconfig.json b/packages/kbn-monaco/tsconfig.json index abba6736b0c2..f6ce023d74c6 100644 --- a/packages/kbn-monaco/tsconfig.json +++ b/packages/kbn-monaco/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,6 +9,24 @@ }, "include": [ "src/**/*", - "**/*.ts" + "**/*.ts", + "src/painless/autocomplete_definitions/boolean_script_field_script_field.json", + "src/painless/autocomplete_definitions/common.json", + "src/painless/autocomplete_definitions/date_script_field.json", + "src/painless/autocomplete_definitions/double_script_field_script_field.json", + "src/painless/autocomplete_definitions/filter.json", + "src/painless/autocomplete_definitions/ip_script_field_script_field.json", + "src/painless/autocomplete_definitions/long_script_field_script_field.json", + "src/painless/autocomplete_definitions/processor_conditional.json", + "src/painless/autocomplete_definitions/score.json", + "src/painless/autocomplete_definitions/string_script_field_script_field.json", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/repo-info", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-monaco/webpack.config.js b/packages/kbn-monaco/webpack.config.js index f15f48ac10da..7d5d137a65b9 100644 --- a/packages/kbn-monaco/webpack.config.js +++ b/packages/kbn-monaco/webpack.config.js @@ -22,8 +22,9 @@ const getWorkerEntry = (language) => { }; const getWorkerConfig = (language) => ({ - mode: 'production', + mode: process.env.NODE_ENV || 'development', entry: getWorkerEntry(language), + devtool: process.env.NODE_ENV === 'production' ? false : '#cheap-source-map', output: { path: path.resolve(__dirname, 'target_workers'), filename: `${language}.editor.worker.js`, @@ -35,12 +36,13 @@ const getWorkerConfig = (language) => ({ module: { rules: [ { - test: /\.(js|ts)$/, - exclude: /node_modules/, + test: /\.(jsx?|tsx?)$/, + exclude: /node_modules(?!\/@kbn\/)(\/[^\/]+\/)/, use: { loader: 'babel-loader', options: { babelrc: false, + envName: process.env.NODE_ENV || 'development', presets: [require.resolve('@kbn/babel-preset/webpack_preset')], }, }, diff --git a/packages/kbn-optimizer-webpack-helpers/BUILD.bazel b/packages/kbn-optimizer-webpack-helpers/BUILD.bazel deleted file mode 100644 index e0a5d2fda7e2..000000000000 --- a/packages/kbn-optimizer-webpack-helpers/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-optimizer-webpack-helpers" -PKG_REQUIRE_NAME = "@kbn/optimizer-webpack-helpers" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/webpack", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-optimizer-webpack-helpers/kibana.jsonc b/packages/kbn-optimizer-webpack-helpers/kibana.jsonc index 102818ed032c..1fa8375008f2 100644 --- a/packages/kbn-optimizer-webpack-helpers/kibana.jsonc +++ b/packages/kbn-optimizer-webpack-helpers/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/optimizer-webpack-helpers", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-optimizer-webpack-helpers/package.json b/packages/kbn-optimizer-webpack-helpers/package.json index 52f873cc9ee8..b8e220880e41 100644 --- a/packages/kbn-optimizer-webpack-helpers/package.json +++ b/packages/kbn-optimizer-webpack-helpers/package.json @@ -2,7 +2,5 @@ "name": "@kbn/optimizer-webpack-helpers", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-optimizer-webpack-helpers/tsconfig.json b/packages/kbn-optimizer-webpack-helpers/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-optimizer-webpack-helpers/tsconfig.json +++ b/packages/kbn-optimizer-webpack-helpers/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-optimizer/BUILD.bazel b/packages/kbn-optimizer/BUILD.bazel deleted file mode 100644 index 0af9dff2a58e..000000000000 --- a/packages/kbn-optimizer/BUILD.bazel +++ /dev/null @@ -1,169 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-optimizer" -PKG_REQUIRE_NAME = "@kbn/optimizer" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "limits.yml", - "package.json", - "postcss.config.js", -] - -RUNTIME_DEPS = [ - "//packages/kbn-config", - "//packages/kbn-config-schema", - "//packages/kbn-dev-utils", - "//packages/kbn-std", - "//packages/kbn-ui-shared-deps-npm", - "//packages/kbn-ui-shared-deps-src", - "//packages/kbn-utils", - "//packages/kbn-synthetic-package-map", - "//packages/kbn-peggy", - "@npm//@babel/core", - "@npm//chalk", - "@npm//clean-webpack-plugin", - "@npm//compression-webpack-plugin", - "@npm//cpy", - "@npm//dedent", - "@npm//del", - "@npm//execa", - "@npm//json-stable-stringify", - "@npm//js-yaml", - "@npm//lmdb", - "@npm//loader-utils", - "@npm//node-sass", - "@npm//normalize-path", - "@npm//pirates", - "@npm//rxjs", - "@npm//source-map-support", - "@npm//watchpack", - "@npm//webpack", - "@npm//webpack-merge", - "@npm//webpack-sources", -] - -TYPES_DEPS = [ - "//packages/kbn-config:npm_module_types", - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-optimizer-webpack-helpers:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-ui-shared-deps-src:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-synthetic-package-map:npm_module_types", - "//packages/kbn-peggy:npm_module_types", - "@npm//chalk", - "@npm//clean-webpack-plugin", - "@npm//cpy", - "@npm//del", - "@npm//execa", - "@npm//lmdb", - "@npm//pirates", - "@npm//rxjs", - "@npm//@types/babel__core", - "@npm//@types/compression-webpack-plugin", - "@npm//@types/dedent", - "@npm//@types/jest", - "@npm//@types/json-stable-stringify", - "@npm//@types/js-yaml", - "@npm//@types/loader-utils", - "@npm//@types/node", - "@npm//@types/normalize-path", - "@npm//@types/source-map-support", - "@npm//@types/watchpack", - "@npm//@types/webpack", - "@npm//@types/webpack-merge", - "@npm//@types/webpack-sources", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-optimizer/index.ts b/packages/kbn-optimizer/index.ts index 0252e47ab35c..ca82995c857b 100644 --- a/packages/kbn-optimizer/index.ts +++ b/packages/kbn-optimizer/index.ts @@ -10,7 +10,6 @@ export { OptimizerConfig } from './src/optimizer'; export * from './src/run_optimizer'; export * from './src/log_optimizer_state'; export * from './src/log_optimizer_progress'; -export * from './src/node'; export * from './src/limits'; export * from './src/cli'; export * from './src/report_optimizer_timings'; diff --git a/packages/kbn-optimizer/kibana.jsonc b/packages/kbn-optimizer/kibana.jsonc index 945fdc1e0366..1e912e055844 100644 --- a/packages/kbn-optimizer/kibana.jsonc +++ b/packages/kbn-optimizer/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/optimizer", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-optimizer/package.json b/packages/kbn-optimizer/package.json index 488e1b5dbfde..06d47a19f1dd 100644 --- a/packages/kbn-optimizer/package.json +++ b/packages/kbn-optimizer/package.json @@ -2,7 +2,5 @@ "name": "@kbn/optimizer", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_babel_runtime_helpers_in_entry_bundles.ts b/packages/kbn-optimizer/src/audit_bundle_dependencies/find_babel_runtime_helpers_in_entry_bundles.ts index 384647686948..00e18666d90b 100644 --- a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_babel_runtime_helpers_in_entry_bundles.ts +++ b/packages/kbn-optimizer/src/audit_bundle_dependencies/find_babel_runtime_helpers_in_entry_bundles.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { OptimizerConfig } from '../optimizer'; import { parseStats, inAnyEntryChunk } from './parse_stats'; diff --git a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_node_libs_browser_polyfills_in_entry_bundles.ts b/packages/kbn-optimizer/src/audit_bundle_dependencies/find_node_libs_browser_polyfills_in_entry_bundles.ts index 4d283e95b1f6..691a67a7f1cb 100644 --- a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_node_libs_browser_polyfills_in_entry_bundles.ts +++ b/packages/kbn-optimizer/src/audit_bundle_dependencies/find_node_libs_browser_polyfills_in_entry_bundles.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { OptimizerConfig } from '../optimizer'; import { parseStats, inAnyEntryChunk } from './parse_stats'; diff --git a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_target_node_imports.ts b/packages/kbn-optimizer/src/audit_bundle_dependencies/find_target_node_imports.ts deleted file mode 100644 index 6021950cdb40..000000000000 --- a/packages/kbn-optimizer/src/audit_bundle_dependencies/find_target_node_imports.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; - -import { OptimizerConfig } from '../optimizer'; -import { parseStats } from './parse_stats'; - -/** - * Analyzes the bundle dependencies to find any imports using the `@kbn//target_node` build target. - * - * We should aim for those packages to be imported using the `@kbn//target_web` build because it's optimized - * for browser compatibility. - * - * This utility also helps identify when code that should only run in the server is leaked into the browser. - */ -export async function runFindTargetNodeImportsCli() { - run(async ({ log }) => { - const config = OptimizerConfig.create({ - includeCoreBundle: true, - repoRoot: REPO_ROOT, - }); - - const paths = config.bundles.map((b) => Path.resolve(b.outputDir, 'stats.json')); - - log.info('analyzing', paths.length, 'stats files'); - log.verbose(paths); - - const imports = new Set(); - for (const path of paths) { - const stats = parseStats(path); - - for (const module of stats.modules) { - if (module.name.includes('/target_node/')) { - const [, cleanName] = /\/((?:kbn-|@kbn\/).+)\/target_node/.exec(module.name) ?? []; - imports.add(cleanName || module.name); - } - } - } - - log.success('found', imports.size, '@kbn/*/target_node imports in entry bundles and chunks'); - log.write( - Array.from(imports, (i) => `'${i}',`) - .sort() - .join('\n') - ); - }); -} diff --git a/packages/kbn-optimizer/src/audit_bundle_dependencies/index.ts b/packages/kbn-optimizer/src/audit_bundle_dependencies/index.ts index e6059c4c2c9b..3a7987f867bc 100644 --- a/packages/kbn-optimizer/src/audit_bundle_dependencies/index.ts +++ b/packages/kbn-optimizer/src/audit_bundle_dependencies/index.ts @@ -8,4 +8,3 @@ export * from './find_babel_runtime_helpers_in_entry_bundles'; export * from './find_node_libs_browser_polyfills_in_entry_bundles'; -export * from './find_target_node_imports'; diff --git a/packages/kbn-optimizer/src/cli.ts b/packages/kbn-optimizer/src/cli.ts index 974bd4dbbcbc..b0732e931e04 100644 --- a/packages/kbn-optimizer/src/cli.ts +++ b/packages/kbn-optimizer/src/cli.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { lastValueFrom } from 'rxjs'; import { run, Flags } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts index fdd36c76f6e4..1e84f4443b37 100644 --- a/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts +++ b/packages/kbn-optimizer/src/integration_tests/basic_optimization.test.ts @@ -15,7 +15,7 @@ import prettier from 'prettier'; import cpy from 'cpy'; import del from 'del'; import { tap, filter } from 'rxjs/operators'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; import { createReplaceSerializer } from '@kbn/jest-serializers'; import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '../..'; @@ -134,13 +134,13 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { expect(foo.cache.getModuleCount()).toBe(6); expect(foo.cache.getReferencedPaths()).toMatchInlineSnapshot(` Array [ - /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/bazel-out/-fastbuild/bin/packages/kbn-ui-shared-deps-npm/target_node/src/public_path_module_creator.js, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/kibana.json, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/async_import.ts, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/ext.ts, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts, /packages/kbn-optimizer/src/worker/entry_point_creator.ts, + /packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js, ] `); @@ -154,10 +154,9 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { expect(bar.cache.getReferencedPaths()).toMatchInlineSnapshot(` Array [ - /node_modules/@kbn/optimizer/postcss.config.js, /node_modules/css-loader/package.json, /node_modules/style-loader/package.json, - /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/bazel-out/-fastbuild/bin/packages/kbn-ui-shared-deps-npm/target_node/src/public_path_module_creator.js, + /packages/kbn-optimizer/postcss.config.js, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/kibana.json, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.scss, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.ts, @@ -167,6 +166,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/styles/core_app/_globals_v8dark.scss, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/styles/core_app/_globals_v8light.scss, /packages/kbn-optimizer/src/worker/entry_point_creator.ts, + /packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js, ] `); @@ -177,10 +177,10 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { expect(baz.cache.getReferencedPaths()).toMatchInlineSnapshot(` Array [ - /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/bazel-out/-fastbuild/bin/packages/kbn-ui-shared-deps-npm/target_node/src/public_path_module_creator.js, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/x-pack/baz/kibana.json, /packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/x-pack/baz/public/index.ts, /packages/kbn-optimizer/src/worker/entry_point_creator.ts, + /packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js, ] `); }); diff --git a/packages/kbn-optimizer/src/integration_tests/optimizer_built_paths.test.ts b/packages/kbn-optimizer/src/integration_tests/optimizer_built_paths.test.ts index 1810f40e0fa3..2c4f130ce949 100644 --- a/packages/kbn-optimizer/src/integration_tests/optimizer_built_paths.test.ts +++ b/packages/kbn-optimizer/src/integration_tests/optimizer_built_paths.test.ts @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -// @ts-expect-error -import { getOptimizerBuiltPaths } from '@kbn/optimizer/target_node/src/optimizer/optimizer_built_paths'; +import { getOptimizerBuiltPaths } from '../optimizer/optimizer_built_paths'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; expect.addSnapshotSerializer(createAbsolutePathSerializer()); @@ -16,56 +15,56 @@ it(`finds all the optimizer files relative to it's path`, async () => { const paths = await getOptimizerBuiltPaths(); expect(paths).toMatchInlineSnapshot(` Array [ - /node_modules/@kbn/optimizer/target_node/src/cli.js, - /node_modules/@kbn/optimizer/target_node/src/common/array_helpers.js, - /node_modules/@kbn/optimizer/target_node/src/common/bundle_cache.js, - /node_modules/@kbn/optimizer/target_node/src/common/bundle_refs.js, - /node_modules/@kbn/optimizer/target_node/src/common/bundle.js, - /node_modules/@kbn/optimizer/target_node/src/common/compiler_messages.js, - /node_modules/@kbn/optimizer/target_node/src/common/dll_manifest.js, - /node_modules/@kbn/optimizer/target_node/src/common/event_stream_helpers.js, - /node_modules/@kbn/optimizer/target_node/src/common/hashes.js, - /node_modules/@kbn/optimizer/target_node/src/common/index.js, - /node_modules/@kbn/optimizer/target_node/src/common/obj_helpers.js, - /node_modules/@kbn/optimizer/target_node/src/common/parse_path.js, - /node_modules/@kbn/optimizer/target_node/src/common/rxjs_helpers.js, - /node_modules/@kbn/optimizer/target_node/src/common/theme_tags.js, - /node_modules/@kbn/optimizer/target_node/src/common/ts_helpers.js, - /node_modules/@kbn/optimizer/target_node/src/common/worker_config.js, - /node_modules/@kbn/optimizer/target_node/src/common/worker_messages.js, - /node_modules/@kbn/optimizer/target_node/src/limits.js, - /node_modules/@kbn/optimizer/target_node/src/log_optimizer_progress.js, - /node_modules/@kbn/optimizer/target_node/src/log_optimizer_state.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/assign_bundles_to_workers.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/bundle_cache.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/diff_cache_key.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/filter_by_id.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/focus_bundles.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/get_plugin_bundles.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/handle_optimizer_completion.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/index.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/kibana_platform_plugins.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/observe_stdio.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/observe_worker.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/optimizer_built_paths.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/optimizer_cache_key.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/optimizer_config.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/optimizer_state.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/run_workers.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/watch_bundles_for_changes.js, - /node_modules/@kbn/optimizer/target_node/src/optimizer/watcher.js, - /node_modules/@kbn/optimizer/target_node/src/report_optimizer_timings.js, - /node_modules/@kbn/optimizer/target_node/src/run_optimizer.js, - /node_modules/@kbn/optimizer/target_node/src/worker/bundle_metrics_plugin.js, - /node_modules/@kbn/optimizer/target_node/src/worker/bundle_ref_module.js, - /node_modules/@kbn/optimizer/target_node/src/worker/bundle_refs_plugin.js, - /node_modules/@kbn/optimizer/target_node/src/worker/emit_stats_plugin.js, - /node_modules/@kbn/optimizer/target_node/src/worker/entry_point_creator.js, - /node_modules/@kbn/optimizer/target_node/src/worker/populate_bundle_cache_plugin.js, - /node_modules/@kbn/optimizer/target_node/src/worker/run_compilers.js, - /node_modules/@kbn/optimizer/target_node/src/worker/run_worker.js, - /node_modules/@kbn/optimizer/target_node/src/worker/theme_loader.js, - /node_modules/@kbn/optimizer/target_node/src/worker/webpack.config.js, + /packages/kbn-optimizer/src/cli.ts, + /packages/kbn-optimizer/src/common/array_helpers.ts, + /packages/kbn-optimizer/src/common/bundle_cache.ts, + /packages/kbn-optimizer/src/common/bundle_refs.ts, + /packages/kbn-optimizer/src/common/bundle.ts, + /packages/kbn-optimizer/src/common/compiler_messages.ts, + /packages/kbn-optimizer/src/common/dll_manifest.ts, + /packages/kbn-optimizer/src/common/event_stream_helpers.ts, + /packages/kbn-optimizer/src/common/hashes.ts, + /packages/kbn-optimizer/src/common/index.ts, + /packages/kbn-optimizer/src/common/obj_helpers.ts, + /packages/kbn-optimizer/src/common/parse_path.ts, + /packages/kbn-optimizer/src/common/rxjs_helpers.ts, + /packages/kbn-optimizer/src/common/theme_tags.ts, + /packages/kbn-optimizer/src/common/ts_helpers.ts, + /packages/kbn-optimizer/src/common/worker_config.ts, + /packages/kbn-optimizer/src/common/worker_messages.ts, + /packages/kbn-optimizer/src/limits.ts, + /packages/kbn-optimizer/src/log_optimizer_progress.ts, + /packages/kbn-optimizer/src/log_optimizer_state.ts, + /packages/kbn-optimizer/src/optimizer/assign_bundles_to_workers.ts, + /packages/kbn-optimizer/src/optimizer/bundle_cache.ts, + /packages/kbn-optimizer/src/optimizer/diff_cache_key.ts, + /packages/kbn-optimizer/src/optimizer/filter_by_id.ts, + /packages/kbn-optimizer/src/optimizer/focus_bundles.ts, + /packages/kbn-optimizer/src/optimizer/get_plugin_bundles.ts, + /packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.ts, + /packages/kbn-optimizer/src/optimizer/index.ts, + /packages/kbn-optimizer/src/optimizer/kibana_platform_plugins.ts, + /packages/kbn-optimizer/src/optimizer/observe_stdio.ts, + /packages/kbn-optimizer/src/optimizer/observe_worker.ts, + /packages/kbn-optimizer/src/optimizer/optimizer_built_paths.ts, + /packages/kbn-optimizer/src/optimizer/optimizer_cache_key.ts, + /packages/kbn-optimizer/src/optimizer/optimizer_config.ts, + /packages/kbn-optimizer/src/optimizer/optimizer_state.ts, + /packages/kbn-optimizer/src/optimizer/run_workers.ts, + /packages/kbn-optimizer/src/optimizer/watch_bundles_for_changes.ts, + /packages/kbn-optimizer/src/optimizer/watcher.ts, + /packages/kbn-optimizer/src/report_optimizer_timings.ts, + /packages/kbn-optimizer/src/run_optimizer.ts, + /packages/kbn-optimizer/src/worker/bundle_metrics_plugin.ts, + /packages/kbn-optimizer/src/worker/bundle_ref_module.ts, + /packages/kbn-optimizer/src/worker/bundle_refs_plugin.ts, + /packages/kbn-optimizer/src/worker/emit_stats_plugin.ts, + /packages/kbn-optimizer/src/worker/entry_point_creator.ts, + /packages/kbn-optimizer/src/worker/populate_bundle_cache_plugin.ts, + /packages/kbn-optimizer/src/worker/run_compilers.ts, + /packages/kbn-optimizer/src/worker/run_worker.ts, + /packages/kbn-optimizer/src/worker/theme_loader.ts, + /packages/kbn-optimizer/src/worker/webpack.config.ts, ] `); }); diff --git a/packages/kbn-optimizer/src/node/cache.ts b/packages/kbn-optimizer/src/node/cache.ts deleted file mode 100644 index bb7a65090c54..000000000000 --- a/packages/kbn-optimizer/src/node/cache.ts +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import { Writable } from 'stream'; - -import chalk from 'chalk'; -import * as LmdbStore from 'lmdb'; - -const GLOBAL_ATIME = `${Date.now()}`; -const MINUTE = 1000 * 60; -const HOUR = MINUTE * 60; -const DAY = HOUR * 24; - -const dbName = (db: LmdbStore.Database) => - // @ts-expect-error db.name is not a documented/typed property - db.name; - -export class Cache { - private readonly codes: LmdbStore.RootDatabase; - private readonly atimes: LmdbStore.Database; - private readonly mtimes: LmdbStore.Database; - private readonly sourceMaps: LmdbStore.Database; - private readonly pathRoot: string; - private readonly prefix: string; - private readonly log?: Writable; - private readonly timer: NodeJS.Timer; - - constructor(config: { pathRoot: string; dir: string; prefix: string; log?: Writable }) { - if (!Path.isAbsolute(config.pathRoot)) { - throw new Error('cache requires an absolute path to resolve paths relative to'); - } - - this.pathRoot = config.pathRoot; - this.prefix = config.prefix; - this.log = config.log; - - this.codes = LmdbStore.open(config.dir, { - name: 'codes', - encoding: 'string', - maxReaders: 500, - overlappingSync: false, - noSync: true, - noMetaSync: true, - noMemInit: true, - }); - - // TODO: redundant 'name' syntax is necessary because of a bug that I have yet to fix - this.atimes = this.codes.openDB('atimes', { - name: 'atimes', - encoding: 'string', - }); - - this.mtimes = this.codes.openDB('mtimes', { - name: 'mtimes', - encoding: 'string', - }); - - this.sourceMaps = this.codes.openDB('sourceMaps', { - name: 'sourceMaps', - encoding: 'string', - }); - - // after the process has been running for 30 minutes prune the - // keys which haven't been used in 30 days. We use `unref()` to - // make sure this timer doesn't hold other processes open - // unexpectedly - this.timer = setTimeout(async () => { - await this.pruneOldKeys(); - }, 30 * MINUTE); - - // timer.unref is not defined in jest which emulates the dom by default - if (typeof this.timer.unref === 'function') { - this.timer.unref(); - } - } - - getMtime(path: string) { - return this.safeGet(this.mtimes, this.getKey(path)); - } - - getCode(path: string) { - const key = this.getKey(path); - const code = this.safeGet(this.codes, key); - - if (code !== undefined) { - // when we use a file from the cache set the "atime" of that cache entry - // so that we know which cache items we use and which haven't been - // touched in a long time (currently 30 days) - this.safePut(this.atimes, key, GLOBAL_ATIME); - } - - return code; - } - - getSourceMap(path: string) { - const map = this.safeGet(this.sourceMaps, this.getKey(path)); - if (typeof map === 'string') { - return JSON.parse(map); - } - } - - close() { - clearTimeout(this.timer); - } - - async update(path: string, file: { mtime: string; code: string; map?: any }) { - const key = this.getKey(path); - - this.safePut(this.atimes, key, GLOBAL_ATIME); - this.safePut(this.mtimes, key, file.mtime); - this.safePut(this.codes, key, file.code); - - if (file.map != null) { - this.safePut(this.sourceMaps, key, JSON.stringify(file.map)); - } - } - - private getKey(path: string) { - const normalizedPath = - Path.sep !== '/' - ? Path.relative(this.pathRoot, path).split(Path.sep).join('/') - : Path.relative(this.pathRoot, path); - - return `${this.prefix}:${normalizedPath}`; - } - - private safeGet(db: LmdbStore.Database, key: string) { - try { - const value = db.get(key); - this.debug(value === undefined ? 'MISS' : 'HIT', db, key); - return value; - } catch (error) { - this.logError('GET', db, key, error); - } - } - - private safePut(db: LmdbStore.Database, key: string, value: V) { - try { - db.putSync(key, value); - this.debug('PUT', db, key); - } catch (error) { - this.logError('PUT', db, key, error); - } - } - - private debug(type: string, db: LmdbStore.Database, key: LmdbStore.Key) { - if (this.log) { - this.log.write(`${type} [${dbName(db)}] ${String(key)}\n`); - } - } - - private logError(type: 'GET' | 'PUT', db: LmdbStore.Database, key: LmdbStore.Key, error: Error) { - this.debug(`ERROR/${type}`, db, `${String(key)}: ${error.stack}`); - process.stderr.write( - chalk.red( - `[@kbn/optimizer/node] ${type} error [${dbName(db)}/${String(key)}]: ${error.stack}\n` - ) - ); - } - - private async pruneOldKeys() { - try { - const ATIME_LIMIT = Date.now() - 30 * DAY; - const BATCH_SIZE = 1000; - - const validKeys: string[] = []; - const invalidKeys: string[] = []; - - for (const { key, value } of this.atimes.getRange()) { - const atime = parseInt(`${value}`, 10); - if (Number.isNaN(atime) || atime < ATIME_LIMIT) { - invalidKeys.push(key); - } else { - validKeys.push(key); - } - - if (validKeys.length + invalidKeys.length >= BATCH_SIZE) { - const promises = new Set(); - - if (invalidKeys.length) { - for (const k of invalidKeys) { - // all these promises are the same currently, so Set() will - // optimise this to a single promise, but I wouldn't be shocked - // if a future version starts returning independent promises so - // this is just for some future-proofing - promises.add(this.atimes.remove(k)); - promises.add(this.mtimes.remove(k)); - promises.add(this.codes.remove(k)); - promises.add(this.sourceMaps.remove(k)); - } - } else { - // delay a smidge to allow other things to happen before the next batch of checks - promises.add(new Promise((resolve) => setTimeout(resolve, 1))); - } - - invalidKeys.length = 0; - validKeys.length = 0; - await Promise.all(Array.from(promises)); - } - } - } catch { - // ignore errors, the cache is totally disposable and will rebuild if there is some sort of corruption - } - } -} diff --git a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts b/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts deleted file mode 100644 index ad739bdd4882..000000000000 --- a/packages/kbn-optimizer/src/node/node_auto_tranpilation.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* eslint-disable @kbn/eslint/require-license-header */ - -/** - * This module is based on @babel/register @ 9808d25, modified to use - * a more efficient caching implementation which writes to disk as - * the cache is built rather than keeping the whole cache in memory - * and then dumping it to disk when the process exits. - */ - -/** - * @notice - * MIT License - * - * Copyright (c) 2014-present Sebastian McKenzie and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -import Fs from 'fs'; -import Path from 'path'; -import Crypto from 'crypto'; - -import { version as babelVersion } from '@babel/core'; -import { VERSION as peggyVersion } from '@kbn/peggy'; -import { addHook } from 'pirates'; -import { REPO_ROOT, UPSTREAM_BRANCH } from '@kbn/utils'; -import sourceMapSupport from 'source-map-support'; -import { readHashOfPackageMap } from '@kbn/synthetic-package-map'; - -import { TRANSFORMS } from './transforms'; -import { getBabelOptions } from './transforms/babel'; - -import { Cache } from './cache'; - -const IGNORE_PATTERNS = [ - /[\/\\]kbn-pm[\/\\]dist[\/\\]/, - - // ignore paths matching `/node_modules/{a}/{b}`, unless `a` - // is `x-pack` and `b` is not `node_modules` - /[\/\\]node_modules[\/\\](?!x-pack[\/\\](?!node_modules)([^\/\\]+))([^\/\\]+[\/\\][^\/\\]+)/, - - // ignore paths matching `/canvas/canvas_plugin/` - /[\/\\]canvas[\/\\]canvas_plugin[\/\\]/, - - // ignore any path in the packages, unless it is in the package's - // root `src` directory, in any test or __tests__ directory, or it - // ends with .test.js, .test.ts, or .test.tsx - /[\/\\]packages[\/\\](eslint-|kbn-)[^\/\\]+[\/\\](?!src[\/\\].*|(.+[\/\\])?(test|__tests__)[\/\\].+|.+\.test\.(js|ts|tsx)$)(.+$)/, -]; - -let installed = false; - -export function registerNodeAutoTranspilation() { - if (installed) { - return; - } - installed = true; - - const cacheLog = process.env.DEBUG_NODE_TRANSPILER_CACHE - ? Fs.createWriteStream(Path.resolve(REPO_ROOT, 'node_auto_transpilation_cache.log')) - : undefined; - - const cacheDir = Path.resolve( - REPO_ROOT, - 'data/node_auto_transpilation_cache_v6', - UPSTREAM_BRANCH - ); - - /** - * @babel/register uses a JSON encoded copy of the config + babel.version - * as the cache key for files, so we do something similar but we don't need - * a unique cache key for every file as our config isn't different for - * different files (by design). Instead we determine a unique prefix and - * automatically prepend all paths with the prefix to create cache keys - */ - - const cache = new Cache({ - dir: cacheDir, - log: cacheLog, - pathRoot: REPO_ROOT, - prefix: Crypto.createHash('sha256') - .update( - JSON.stringify({ - synthPkgMapHash: readHashOfPackageMap(), - babelVersion, - peggyVersion, - // get a config for a fake js, ts, and tsx file to make sure we - // capture conditional config portions based on the file extension - js: getBabelOptions(Path.resolve(REPO_ROOT, 'foo.js')), - ts: getBabelOptions(Path.resolve(REPO_ROOT, 'foo.ts')), - tsx: getBabelOptions(Path.resolve(REPO_ROOT, 'foo.tsx')), - }) - ) - .digest('hex') - .slice(0, 8), - }); - cacheLog?.write(`cache initialized\n`); - - sourceMapSupport.install({ - handleUncaughtExceptions: false, - environment: 'node', - // @ts-expect-error bad source-map-support types - retrieveSourceMap(path: string) { - const map = cache.getSourceMap(path); - return map ? { map, url: null } : null; - }, - }); - - let transformInProgress = false; - addHook( - (code, path) => { - if (transformInProgress) { - return code; - } - - const ext = Path.extname(path); - - if (ext !== '.peggy' && IGNORE_PATTERNS.some((re) => re.test(path))) { - return code; - } - - try { - transformInProgress = true; - const transform = Object.hasOwn(TRANSFORMS, ext) - ? TRANSFORMS[ext as keyof typeof TRANSFORMS] - : TRANSFORMS.default; - - return transform(path, code, cache); - } finally { - transformInProgress = false; - } - }, - { - exts: ['.js', '.ts', '.tsx', '.peggy'], - ignoreNodeModules: false, - } - ); - - // require the polyfills after setting up the require hook so that @babel/preset-env - // will spot the import in the polyfill file and replace it with the necessary polyfills - // for the current node.js version - require('./polyfill'); -} diff --git a/packages/kbn-optimizer/src/node/transforms/babel.ts b/packages/kbn-optimizer/src/node/transforms/babel.ts deleted file mode 100644 index 6bbe7ba67f76..000000000000 --- a/packages/kbn-optimizer/src/node/transforms/babel.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs'; - -import * as babel from '@babel/core'; - -import { Transform } from './transform'; - -export function getBabelOptions(path: string) { - return babel.loadOptions({ - cwd: process.cwd(), - sourceRoot: Path.dirname(path) + Path.sep, - filename: path, - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/node_preset')], - sourceMaps: 'both', - ast: false, - })!; -} - -export const babelTransform: Transform = (path, source, cache) => { - const mtime = `${Fs.statSync(path).mtimeMs}`; - - if (cache.getMtime(path) === mtime) { - const code = cache.getCode(path); - if (code) { - return code; - } - } - - const options = getBabelOptions(path); - const result = babel.transform(source, options); - - if (!result || !result.code || !result.map) { - throw new Error(`babel failed to transpile [${path}]`); - } - - cache.update(path, { - mtime, - code: result.code, - map: result.map, - }); - - return result.code; -}; diff --git a/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts b/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts index 45d476558e05..9a3b7c6abb14 100644 --- a/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts +++ b/packages/kbn-optimizer/src/optimizer/handle_optimizer_completion.test.ts @@ -7,7 +7,7 @@ */ import * as Rx from 'rxjs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Update, allValuesFrom } from '../common'; diff --git a/packages/kbn-optimizer/src/optimizer/observe_worker.ts b/packages/kbn-optimizer/src/optimizer/observe_worker.ts index b73e441671ea..cf250a7deef6 100644 --- a/packages/kbn-optimizer/src/optimizer/observe_worker.ts +++ b/packages/kbn-optimizer/src/optimizer/observe_worker.ts @@ -8,7 +8,7 @@ import { inspect } from 'util'; -import execa from 'execa'; +import { fork, type ChildProcess } from 'child_process'; import * as Rx from 'rxjs'; import { map, takeUntil, first, ignoreElements } from 'rxjs/operators'; @@ -31,7 +31,7 @@ export interface WorkerStarted { export type WorkerStatus = WorkerStdio | WorkerStarted; interface ProcResource extends Rx.Unsubscribable { - proc: execa.ExecaChildProcess; + proc: ChildProcess; } const isNumeric = (input: any) => String(input).match(/^[0-9]+$/); @@ -55,31 +55,18 @@ if (inspectFlagIndex !== -1) { } } -function usingWorkerProc( - config: OptimizerConfig, - fn: (proc: execa.ExecaChildProcess) => Rx.Observable -) { +function usingWorkerProc(config: OptimizerConfig, fn: (proc: ChildProcess) => Rx.Observable) { return Rx.using( (): ProcResource => { - const workerPath = require.resolve('../worker/run_worker'); - const proc = execa.node( - workerPath.endsWith('.ts') - ? require.resolve('../worker/run_worker_from_source') // workerFromSourcePath - : workerPath, - [], - { - nodeOptions: [ - '--preserve-symlinks', - '--preserve-symlinks-main', - ...(inspectFlag && config.inspectWorkers - ? [`${inspectFlag}=${inspectPortCounter++}`] - : []), - ], - buffer: false, - stderr: 'pipe', - stdout: 'pipe', - } - ); + const proc = fork(require.resolve('../worker/run_worker'), [], { + execArgv: [ + `--require=@kbn/babel-register/install`, + ...(inspectFlag && config.inspectWorkers + ? [`${inspectFlag}=${inspectPortCounter++}`] + : []), + ], + stdio: ['ignore', 'pipe', 'pipe', 'ipc'], + }); return { proc, @@ -104,7 +91,7 @@ function usingWorkerProc( * be initialized in the worker before most of the code is run. */ function initWorker( - proc: execa.ExecaChildProcess, + proc: ChildProcess, config: OptimizerConfig, workerConfig: WorkerConfig, bundles: Bundle[] diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_built_paths.ts b/packages/kbn-optimizer/src/optimizer/optimizer_built_paths.ts index 8421c0846d52..e3e99943236f 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_built_paths.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_built_paths.ts @@ -17,6 +17,7 @@ export async function getOptimizerBuiltPaths() { [ '**/*', '!**/{__fixtures__,__snapshots__,integration_tests,audit_bundle_dependencies,node}/**', + '!**/*.test.*', ], { cwd: Path.resolve(__dirname, '../'), diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts index d22ba9528200..0302968ce292 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.test.ts @@ -6,13 +6,13 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; import { getOptimizerCacheKey } from './optimizer_cache_key'; import { OptimizerConfig } from './optimizer_config'; -jest.mock('@kbn/synthetic-package-map', () => { +jest.mock('@kbn/package-map', () => { return { readHashOfPackageMap() { return ''; diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.ts b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.ts index 586846653802..1cf00de874b2 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_cache_key.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { readHashOfPackageMap } from '@kbn/synthetic-package-map'; +import { readHashOfPackageMap } from '@kbn/package-map'; import { CacheableWorkerConfig, Hashes } from '../common'; import { OptimizerConfig } from './optimizer_config'; diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts index 95db0ae10b3b..d6b0a2c860bc 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts @@ -24,7 +24,7 @@ jest.mock('os', () => { }); import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; import { OptimizerConfig, ParsedOptions } from './optimizer_config'; diff --git a/packages/kbn-optimizer/src/worker/populate_bundle_cache_plugin.ts b/packages/kbn-optimizer/src/worker/populate_bundle_cache_plugin.ts index ac010da7a834..b2e036cb7e00 100644 --- a/packages/kbn-optimizer/src/worker/populate_bundle_cache_plugin.ts +++ b/packages/kbn-optimizer/src/worker/populate_bundle_cache_plugin.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import Fs from 'fs'; import Path from 'path'; import { inspect } from 'util'; @@ -39,20 +38,6 @@ import { BundleRefModule } from './bundle_ref_module'; */ const EXTRA_SCSS_WORK_UNITS = 100; -const isBazelPackageCache = new Map(); -function isBazelPackage(pkgJsonPath: string) { - const cached = isBazelPackageCache.get(pkgJsonPath); - if (typeof cached === 'boolean') { - return cached; - } - - const path = parseFilePath(Fs.realpathSync(pkgJsonPath, 'utf-8')); - const match = !!path.matchDirs('bazel-out', /-fastbuild$/, 'bin', 'packages'); - isBazelPackageCache.set(pkgJsonPath, match); - - return match; -} - export class PopulateBundleCachePlugin { constructor( private readonly workerConfig: WorkerConfig, @@ -100,18 +85,8 @@ export class PopulateBundleCachePlugin { for (const module of compilation.modules) { if (isNormalModule(module)) { moduleCount += 1; - let path = getModulePath(module); - let parsedPath = parseFilePath(path); - - const bazelOutIndex = parsedPath.dirs.indexOf('bazel-out'); - if (bazelOutIndex >= 0) { - path = Path.resolve( - this.workerConfig.repoRoot, - ...parsedPath.dirs.slice(bazelOutIndex), - parsedPath.filename ?? '' - ); - parsedPath = parseFilePath(path); - } + const path = getModulePath(module); + const parsedPath = parseFilePath(path); if (!parsedPath.dirs.includes('node_modules')) { addReferenced(path); @@ -134,8 +109,7 @@ export class PopulateBundleCachePlugin { ...parsedPath.dirs.slice(0, nmIndex + 1 + (isScoped ? 2 : 1)), 'package.json' ); - - addReferenced(isBazelPackage(pkgJsonPath) ? path : pkgJsonPath); + addReferenced(pkgJsonPath); continue; } diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 888089203be4..a5511c7ae0e5 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -27,7 +27,12 @@ import { PopulateBundleCachePlugin } from './populate_bundle_cache_plugin'; const IS_CODE_COVERAGE = !!process.env.CODE_COVERAGE; const ISTANBUL_PRESET_PATH = require.resolve('@kbn/babel-preset/istanbul_preset'); -const BABEL_PRESET_PATH = require.resolve('@kbn/babel-preset/webpack_preset'); +const BABEL_PRESET = [ + require.resolve('@kbn/babel-preset/webpack_preset'), + { + 'kibana/ignoredPkgIds': Object.keys(UiSharedDepsSrc.externals), + }, +]; const DLL_MANIFEST = JSON.parse(Fs.readFileSync(UiSharedDepsNpm.dllManifestPath, 'utf8')); const nodeModulesButNotKbnPackages = (path: string) => { @@ -76,7 +81,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: }, }, - externals: [UiSharedDepsSrc.externals], + externals: UiSharedDepsSrc.externals, plugins: [ new CleanWebpackPlugin(), @@ -149,7 +154,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: options: { sourceMap: !worker.dist, postcssOptions: { - config: require.resolve('@kbn/optimizer/postcss.config.js'), + config: require.resolve('../../postcss.config.js'), }, }, }, @@ -176,7 +181,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: options: { sourceMap: !worker.dist, postcssOptions: { - config: require.resolve('@kbn/optimizer/postcss.config.js'), + config: require.resolve('../../postcss.config.js'), }, }, }, @@ -227,9 +232,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: options: { babelrc: false, envName: worker.dist ? 'production' : 'development', - presets: IS_CODE_COVERAGE - ? [ISTANBUL_PRESET_PATH, BABEL_PRESET_PATH] - : [BABEL_PRESET_PATH], + presets: IS_CODE_COVERAGE ? [ISTANBUL_PRESET_PATH, BABEL_PRESET] : [BABEL_PRESET], }, }, }, @@ -241,7 +244,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: }, { test: /\.peggy$/, - loader: '@kbn/peggy-loader', + loader: require.resolve('@kbn/peggy-loader'), }, ], }, diff --git a/packages/kbn-optimizer/tsconfig.json b/packages/kbn-optimizer/tsconfig.json index 93c0f5ba2a57..b8f5a0448111 100644 --- a/packages/kbn-optimizer/tsconfig.json +++ b/packages/kbn-optimizer/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -13,6 +11,23 @@ "**/*.ts" ], "exclude": [ - "**/__fixtures__/**/*" + "**/__fixtures__/**/*", + "target/**/*", + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/dev-utils", + "@kbn/optimizer-webpack-helpers", + "@kbn/std", + "@kbn/ui-shared-deps-npm", + "@kbn/ui-shared-deps-src", + "@kbn/tooling-log", + "@kbn/package-map", + "@kbn/ci-stats-reporter", + "@kbn/dev-cli-errors", + "@kbn/repo-info", + "@kbn/dev-cli-runner", + "@kbn/jest-serializers", + "@kbn/plugin-discovery", ] } diff --git a/packages/kbn-osquery-io-ts-types/BUILD.bazel b/packages/kbn-osquery-io-ts-types/BUILD.bazel deleted file mode 100644 index 80390c1de4b0..000000000000 --- a/packages/kbn-osquery-io-ts-types/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-osquery-io-ts-types" -PKG_REQUIRE_NAME = "@kbn/osquery-io-ts-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//io-ts", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//tslib", - "@npm//io-ts", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-osquery-io-ts-types/kibana.jsonc b/packages/kbn-osquery-io-ts-types/kibana.jsonc index bddaaf9b3543..d989501855da 100644 --- a/packages/kbn-osquery-io-ts-types/kibana.jsonc +++ b/packages/kbn-osquery-io-ts-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/osquery-io-ts-types", - "owner": "@elastic/security-asset-management", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/security-asset-management" } diff --git a/packages/kbn-osquery-io-ts-types/package.json b/packages/kbn-osquery-io-ts-types/package.json index 49b11c73a039..71db0385e611 100644 --- a/packages/kbn-osquery-io-ts-types/package.json +++ b/packages/kbn-osquery-io-ts-types/package.json @@ -3,8 +3,5 @@ "private": true, "version": "1.0.0", "description": "io ts utilities and types to be shared with plugins from the osquery project", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-osquery-io-ts-types/tsconfig.json b/packages/kbn-osquery-io-ts-types/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-osquery-io-ts-types/tsconfig.json +++ b/packages/kbn-osquery-io-ts-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-package-map/BUILD.bazel b/packages/kbn-package-map/BUILD.bazel new file mode 100644 index 000000000000..9c29c0f65633 --- /dev/null +++ b/packages/kbn-package-map/BUILD.bazel @@ -0,0 +1,16 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "pkg_npm", "ts_project") + +js_library( + name = "kbn-package-map", + package_name = "@kbn/package-map", + srcs = [ + "package.json", + "index.js", + "index.d.ts", + "package-map.json", + ], + deps = [], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-synthetic-package-map/index.d.ts b/packages/kbn-package-map/index.d.ts similarity index 100% rename from packages/kbn-synthetic-package-map/index.d.ts rename to packages/kbn-package-map/index.d.ts diff --git a/packages/kbn-synthetic-package-map/index.js b/packages/kbn-package-map/index.js similarity index 90% rename from packages/kbn-synthetic-package-map/index.js rename to packages/kbn-package-map/index.js index 9a9b8c51d90a..e81700334878 100644 --- a/packages/kbn-synthetic-package-map/index.js +++ b/packages/kbn-package-map/index.js @@ -10,7 +10,7 @@ const Fs = require('fs'); const Path = require('path'); const Crypto = require('crypto'); -const PACKAGE_MAP_PATH = Path.resolve(__dirname, 'synthetic-packages.json'); +const PACKAGE_MAP_PATH = Path.resolve(__dirname, 'package-map.json'); function readPackageMap() { return new Map(JSON.parse(Fs.readFileSync(PACKAGE_MAP_PATH, 'utf8'))); diff --git a/packages/kbn-package-map/kibana.jsonc b/packages/kbn-package-map/kibana.jsonc new file mode 100644 index 000000000000..9b2bea0bfc1d --- /dev/null +++ b/packages/kbn-package-map/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/package-map", + "devOnly": true, + "owner": "@elastic/kibana-operations" +} diff --git a/packages/kbn-synthetic-package-map/package.json b/packages/kbn-package-map/package.json similarity index 74% rename from packages/kbn-synthetic-package-map/package.json rename to packages/kbn-package-map/package.json index ec6ac454bf31..f122e147219a 100644 --- a/packages/kbn-synthetic-package-map/package.json +++ b/packages/kbn-package-map/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/synthetic-package-map", + "name": "@kbn/package-map", "private": true, "version": "1.0.0", "main": "./index.js", diff --git a/packages/kbn-package-map/tsconfig.json b/packages/kbn-package-map/tsconfig.json new file mode 100644 index 000000000000..9a17e744de9e --- /dev/null +++ b/packages/kbn-package-map/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "node" + ] + }, + "include": [ + "index.d.ts" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-peggy-loader/BUILD.bazel b/packages/kbn-peggy-loader/BUILD.bazel index 2d8bed8dd59a..13afe2c2bc2d 100644 --- a/packages/kbn-peggy-loader/BUILD.bazel +++ b/packages/kbn-peggy-loader/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-peggy-loader" -PKG_REQUIRE_NAME = "@kbn/peggy-loader" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", ], @@ -24,105 +19,16 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "//packages/kbn-peggy", "@npm//peggy", "@npm//webpack", ] -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-peggy:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/webpack", - "@npm//peggy", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], + name = "kbn-peggy-loader", + package_name = "@kbn/peggy-loader", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-peggy-loader/kibana.jsonc b/packages/kbn-peggy-loader/kibana.jsonc index e651946dce5e..3fb6c0848b3d 100644 --- a/packages/kbn-peggy-loader/kibana.jsonc +++ b/packages/kbn-peggy-loader/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/peggy-loader", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-peggy-loader/package.json b/packages/kbn-peggy-loader/package.json index 6c2807a006f4..c3c90681a442 100644 --- a/packages/kbn-peggy-loader/package.json +++ b/packages/kbn-peggy-loader/package.json @@ -2,7 +2,5 @@ "name": "@kbn/peggy-loader", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-peggy-loader/tsconfig.json b/packages/kbn-peggy-loader/tsconfig.json index 292157c18591..3e412325cfa9 100644 --- a/packages/kbn-peggy-loader/tsconfig.json +++ b/packages/kbn-peggy-loader/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/peggy" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-peggy/BUILD.bazel b/packages/kbn-peggy/BUILD.bazel index dcb225c7da40..9e577817f77a 100644 --- a/packages/kbn-peggy/BUILD.bazel +++ b/packages/kbn-peggy/BUILD.bazel @@ -1,12 +1,8 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-peggy" -PKG_REQUIRE_NAME = "@kbn/peggy" - -SOURCE_FILES = glob( +SRCS = glob( [ + "**/*.js", "**/*.ts", ], exclude = [ @@ -24,101 +20,14 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "@npm//peggy", ] -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//peggy", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], + name = "kbn-peggy", + package_name = "@kbn/peggy", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-peggy/README.mdx b/packages/kbn-peggy/README.mdx index 5d9779976b15..a52269026546 100644 --- a/packages/kbn-peggy/README.mdx +++ b/packages/kbn-peggy/README.mdx @@ -16,8 +16,4 @@ These types will automatically be included for plugins. ## Packages -To include these types in a package: - -- add `"//packages/kbn-ambient-ui-types"` to the `RUNTIME_DEPS` portion of the `BUILD.bazel` file. -- add `"//packages/kbn-ambient-ui-types:npm_module_types"` to the `TYPES_DEPS` portion of the `BUILD.bazel` file. -- add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file +To include these types in a package add `"@kbn/ambient-ui-types"` to the `types` portion of the `tsconfig.json` file. \ No newline at end of file diff --git a/packages/kbn-peggy/index.js b/packages/kbn-peggy/index.js new file mode 100644 index 000000000000..0a5910fcf04f --- /dev/null +++ b/packages/kbn-peggy/index.js @@ -0,0 +1,94 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +const Path = require('path'); +const Fs = require('fs'); +const Fsp = require('fs/promises'); + +const Peggy = require('peggy'); + +/** + * @param {string} grammarPath + * @returns {import('./types').Config | undefined} + */ +function findConfigFile(grammarPath) { + const path = Path.resolve(Path.dirname(grammarPath), `${Path.basename(grammarPath)}.config.json`); + + let source; + let parsed; + try { + source = Fs.readFileSync(path, 'utf8'); + parsed = JSON.parse(source); + } catch (error) { + if (error.code === 'ENOENT') { + return undefined; + } + + throw error; + } + + return { path, source, parsed }; +} + +/** + * + * @param {import('./types').Options} options + * @returns {Promise} + */ +async function getJsSource(options) { + let source; + if (options.content) { + source = options.content; + } else if (options.path) { + source = await Fsp.readFile(options.path, 'utf8'); + } else { + throw new Error('you must either specify the path of the grammar file, or the content'); + } + + return getJsSourceSync({ + content: source, + ...options, + }); +} + +/** + * @param {import('./types').SyncOptions} options + * @returns + */ +function getJsSourceSync(options) { + const config = + options.config ?? + (options.path && options.skipConfigSearch !== true ? findConfigFile(options.path) : null); + + const result = Peggy.generate(options.content, { + ...config?.parsed, + format: options.format === 'esm' ? 'es' : 'commonjs', + optimize: options.optimize, + output: 'source', + }); + + return { + /** + * The source code of the module which parses expressions in the format + * defined by the peggy grammar file + */ + source: /** @type {string} */ (/** @type {unknown} */ (result)), + + /** + * The loaded config if it was found + */ + config: config ?? null, + }; +} + +module.exports = { + findConfigFile, + getJsSource, + getJsSourceSync, + version: Peggy.VERSION, +}; diff --git a/packages/kbn-peggy/index.ts b/packages/kbn-peggy/index.ts deleted file mode 100644 index b5b35f131d2e..000000000000 --- a/packages/kbn-peggy/index.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs'; -import Fsp from 'fs/promises'; - -import Peggy from 'peggy'; - -export interface Options { - /** - * The path to the peggy content. If this is not defined then - * config files can not be found and `content` must be passed. - */ - path?: string; - /** - * Prevent loading the content from disk by specifying it here - */ - content?: string; - /** - * Prevent loading the config from disk by specifying it here - */ - config?: Config; - /** - * What type of module format should the generated code use. Defaults to - * commonjs for broadest compatibility - */ - format?: 'esm' | 'commonjs'; - /** - * Should the parser optimize for execution speed or size of the code - */ - optimize?: 'size' | 'speed'; - /** - * Disable checking for a config file a `{basename}.config.json` in - * the same directory as the grammar file. - */ - skipConfigSearch?: boolean; -} - -export interface Config { - /** the path of the discovered config file */ - path: string; - /** the content of the config file as a string (primarily for hashing) */ - source: string; - /** the parsed content of the config file */ - parsed: any; -} - -export interface Result { - /** - * The source code of the module which parses expressions in the format - * defined by the peggy grammar file - */ - config: Config | null; - - /** - * The loaded config if it was found - */ - source: string; -} - -export function findConfigFile(grammarPath: string): Config | undefined { - const path = Path.resolve(Path.dirname(grammarPath), `${Path.basename(grammarPath)}.config.json`); - - let source; - let parsed; - try { - source = Fs.readFileSync(path, 'utf8'); - parsed = JSON.parse(source); - } catch (error) { - if (error.code === 'ENOENT') { - return undefined; - } - - throw error; - } - - return { path, source, parsed }; -} - -export async function getJsSource(options: Options): Promise { - let source; - if (options.content) { - source = options.content; - } else if (options.path) { - source = await Fsp.readFile(options.path, 'utf8'); - } else { - throw new Error('you must either specify the path of the grammar file, or the content'); - } - - return getJsSourceSync({ - content: source, - ...options, - }); -} - -export function getJsSourceSync( - options: Options & { - /** The content of the grammar file to parse */ - content: string; - } -): Result { - const config = - options.config ?? - (options.path && options.skipConfigSearch !== true ? findConfigFile(options.path) : null); - - const result = Peggy.generate(options.content, { - ...config?.parsed, - format: options.format === 'esm' ? 'es' : 'commonjs', - optimize: options.optimize, - output: 'source', - }); - - return { - /** - * The source code of the module which parses expressions in the format - * defined by the peggy grammar file - */ - source: result as unknown as string, - - /** - * The loaded config if it was found - */ - config: config ?? null, - }; -} - -export const VERSION = Peggy.VERSION; diff --git a/packages/kbn-peggy/kibana.jsonc b/packages/kbn-peggy/kibana.jsonc index 8b44dc5604d1..a1cdcc8f802a 100644 --- a/packages/kbn-peggy/kibana.jsonc +++ b/packages/kbn-peggy/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/peggy", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-peggy/package.json b/packages/kbn-peggy/package.json index cd976c2e8d97..0151ea684298 100644 --- a/packages/kbn-peggy/package.json +++ b/packages/kbn-peggy/package.json @@ -2,7 +2,5 @@ "name": "@kbn/peggy", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-peggy/tsconfig.json b/packages/kbn-peggy/tsconfig.json index 292157c18591..501c4341b89a 100644 --- a/packages/kbn-peggy/tsconfig.json +++ b/packages/kbn-peggy/tsconfig.json @@ -1,15 +1,18 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "checkJs": true, + "outDir": "target/types", "types": [ "jest", "node" ] }, "include": [ - "**/*.ts", + "index.js", + "types.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-peggy/types.ts b/packages/kbn-peggy/types.ts new file mode 100644 index 000000000000..b4c2500e5f8e --- /dev/null +++ b/packages/kbn-peggy/types.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export interface Options { + /** + * The path to the peggy content. If this is not defined then + * config files can not be found and `content` must be passed. + */ + path?: string; + /** + * Prevent loading the content from disk by specifying it here + */ + content?: string; + /** + * Prevent loading the config from disk by specifying it here + */ + config?: Config; + /** + * What type of module format should the generated code use. Defaults to + * commonjs for broadest compatibility + */ + format?: 'esm' | 'commonjs'; + /** + * Should the parser optimize for execution speed or size of the code + */ + optimize?: 'size' | 'speed'; + /** + * Disable checking for a config file a `{basename}.config.json` in + * the same directory as the grammar file. + */ + skipConfigSearch?: boolean; +} + +export interface SyncOptions extends Options { + /** the content of the peggy grammar to parse */ + content: string; +} + +export interface Config { + /** the path of the discovered config file */ + path: string; + /** the content of the config file as a string (primarily for hashing) */ + source: string; + /** the parsed content of the config file */ + parsed: any; +} + +export interface Result { + /** + * The source code of the module which parses expressions in the format + * defined by the peggy grammar file + */ + config: Config | null; + + /** + * The loaded config if it was found + */ + source: string; +} diff --git a/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel b/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel deleted file mode 100644 index 2b088b0cfdc4..000000000000 --- a/packages/kbn-performance-testing-dataset-extractor/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-performance-testing-dataset-extractor" -PKG_REQUIRE_NAME = "@kbn/performance-testing-dataset-extractor" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-dev-cli-errors", - "//packages/kbn-dev-cli-runner", - "//packages/kbn-test", - "//packages/kbn-tooling-log", - "@npm//@elastic/elasticsearch", - "@npm//moment", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-journeys:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-performance-testing-dataset-extractor/kibana.jsonc b/packages/kbn-performance-testing-dataset-extractor/kibana.jsonc index f09d991b49ec..1363aaa66d61 100644 --- a/packages/kbn-performance-testing-dataset-extractor/kibana.jsonc +++ b/packages/kbn-performance-testing-dataset-extractor/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/performance-testing-dataset-extractor", "devOnly": true, - "owner": "@elastic/kibana-performance-testing", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-performance-testing" } diff --git a/packages/kbn-performance-testing-dataset-extractor/package.json b/packages/kbn-performance-testing-dataset-extractor/package.json index f4da970da152..d3be2848570b 100644 --- a/packages/kbn-performance-testing-dataset-extractor/package.json +++ b/packages/kbn-performance-testing-dataset-extractor/package.json @@ -3,7 +3,5 @@ "description": "A library to convert APM traces into JSON format for performance testing.", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-performance-testing-dataset-extractor/tsconfig.json b/packages/kbn-performance-testing-dataset-extractor/tsconfig.json index 57c1dd1c94e0..995f8bde4d93 100644 --- a/packages/kbn-performance-testing-dataset-extractor/tsconfig.json +++ b/packages/kbn-performance-testing-dataset-extractor/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-errors", + "@kbn/dev-cli-runner", + "@kbn/tooling-log", + "@kbn/journeys" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-plugin-discovery/BUILD.bazel b/packages/kbn-plugin-discovery/BUILD.bazel deleted file mode 100644 index cdfcc23545c8..000000000000 --- a/packages/kbn-plugin-discovery/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-plugin-discovery" -PKG_REQUIRE_NAME = "@kbn/plugin-discovery" - -SOURCE_FILES = glob( - [ - "**/*.js", - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - allow_js = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-plugin-discovery/kibana.jsonc b/packages/kbn-plugin-discovery/kibana.jsonc index 8e6ad8a0c35d..d14b8a8eadb9 100644 --- a/packages/kbn-plugin-discovery/kibana.jsonc +++ b/packages/kbn-plugin-discovery/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/plugin-discovery", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-plugin-discovery/package.json b/packages/kbn-plugin-discovery/package.json index ff8f17b0fa2c..359dd420d87e 100644 --- a/packages/kbn-plugin-discovery/package.json +++ b/packages/kbn-plugin-discovery/package.json @@ -2,7 +2,5 @@ "name": "@kbn/plugin-discovery", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-plugin-discovery/tsconfig.json b/packages/kbn-plugin-discovery/tsconfig.json index e5578a8b0eea..03ae7bfe1cee 100644 --- a/packages/kbn-plugin-discovery/tsconfig.json +++ b/packages/kbn-plugin-discovery/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, "checkJs": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +11,8 @@ "include": [ "**/*.js", "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel deleted file mode 100644 index 82a7c0f250ce..000000000000 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-plugin-generator" -PKG_REQUIRE_NAME = "@kbn/plugin-generator" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -filegroup( - name = "template", - srcs = glob( - [ - "template/**/*", - ], - ), -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", - ":template", -] - -RUNTIME_DEPS = [ - "//packages/kbn-utils", - "//packages/kbn-dev-utils", - "@npm//del", - "@npm//ejs", - "@npm//execa", - "@npm//globby", - "@npm//inquirer", - "@npm//minimatch", - "@npm//prettier", - "@npm//vinyl-fs", -] - -TYPES_DEPS = [ - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-dev-utils:npm_module_types", - "@npm//del", - "@npm//execa", - "@npm//globby", - "@npm//@types/ejs", - "@npm//@types/inquirer", - "@npm//@types/jest", - "@npm//@types/minimatch", - "@npm//@types/node", - "@npm//@types/prettier", - "@npm//@types/vinyl-fs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-plugin-generator/kibana.jsonc b/packages/kbn-plugin-generator/kibana.jsonc index 1045f4353932..7b73a516f766 100644 --- a/packages/kbn-plugin-generator/kibana.jsonc +++ b/packages/kbn-plugin-generator/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/plugin-generator", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-plugin-generator/package.json b/packages/kbn-plugin-generator/package.json index add2a70f0e5b..99dd77ab9a43 100644 --- a/packages/kbn-plugin-generator/package.json +++ b/packages/kbn-plugin-generator/package.json @@ -2,7 +2,5 @@ "name": "@kbn/plugin-generator", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-plugin-generator/src/ask_questions.ts b/packages/kbn-plugin-generator/src/ask_questions.ts index aeee8dfdbdad..96aaec218e64 100644 --- a/packages/kbn-plugin-generator/src/ask_questions.ts +++ b/packages/kbn-plugin-generator/src/ask_questions.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import inquirer from 'inquirer'; export interface Answers { diff --git a/packages/kbn-plugin-generator/src/cli.ts b/packages/kbn-plugin-generator/src/cli.ts index a4a18317283c..90a0b971530b 100644 --- a/packages/kbn-plugin-generator/src/cli.ts +++ b/packages/kbn-plugin-generator/src/cli.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import execa from 'execa'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { createFailError, createFlagError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts b/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts index a9df7fdd2be9..ce359d1eb810 100644 --- a/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts +++ b/packages/kbn-plugin-generator/src/integration_tests/generate_plugin.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import del from 'del'; import execa from 'execa'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; import globby from 'globby'; diff --git a/packages/kbn-plugin-generator/src/plugin_types.ts b/packages/kbn-plugin-generator/src/plugin_types.ts index 33f30381c78a..e3b36eb16e0a 100644 --- a/packages/kbn-plugin-generator/src/plugin_types.ts +++ b/packages/kbn-plugin-generator/src/plugin_types.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export interface PluginType { thirdParty: boolean; diff --git a/packages/kbn-plugin-generator/src/render_template.ts b/packages/kbn-plugin-generator/src/render_template.ts index 385239706b56..f64796ecad3d 100644 --- a/packages/kbn-plugin-generator/src/render_template.ts +++ b/packages/kbn-plugin-generator/src/render_template.ts @@ -12,7 +12,7 @@ import { promisify } from 'util'; import vfs from 'vinyl-fs'; import prettier from 'prettier'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { transformFileStream } from '@kbn/dev-utils'; import ejs from 'ejs'; import { Minimatch } from 'minimatch'; @@ -78,7 +78,7 @@ export async function renderTemplates({ dot: true, buffer: true, nodir: true, - cwd: Path.resolve(__dirname, '../../template'), + cwd: Path.resolve(__dirname, '../template'), }), // exclude files from the template based on selected options, patterns diff --git a/packages/kbn-plugin-generator/tsconfig.json b/packages/kbn-plugin-generator/tsconfig.json index 70567fe331a2..7c818fe8c558 100644 --- a/packages/kbn-plugin-generator/tsconfig.json +++ b/packages/kbn-plugin-generator/tsconfig.json @@ -1,10 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "target": "ES2019", + "outDir": "target/types", "types": [ "jest", "node" @@ -14,6 +11,14 @@ "**/*.ts" ], "exclude": [ - "template/*" + "template/*", + "target/**/*", + ], + "kbn_references": [ + "@kbn/dev-utils", + "@kbn/repo-info", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/jest-serializers", ], } diff --git a/packages/kbn-plugin-helpers/BUILD.bazel b/packages/kbn-plugin-helpers/BUILD.bazel deleted file mode 100644 index 482b5bdf8b4d..000000000000 --- a/packages/kbn-plugin-helpers/BUILD.bazel +++ /dev/null @@ -1,129 +0,0 @@ - -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-plugin-helpers" -PKG_REQUIRE_NAME = "@kbn/plugin-helpers" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-optimizer", - "//packages/kbn-utils", - "@npm//del", - "@npm//execa", - "@npm//extract-zip", - "@npm//globby", - "@npm//gulp-zip", - "@npm//inquirer", - "@npm//load-json-file", - "@npm//vinyl-fs", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-optimizer:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//del", - "@npm//execa", - "@npm//globby", - "@npm//load-json-file", - "@npm//@types/extract-zip", - "@npm//@types/gulp-zip", - "@npm//@types/inquirer", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/vinyl-fs", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-plugin-helpers/kibana.jsonc b/packages/kbn-plugin-helpers/kibana.jsonc index 84a87720dab0..bee9b9486a64 100644 --- a/packages/kbn-plugin-helpers/kibana.jsonc +++ b/packages/kbn-plugin-helpers/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/plugin-helpers", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index dc12d7ddb6b6..9380f15c083e 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -4,9 +4,7 @@ "private": true, "description": "Just some helpers for kibana plugin devs.", "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", "bin": { "plugin-helpers": "bin/plugin-helpers.js" - }, - "types": "./target_types/index.d.ts" + } } \ No newline at end of file diff --git a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts index 10ad022e45a7..bae49182aab1 100644 --- a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts +++ b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import execa from 'execa'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createStripAnsiSerializer, createReplaceSerializer } from '@kbn/jest-serializers'; import extract from 'extract-zip'; import del from 'del'; diff --git a/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts b/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts index fb01d6deeded..b3a3716f91ea 100644 --- a/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts +++ b/packages/kbn-plugin-helpers/src/load_kibana_platform_plugin.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { parseKibanaPlatformPlugin, KibanaPlatformPlugin } from '@kbn/plugin-discovery'; import { createFailError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-plugin-helpers/src/tasks/optimize.ts b/packages/kbn-plugin-helpers/src/tasks/optimize.ts index ee05fa3d3354..96b4550c49d8 100644 --- a/packages/kbn-plugin-helpers/src/tasks/optimize.ts +++ b/packages/kbn-plugin-helpers/src/tasks/optimize.ts @@ -10,7 +10,7 @@ import Fs from 'fs'; import Path from 'path'; import { promisify } from 'util'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { OptimizerConfig, runOptimizer, logOptimizerState } from '@kbn/optimizer'; import { BuildContext } from '../build_context'; diff --git a/packages/kbn-dev-utils/src/babel.ts b/packages/kbn-plugin-helpers/src/tasks/transform_file_with_babel.ts similarity index 100% rename from packages/kbn-dev-utils/src/babel.ts rename to packages/kbn-plugin-helpers/src/tasks/transform_file_with_babel.ts diff --git a/packages/kbn-plugin-helpers/src/tasks/write_server_files.ts b/packages/kbn-plugin-helpers/src/tasks/write_server_files.ts index 371937c21c70..42816082b4bb 100644 --- a/packages/kbn-plugin-helpers/src/tasks/write_server_files.ts +++ b/packages/kbn-plugin-helpers/src/tasks/write_server_files.ts @@ -10,7 +10,8 @@ import { pipeline } from 'stream'; import { promisify } from 'util'; import vfs from 'vinyl-fs'; -import { transformFileWithBabel, transformFileStream } from '@kbn/dev-utils'; +import { transformFileStream } from '@kbn/dev-utils'; +import { transformFileWithBabel } from './transform_file_with_babel'; import { BuildContext } from '../build_context'; diff --git a/packages/kbn-plugin-helpers/tsconfig.json b/packages/kbn-plugin-helpers/tsconfig.json index 11089e884633..37c93a7d5173 100644 --- a/packages/kbn-plugin-helpers/tsconfig.json +++ b/packages/kbn-plugin-helpers/tsconfig.json @@ -1,10 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "target": "ES2018", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +9,18 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-utils", + "@kbn/optimizer", + "@kbn/tooling-log", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/repo-info", + "@kbn/plugin-discovery", + "@kbn/jest-serializers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-react-field/BUILD.bazel b/packages/kbn-react-field/BUILD.bazel deleted file mode 100644 index 0437d7810635..000000000000 --- a/packages/kbn-react-field/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-react-field" -PKG_REQUIRE_NAME = "@kbn/react-field" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//classnames", - "@npm//prop-types", - "@npm//react", -] - -TYPES_DEPS = [ - "@npm//tslib", - "@npm//@elastic/eui", - "@npm//@types/classnames", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/prop-types", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_webpack", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_webpack"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_webpack", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-react-field/kibana.jsonc b/packages/kbn-react-field/kibana.jsonc index aade3b024297..4b85e53ad6af 100644 --- a/packages/kbn-react-field/kibana.jsonc +++ b/packages/kbn-react-field/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/react-field", - "owner": "@elastic/kibana-app-services", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-app-services" } diff --git a/packages/kbn-react-field/package.json b/packages/kbn-react-field/package.json index aae5d673b5fb..c0fc936e297f 100644 --- a/packages/kbn-react-field/package.json +++ b/packages/kbn-react-field/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/react-field", - "main": "./target_node/index.js", - "browser": "./target_webpack/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-react-field/tsconfig.json b/packages/kbn-react-field/tsconfig.json index ab59ea0429ac..b85e4312e707 100644 --- a/packages/kbn-react-field/tsconfig.json +++ b/packages/kbn-react-field/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,4 +11,7 @@ "**/*.ts", "**/*.tsx", ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-repo-info/BUILD.bazel b/packages/kbn-repo-info/BUILD.bazel new file mode 100644 index 000000000000..91d330a9ec88 --- /dev/null +++ b/packages/kbn-repo-info/BUILD.bazel @@ -0,0 +1,36 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "pkg_npm", "ts_project") + +SRCS = glob( + [ + "**/*.js", + "**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +filegroup( + name = 'root_pkg_json', + srcs = ["//:package.json"] +) + +js_library( + name = "kbn-repo-info", + package_name = "@kbn/repo-info", + srcs = ["package.json"] + SRCS, + deps = [":root_pkg_json"], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-repo-info/README.md b/packages/kbn-repo-info/README.md new file mode 100644 index 000000000000..00bbf64ba4d9 --- /dev/null +++ b/packages/kbn-repo-info/README.md @@ -0,0 +1,3 @@ +# @kbn/repo-info + +Empty package generated by @kbn/generate diff --git a/packages/kbn-utils/src/repo_root.ts b/packages/kbn-repo-info/index.js similarity index 61% rename from packages/kbn-utils/src/repo_root.ts rename to packages/kbn-repo-info/index.js index 816a4133a7fb..bb38c8bff64e 100644 --- a/packages/kbn-utils/src/repo_root.ts +++ b/packages/kbn-repo-info/index.js @@ -6,14 +6,18 @@ * Side Public License, v 1. */ -import Path from 'path'; -import Fs from 'fs'; +/** @typedef {import('./types').KibanaPackageJson} KibanaPackageJson */ -import loadJsonFile from 'load-json-file'; +const Path = require('path'); +const Fs = require('fs'); -const readKibanaPkgJson = (path: string) => { +/** + * @param {string} path + * @returns {undefined | KibanaPackageJson} + */ +const readKibanaPkgJson = (path) => { try { - const json = loadJsonFile.sync(path); + const json = JSON.parse(Fs.readFileSync(path, 'utf8')); if (json && typeof json === 'object' && 'name' in json && json.name === 'kibana') { return json; } @@ -36,16 +40,13 @@ const findKibanaPackageJson = () => { while (true) { const packageJsonPath = Path.resolve(cursor, 'package.json'); const kibanaPkgJson = readKibanaPkgJson(packageJsonPath); + if (kibanaPkgJson) { return { - // when this script is run by ESLint in IDEs it doesn't use --preserve-symlinks, so we have to - // use `Fs.realpathSync()` to resolve the package.json path to the actual file in the repo rather - // than the sym-linked version in the bazel-out dir + // we use `Fs.realpathSync()` to resolve the package.json path to the actual file + // in the repo rather than the sym-linked version if it is symlinked kibanaDir: Path.dirname(Fs.realpathSync(packageJsonPath)), - kibanaPkgJson: kibanaPkgJson as { - name: string; - branch: string; - }, + kibanaPkgJson, }; } @@ -59,7 +60,20 @@ const findKibanaPackageJson = () => { const { kibanaDir, kibanaPkgJson } = findKibanaPackageJson(); -export const REPO_ROOT = kibanaDir; -export const UPSTREAM_BRANCH = kibanaPkgJson.branch; +const REPO_ROOT = kibanaDir; +const PKG_JSON = kibanaPkgJson; +const UPSTREAM_BRANCH = kibanaPkgJson.branch; -export const fromRoot = (...paths: string[]) => Path.resolve(REPO_ROOT, ...paths); +/** + * @param {string[]} paths + */ +const fromRoot = (...paths) => Path.resolve(REPO_ROOT, ...paths); + +module.exports = { + REPO_ROOT, + PKG_JSON, + kibanaPackageJson: PKG_JSON, + isKibanaDistributable: () => !!PKG_JSON.build.distributable, + UPSTREAM_BRANCH, + fromRoot, +}; diff --git a/packages/kbn-type-summarizer/jest.integration.config.js b/packages/kbn-repo-info/jest.config.js similarity index 80% rename from packages/kbn-type-summarizer/jest.integration.config.js rename to packages/kbn-repo-info/jest.config.js index 50a3f64b6338..6a3ee546e5e5 100644 --- a/packages/kbn-type-summarizer/jest.integration.config.js +++ b/packages/kbn-repo-info/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_integration_node', + preset: '@kbn/test/jest_node', rootDir: '../..', - roots: ['/packages/kbn-type-summarizer'], + roots: ['/packages/kbn-repo-info'], }; diff --git a/packages/kbn-repo-info/kibana.jsonc b/packages/kbn-repo-info/kibana.jsonc new file mode 100644 index 000000000000..ab12583890df --- /dev/null +++ b/packages/kbn-repo-info/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/repo-info", + "owner": "@elastic/kibana-operations" +} diff --git a/packages/kbn-repo-info/package.json b/packages/kbn-repo-info/package.json new file mode 100644 index 000000000000..e01117eee3cd --- /dev/null +++ b/packages/kbn-repo-info/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/repo-info", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-repo-info/tsconfig.json b/packages/kbn-repo-info/tsconfig.json new file mode 100644 index 000000000000..3bbf05e134ce --- /dev/null +++ b/packages/kbn-repo-info/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "checkJs": true, + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "index.js", + "types.ts" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-utils/src/package_json/index.ts b/packages/kbn-repo-info/types.ts similarity index 52% rename from packages/kbn-utils/src/package_json/index.ts rename to packages/kbn-repo-info/types.ts index fada3e15b97d..21aab323e57c 100644 --- a/packages/kbn-utils/src/package_json/index.ts +++ b/packages/kbn-repo-info/types.ts @@ -6,12 +6,7 @@ * Side Public License, v 1. */ -import Path from 'path'; -import Fs from 'fs'; - -import { REPO_ROOT } from '../repo_root'; - -interface KibanaPackageJson { +export interface KibanaPackageJson { name: string; version: string; branch: string; @@ -31,22 +26,3 @@ interface KibanaPackageJson { }; [key: string]: unknown; } - -function parseKibanaPackageJson() { - const path = Path.resolve(REPO_ROOT, 'package.json'); - const json = Fs.readFileSync(path, 'utf8'); - let pkg; - try { - pkg = JSON.parse(json); - } catch (error) { - throw new Error(`unable to parse kibana's package.json file: ${error.message}`); - } - - return pkg as KibanaPackageJson; -} - -export const kibanaPackageJson = parseKibanaPackageJson(); - -export const isKibanaDistributable = () => { - return kibanaPackageJson.build.distributable === true; -}; diff --git a/packages/kbn-repo-path/README.md b/packages/kbn-repo-path/README.md new file mode 100644 index 000000000000..ef281b3caba9 --- /dev/null +++ b/packages/kbn-repo-path/README.md @@ -0,0 +1,3 @@ +# @kbn/repo-path + +Empty package generated by @kbn/generate diff --git a/src/setup_node_env/polyfill.js b/packages/kbn-repo-path/index.ts similarity index 89% rename from src/setup_node_env/polyfill.js rename to packages/kbn-repo-path/index.ts index 465f9fef734f..3d79cd011ef4 100644 --- a/src/setup_node_env/polyfill.js +++ b/packages/kbn-repo-path/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -require('core-js/stable'); +export { RepoPath } from './repo_path'; diff --git a/packages/kbn-repo-path/jest.config.js b/packages/kbn-repo-path/jest.config.js new file mode 100644 index 000000000000..68e96763c263 --- /dev/null +++ b/packages/kbn-repo-path/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-repo-path'], +}; diff --git a/packages/kbn-repo-path/kibana.jsonc b/packages/kbn-repo-path/kibana.jsonc new file mode 100644 index 000000000000..2c0bc6368ff6 --- /dev/null +++ b/packages/kbn-repo-path/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/repo-path", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-repo-path/package.json b/packages/kbn-repo-path/package.json new file mode 100644 index 000000000000..8f53e6f63866 --- /dev/null +++ b/packages/kbn-repo-path/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/repo-path", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-repo-path/repo_path.ts b/packages/kbn-repo-path/repo_path.ts new file mode 100644 index 000000000000..65873bb4c224 --- /dev/null +++ b/packages/kbn-repo-path/repo_path.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +export class RepoPath { + constructor( + /** root path of the repo where this file was found */ + public readonly repoRoot: string, + /** repo-relative path to the file */ + public readonly repoRel: string + ) {} + + private _abs: string | undefined; + /** + * absolute path to the file + * (lazy and cached getter) + */ + public get abs() { + return (this._abs ??= Path.resolve(this.repoRoot, this.repoRel)); + } + + private _ext: string | undefined; + /** + * extension to the filename + * (lazy and cached getter) + */ + public get ext() { + return (this._ext ??= Path.extname(this.repoRel)); + } + + private _basename: string | undefined; + /** + * basename of the path + * (lazy and cached getter) + */ + public get basename() { + return (this._basename ??= Path.basename(this.repoRel)); + } + + isTypeScript() { + return this.ext === '.ts' || this.ext === '.tsx'; + } + + isTypeScriptAmbient() { + return this.repoRel.endsWith('.d.ts'); + } + + isJavaScript() { + return this.ext === '.js' || this.ext === '.jsx' || this.ext === '.mjs'; + } + + isFixture() { + const parts = this.repoRel.split('/'); + if (parts.includes('__fixtures__') || this.repoRel.endsWith('.test-d.ts')) { + return true; + } + + const i = parts.indexOf('kbn-generate'); + if (i >= 0 && parts[i + 1] === 'templates') { + return true; + } + + return false; + } +} diff --git a/packages/kbn-repo-path/tsconfig.json b/packages/kbn-repo-path/tsconfig.json new file mode 100644 index 000000000000..2f9ddddbeea2 --- /dev/null +++ b/packages/kbn-repo-path/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/packages/kbn-repo-source-classifier-cli/BUILD.bazel b/packages/kbn-repo-source-classifier-cli/BUILD.bazel deleted file mode 100644 index 6706dc9aa2c1..000000000000 --- a/packages/kbn-repo-source-classifier-cli/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-repo-source-classifier-cli" -PKG_REQUIRE_NAME = "@kbn/repo-source-classifier-cli" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-dev-cli-runner", - "//packages/kbn-dev-cli-errors", - "//packages/kbn-import-resolver", - "//packages/kbn-repo-source-classifier", - "//packages/kbn-get-repo-files", - "//packages/kbn-utils", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-dev-cli-runner:npm_module_types", - "//packages/kbn-dev-cli-errors:npm_module_types", - "//packages/kbn-import-resolver:npm_module_types", - "//packages/kbn-repo-source-classifier:npm_module_types", - "//packages/kbn-get-repo-files:npm_module_types", - "//packages/kbn-utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-repo-source-classifier-cli/index.ts b/packages/kbn-repo-source-classifier-cli/index.ts index 13531215ee67..0e30d92b4a8e 100644 --- a/packages/kbn-repo-source-classifier-cli/index.ts +++ b/packages/kbn-repo-source-classifier-cli/index.ts @@ -10,7 +10,7 @@ import Path from 'path'; import { RepoSourceClassifier } from '@kbn/repo-source-classifier'; import { ImportResolver } from '@kbn/import-resolver'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getRepoFiles } from '@kbn/get-repo-files'; import { run } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-repo-source-classifier-cli/kibana.jsonc b/packages/kbn-repo-source-classifier-cli/kibana.jsonc index a93259974364..916b42e59d7b 100644 --- a/packages/kbn-repo-source-classifier-cli/kibana.jsonc +++ b/packages/kbn-repo-source-classifier-cli/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/repo-source-classifier-cli", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-repo-source-classifier-cli/package.json b/packages/kbn-repo-source-classifier-cli/package.json index 490014811b83..cc52a3314a1b 100644 --- a/packages/kbn-repo-source-classifier-cli/package.json +++ b/packages/kbn-repo-source-classifier-cli/package.json @@ -2,7 +2,5 @@ "name": "@kbn/repo-source-classifier-cli", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-repo-source-classifier-cli/tsconfig.json b/packages/kbn-repo-source-classifier-cli/tsconfig.json index 57c1dd1c94e0..07b64f1834e4 100644 --- a/packages/kbn-repo-source-classifier-cli/tsconfig.json +++ b/packages/kbn-repo-source-classifier-cli/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/import-resolver", + "@kbn/repo-source-classifier", + "@kbn/get-repo-files", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-repo-source-classifier/BUILD.bazel b/packages/kbn-repo-source-classifier/BUILD.bazel deleted file mode 100644 index b143ea3f9312..000000000000 --- a/packages/kbn-repo-source-classifier/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-repo-source-classifier" -PKG_REQUIRE_NAME = "@kbn/repo-source-classifier" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//normalize-path", - "//packages/kbn-import-resolver:npm_module_types", - "//packages/kbn-utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-repo-source-classifier/kibana.jsonc b/packages/kbn-repo-source-classifier/kibana.jsonc index edeb2d3c64a3..e717374c9c7e 100644 --- a/packages/kbn-repo-source-classifier/kibana.jsonc +++ b/packages/kbn-repo-source-classifier/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/repo-source-classifier", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-repo-source-classifier/package.json b/packages/kbn-repo-source-classifier/package.json index bda6886d162d..65aac900e204 100644 --- a/packages/kbn-repo-source-classifier/package.json +++ b/packages/kbn-repo-source-classifier/package.json @@ -2,7 +2,5 @@ "name": "@kbn/repo-source-classifier", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-repo-source-classifier/src/config.ts b/packages/kbn-repo-source-classifier/src/config.ts index 6f6b9251988c..283ca70b20c6 100644 --- a/packages/kbn-repo-source-classifier/src/config.ts +++ b/packages/kbn-repo-source-classifier/src/config.ts @@ -19,6 +19,7 @@ export const RANDOM_TEST_FILE_NAMES = new Set([ 'enzyme_helpers', 'fixtures', 'testbed', + 'jest.config', ]); // tags are found in filenames after a `.`, like `name.tag.ts` diff --git a/packages/kbn-repo-source-classifier/src/repo_path.ts b/packages/kbn-repo-source-classifier/src/repo_path.ts index cd13adf0cb82..e1e5151ff207 100644 --- a/packages/kbn-repo-source-classifier/src/repo_path.ts +++ b/packages/kbn-repo-source-classifier/src/repo_path.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ImportResolver } from '@kbn/import-resolver'; import normalizePath from 'normalize-path'; diff --git a/packages/kbn-repo-source-classifier/src/repo_source_classifier.ts b/packages/kbn-repo-source-classifier/src/repo_source_classifier.ts index f3aecbb49d24..d0fcbf496654 100644 --- a/packages/kbn-repo-source-classifier/src/repo_source_classifier.ts +++ b/packages/kbn-repo-source-classifier/src/repo_source_classifier.ts @@ -142,14 +142,40 @@ export class RepoSourceClassifier { } const { pkgId, rel } = pkgInfo; + + if (pkgId === '@kbn/test' || pkgId === '@kbn/test-subj-selector') { + return 'common package'; + } + const pkgIdWords = new Set(pkgId.split(/\W+/)); // treat any package with "mocks" or "storybook" in the ID as a test-specific package if (pkgIdWords.has('mocks') || pkgIdWords.has('storybook') || pkgIdWords.has('test')) { return 'tests or mocks'; } + if (Array.from(pkgIdWords).at(-1) === 'cli') { + return 'tooling'; + } - if (path.resolver.isBazelPackage(pkgId)) { - return 'common package'; + const manifest = this.resolver.getPkgManifest(pkgId); + if (manifest) { + switch (manifest.type) { + case 'functional-tests': + case 'test-helper': + return 'tests or mocks'; + case 'plugin-browser': + case 'shared-browser': + return 'browser package'; + case 'plugin-server': + case 'shared-server': + return 'server package'; + case 'shared-scss': + return 'static'; + case 'shared-common': + return 'common package'; + default: + // @ts-expect-error if there isn't an error here we are missing a case for a package type + throw new Error(`unexpected package type [${manifest.type}]`); + } } const [root, ...dirs] = rel.split('/'); diff --git a/packages/kbn-repo-source-classifier/tsconfig.json b/packages/kbn-repo-source-classifier/tsconfig.json index 57c1dd1c94e0..f41dffcd32f0 100644 --- a/packages/kbn-repo-source-classifier/tsconfig.json +++ b/packages/kbn-repo-source-classifier/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/import-resolver", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-rison/BUILD.bazel b/packages/kbn-rison/BUILD.bazel index 948affb52f44..4cb5cd714a02 100644 --- a/packages/kbn-rison/BUILD.bazel +++ b/packages/kbn-rison/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-rison" -PKG_REQUIRE_NAME = "@kbn/rison" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", ], @@ -24,100 +19,14 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ +BUNDLER_DEPS = [ "@npm//rison-node", ] -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], + name = "kbn-rison", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + package_name = "@kbn/rison", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-rison/kibana.jsonc b/packages/kbn-rison/kibana.jsonc index e2543dbebbc1..c0e6145d04a7 100644 --- a/packages/kbn-rison/kibana.jsonc +++ b/packages/kbn-rison/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/rison", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-rison/package.json b/packages/kbn-rison/package.json index 692d31de2243..efe4223acd33 100644 --- a/packages/kbn-rison/package.json +++ b/packages/kbn-rison/package.json @@ -2,7 +2,5 @@ "name": "@kbn/rison", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-rison/tsconfig.json b/packages/kbn-rison/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-rison/tsconfig.json +++ b/packages/kbn-rison/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-rule-data-utils/BUILD.bazel b/packages/kbn-rule-data-utils/BUILD.bazel deleted file mode 100644 index fe77bd4443fe..000000000000 --- a/packages/kbn-rule-data-utils/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-rule-data-utils" -PKG_REQUIRE_NAME = "@kbn/rule-data-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-es-query", - "@npm//@elastic/elasticsearch", - "@npm//tslib", - "@npm//utility-types", -] - -TYPES_DEPS = [ - "//packages/kbn-es-query:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//tslib", - "@npm//utility-types", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-rule-data-utils/kibana.jsonc b/packages/kbn-rule-data-utils/kibana.jsonc index 654155c88397..6650a9b1d67f 100644 --- a/packages/kbn-rule-data-utils/kibana.jsonc +++ b/packages/kbn-rule-data-utils/kibana.jsonc @@ -5,7 +5,5 @@ "@elastic/security-detections-response", "@elastic/actionable-observability", "@elastic/response-ops" - ], - "runtimeDeps": [], - "typeDeps": [] + ] } diff --git a/packages/kbn-rule-data-utils/package.json b/packages/kbn-rule-data-utils/package.json index 9613e173d6f4..bf1c9795a367 100644 --- a/packages/kbn-rule-data-utils/package.json +++ b/packages/kbn-rule-data-utils/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/rule-data-utils", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/packages/kbn-rule-data-utils/tsconfig.json index 57c1dd1c94e0..5c94013fc2ea 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/packages/kbn-rule-data-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/es-query" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-safer-lodash-set/BUILD.bazel b/packages/kbn-safer-lodash-set/BUILD.bazel index 3a5d07ab3890..b7cfbbe50bd5 100644 --- a/packages/kbn-safer-lodash-set/BUILD.bazel +++ b/packages/kbn-safer-lodash-set/BUILD.bazel @@ -1,9 +1,6 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -PKG_DIRNAME = "kbn-safer-lodash-set" -PKG_REQUIRE_NAME = "@kbn/safer-lodash-set" - -SOURCE_FILES = glob( +SRCS = glob( [ "fp/**/*", "lodash/**/*", @@ -16,60 +13,14 @@ SOURCE_FILES = glob( ], ) -TYPE_FILES = glob([ - "fp/**/*.d.ts", - "index.d.ts", - "set.d.ts", - "setWith.d.ts", -]) - -SRCS = SOURCE_FILES + TYPE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - DEPS = [ "@npm//lodash", ] js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], + name = "kbn-safer-lodash-set", + package_name = "@kbn/safer-lodash-set", + srcs = ["package.json"] + SRCS, deps = DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = PKG_DIRNAME, - visibility = ["//visibility:public"], -) - -alias( - name = "build_types", - actual = "build", visibility = ["//visibility:public"], ) diff --git a/packages/kbn-safer-lodash-set/kibana.jsonc b/packages/kbn-safer-lodash-set/kibana.jsonc index 8d7c5dfbb6bb..d01d41b9a621 100644 --- a/packages/kbn-safer-lodash-set/kibana.jsonc +++ b/packages/kbn-safer-lodash-set/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/safer-lodash-set", - "owner": "@elastic/kibana-security", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-security" } diff --git a/packages/kbn-safer-lodash-set/package.json b/packages/kbn-safer-lodash-set/package.json index 8d1b80bdfb08..5004f1893061 100644 --- a/packages/kbn-safer-lodash-set/package.json +++ b/packages/kbn-safer-lodash-set/package.json @@ -2,8 +2,6 @@ "name": "@kbn/safer-lodash-set", "version": "0.0.0", "description": "A safer version of the lodash set and setWith functions", - "main": "index.js", - "types": "./target_types/index.d.ts", "scripts": { "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/kbn-safer-lodash-set/set.js ./packages/kbn-safer-lodash-set/setWith.js ./packages/kbn-safer-lodash-set/fp/*.js", "test": "npm run lint && ../../node_modules/.bin/tape test/*.js && npm run test:types", diff --git a/packages/kbn-safer-lodash-set/tsconfig.json b/packages/kbn-safer-lodash-set/tsconfig.json index 48aa6ed341d6..0d3736eeafd0 100644 --- a/packages/kbn-safer-lodash-set/tsconfig.json +++ b/packages/kbn-safer-lodash-set/tsconfig.json @@ -1,7 +1,12 @@ { - "extends": "../../tsconfig.bazel.json", - "compilerOptions": {}, + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, "include": [ "**/*", ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel deleted file mode 100644 index 8309ff7f0ef4..000000000000 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ /dev/null @@ -1,143 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-autocomplete" -PKG_REQUIRE_NAME = "@kbn/securitysolution-autocomplete" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-datemath", - "//packages/kbn-es-query", - "//packages/kbn-i18n", - "//packages/kbn-securitysolution-io-ts-list-types", - "//packages/kbn-securitysolution-list-hooks", - "//packages/kbn-securitysolution-list-utils", - "//packages/kbn-doc-links", - "@npm//@elastic/eui", - "@npm//@testing-library/react", - "@npm//@testing-library/react-hooks", - "@npm//enzyme", - "@npm//lodash", - "@npm//moment", - "@npm//react", -] - -TYPES_DEPS = [ - "//packages/kbn-datemath:npm_module_types", - "//packages/kbn-es-query:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", - "//packages/kbn-securitysolution-list-hooks:npm_module_types", - "//packages/kbn-securitysolution-list-utils:npm_module_types", - "//packages/kbn-doc-links:npm_module_types", - "@npm//@elastic/eui", - "@npm//@testing-library/react", - "@npm//@testing-library/react-hooks", - "@npm//moment", - "@npm//tslib", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-autocomplete/kibana.jsonc b/packages/kbn-securitysolution-autocomplete/kibana.jsonc index fbf73ddf07fb..8fb42cbdb30f 100644 --- a/packages/kbn-securitysolution-autocomplete/kibana.jsonc +++ b/packages/kbn-securitysolution-autocomplete/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-autocomplete", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-autocomplete/package.json b/packages/kbn-securitysolution-autocomplete/package.json index 91b92d5aa4b3..33bcb4e05206 100644 --- a/packages/kbn-securitysolution-autocomplete/package.json +++ b/packages/kbn-securitysolution-autocomplete/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "Security Solution auto complete", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.json b/packages/kbn-securitysolution-autocomplete/tsconfig.json index 2b02a63db1d0..f7df7da6f06a 100644 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.json +++ b/packages/kbn-securitysolution-autocomplete/tsconfig.json @@ -1,13 +1,24 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["jest", "node"] }, "include": [ "**/*.ts", "**/*.tsx", ], + "kbn_references": [ + "@kbn/datemath", + "@kbn/es-query", + "@kbn/i18n", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-list-hooks", + "@kbn/securitysolution-list-utils", + "@kbn/doc-links", + "@kbn/securitysolution-utils", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-securitysolution-es-utils/BUILD.bazel b/packages/kbn-securitysolution-es-utils/BUILD.bazel deleted file mode 100644 index c4ff9faedce2..000000000000 --- a/packages/kbn-securitysolution-es-utils/BUILD.bazel +++ /dev/null @@ -1,114 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-es-utils" -PKG_REQUIRE_NAME = "@kbn/securitysolution-es-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//@elastic/elasticsearch", - "@npm//@hapi/boom", - "@npm//@hapi/hapi", - "@npm//tslib", -] - -TYPES_DEPS = [ - "@npm//@elastic/elasticsearch", - "@npm//@hapi/boom", - "@npm//tslib", - "@npm//@types/hapi__hapi", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-es-utils/kibana.jsonc b/packages/kbn-securitysolution-es-utils/kibana.jsonc index a798aefeae37..b04ff412e507 100644 --- a/packages/kbn-securitysolution-es-utils/kibana.jsonc +++ b/packages/kbn-securitysolution-es-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-es-utils", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-es-utils/package.json b/packages/kbn-securitysolution-es-utils/package.json index d4cc8d25a36f..3083acffa063 100644 --- a/packages/kbn-securitysolution-es-utils/package.json +++ b/packages/kbn-securitysolution-es-utils/package.json @@ -3,7 +3,5 @@ "version": "1.0.0", "description": "security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc...", "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ b/packages/kbn-securitysolution-es-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-exception-list-components/BUILD.bazel b/packages/kbn-securitysolution-exception-list-components/BUILD.bazel deleted file mode 100644 index 36379eea9184..000000000000 --- a/packages/kbn-securitysolution-exception-list-components/BUILD.bazel +++ /dev/null @@ -1,163 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - - -PKG_DIRNAME = "kbn-securitysolution-exception-list-components" -PKG_REQUIRE_NAME = "@kbn/securitysolution-exception-list-components" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.svg", - "**/*.d.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "jest.config.js" -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/kbn-securitysolution-io-ts-list-types", - "//packages/kbn-securitysolution-autocomplete", - "//packages/kbn-ui-theme", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@testing-library/jest-dom", - "@npm//jest", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", - "//packages/kbn-securitysolution-autocomplete:npm_module_types", - "//packages/kbn-ui-theme:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//jest", - -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-exception-list-components/kibana.jsonc b/packages/kbn-securitysolution-exception-list-components/kibana.jsonc index 081c50d35af0..8ab71311e449 100644 --- a/packages/kbn-securitysolution-exception-list-components/kibana.jsonc +++ b/packages/kbn-securitysolution-exception-list-components/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-exception-list-components", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-exception-list-components/package.json b/packages/kbn-securitysolution-exception-list-components/package.json index b0acf0d547f8..297b54d4a80a 100644 --- a/packages/kbn-securitysolution-exception-list-components/package.json +++ b/packages/kbn-securitysolution-exception-list-components/package.json @@ -2,8 +2,5 @@ "name": "@kbn/securitysolution-exception-list-components", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-exception-list-components/tsconfig.json b/packages/kbn-securitysolution-exception-list-components/tsconfig.json index e1a84c71fdfd..988ad42191b7 100644 --- a/packages/kbn-securitysolution-exception-list-components/tsconfig.json +++ b/packages/kbn-securitysolution-exception-list-components/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,14 @@ "**/*.ts", "**/*.tsx", "**/*.d.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-autocomplete", + "@kbn/ui-theme", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-hook-utils/BUILD.bazel b/packages/kbn-securitysolution-hook-utils/BUILD.bazel deleted file mode 100644 index f2886137fedd..000000000000 --- a/packages/kbn-securitysolution-hook-utils/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-hook-utils" -PKG_REQUIRE_NAME = "@kbn/securitysolution-hook-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//@testing-library/react-hooks", - "@npm//react", - "@npm//rxjs", - "@npm//tslib", -] - -TYPES_DEPS = [ - "@npm//@testing-library/react-hooks", - "@npm//rxjs", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-hook-utils/kibana.jsonc b/packages/kbn-securitysolution-hook-utils/kibana.jsonc index cd7d23f07792..0ce78952b9fe 100644 --- a/packages/kbn-securitysolution-hook-utils/kibana.jsonc +++ b/packages/kbn-securitysolution-hook-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-hook-utils", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-hook-utils/package.json b/packages/kbn-securitysolution-hook-utils/package.json index e676b6494a01..39c3b9aa0133 100644 --- a/packages/kbn-securitysolution-hook-utils/package.json +++ b/packages/kbn-securitysolution-hook-utils/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "Security Solution utilities for React hooks", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-hook-utils/tsconfig.json b/packages/kbn-securitysolution-hook-utils/tsconfig.json index b1621b0cd447..9b5c5373afe0 100644 --- a/packages/kbn-securitysolution-hook-utils/tsconfig.json +++ b/packages/kbn-securitysolution-hook-utils/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["jest", "node"] }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel deleted file mode 100644 index 51ab304ca82a..000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-io-ts-alerting-types" -PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-alerting-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-securitysolution-io-ts-types", - "//packages/kbn-securitysolution-io-ts-utils", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//uuid", -] - -TYPES_DEPS = [ - "//packages/kbn-securitysolution-io-ts-types:npm_module_types", - "//packages/kbn-securitysolution-io-ts-utils:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/uuid" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc b/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc index d1e730f414d1..617a3125a8c7 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc +++ b/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-io-ts-alerting-types", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/package.json b/packages/kbn-securitysolution-io-ts-alerting-types/package.json index bcfacbe9c514..c570745f5167 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/package.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "io ts utilities and types to be shared with plugins from the security solution project", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json index 57c1dd1c94e0..f9fb0b0fcebb 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel deleted file mode 100644 index 28b36936420f..000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-io-ts-list-types" -PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-list-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-securitysolution-io-ts-types", - "//packages/kbn-securitysolution-io-ts-utils", - "//packages/kbn-securitysolution-list-constants", - "@npm//fp-ts", - "@npm//io-ts", -] - -TYPES_DEPS = [ - "//packages/kbn-securitysolution-io-ts-types:npm_module_types", - "//packages/kbn-securitysolution-io-ts-utils:npm_module_types", - "//packages/kbn-securitysolution-list-constants:npm_module_types", - "//packages/kbn-es-query:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc b/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc index d50df0b0d651..404a225ca7f8 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc +++ b/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-io-ts-list-types", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-io-ts-list-types/package.json b/packages/kbn-securitysolution-io-ts-list-types/package.json index 20dd5d2e37ad..3794f95d0f8b 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/package.json +++ b/packages/kbn-securitysolution-io-ts-list-types/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "io ts utilities and types to be shared with plugins from the security solution project", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json index 57c1dd1c94e0..fa66258766fd 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,14 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/es-query" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel deleted file mode 100644 index 4b102f68e2a4..000000000000 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-io-ts-types" -PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-types" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-securitysolution-io-ts-utils", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//uuid", -] - -TYPES_DEPS = [ - "//packages/kbn-securitysolution-io-ts-utils:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/uuid" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-io-ts-types/kibana.jsonc b/packages/kbn-securitysolution-io-ts-types/kibana.jsonc index 6ef8a21b00e1..007244ad6f09 100644 --- a/packages/kbn-securitysolution-io-ts-types/kibana.jsonc +++ b/packages/kbn-securitysolution-io-ts-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-io-ts-types", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-io-ts-types/package.json b/packages/kbn-securitysolution-io-ts-types/package.json index e02a79f16a09..6bbb9a230033 100644 --- a/packages/kbn-securitysolution-io-ts-types/package.json +++ b/packages/kbn-securitysolution-io-ts-types/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "io ts utilities and types to be shared with plugins from the security solution project", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-types/tsconfig.json index 57c1dd1c94e0..25b82d38b7dc 100644 --- a/packages/kbn-securitysolution-io-ts-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-utils" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel deleted file mode 100644 index 9ec44f8d5254..000000000000 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ /dev/null @@ -1,125 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-io-ts-utils" -PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-datemath", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//lodash", - "@npm//moment", - "@npm//tslib", -] - -TYPES_DEPS = [ - "//packages/kbn-datemath:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//moment", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-io-ts-utils/kibana.jsonc b/packages/kbn-securitysolution-io-ts-utils/kibana.jsonc index 2c86eea21c0c..980cdb3979fc 100644 --- a/packages/kbn-securitysolution-io-ts-utils/kibana.jsonc +++ b/packages/kbn-securitysolution-io-ts-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-io-ts-utils", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-io-ts-utils/package.json b/packages/kbn-securitysolution-io-ts-utils/package.json index 8ae2eff526ac..c6bdf4a7d098 100644 --- a/packages/kbn-securitysolution-io-ts-utils/package.json +++ b/packages/kbn-securitysolution-io-ts-utils/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "io ts utilities and types to be shared with plugins from the security solution project", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json index 57c1dd1c94e0..13f8244edd1a 100644 --- a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/datemath" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel deleted file mode 100644 index 05254f32c2c7..000000000000 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-list-api" -PKG_REQUIRE_NAME = "@kbn/securitysolution-list-api" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-securitysolution-io-ts-list-types", - "//packages/kbn-securitysolution-io-ts-utils", - "//packages/kbn-securitysolution-list-constants", - "@npm//fp-ts", - "@npm//io-ts", -] - -TYPES_DEPS = [ - "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", - "//packages/kbn-securitysolution-io-ts-utils:npm_module_types", - "//packages/kbn-securitysolution-list-constants:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - srcs = SRCS, - deps = TYPES_DEPS, - args = ["--pretty"], - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-list-api/kibana.jsonc b/packages/kbn-securitysolution-list-api/kibana.jsonc index b162805a8c8b..d8dc7a8a9057 100644 --- a/packages/kbn-securitysolution-list-api/kibana.jsonc +++ b/packages/kbn-securitysolution-list-api/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-list-api", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-list-api/package.json b/packages/kbn-securitysolution-list-api/package.json index 01156ef460a9..681f624f1d8c 100644 --- a/packages/kbn-securitysolution-list-api/package.json +++ b/packages/kbn-securitysolution-list-api/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution list REST API", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-api/src/api/index.test.ts b/packages/kbn-securitysolution-list-api/src/api/index.test.ts deleted file mode 100644 index 02cc02ced5ac..000000000000 --- a/packages/kbn-securitysolution-list-api/src/api/index.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -describe('Exceptions Lists API', () => { - test('we should port these tests', () => { - // See the file outside of this at: x-pack/plugins/lists/public/exceptions/api.test.ts - // for the tests. We cannot port the tests over until we move the mocks into their own package - // and possibly core mocks end up within packages. - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-api/tsconfig.json b/packages/kbn-securitysolution-list-api/tsconfig.json index 57c1dd1c94e0..2c2ca29316fc 100644 --- a/packages/kbn-securitysolution-list-api/tsconfig.json +++ b/packages/kbn-securitysolution-list-api/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel deleted file mode 100644 index ac40cb7889e8..000000000000 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ /dev/null @@ -1,115 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-list-constants" -PKG_REQUIRE_NAME = "@kbn/securitysolution-list-constants" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-std", -] - -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "//packages/kbn-std:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - srcs = SRCS, - deps = TYPES_DEPS, - args = ["--pretty"], - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-list-constants/kibana.jsonc b/packages/kbn-securitysolution-list-constants/kibana.jsonc index ffe606ca6ade..898927abb1ea 100644 --- a/packages/kbn-securitysolution-list-constants/kibana.jsonc +++ b/packages/kbn-securitysolution-list-constants/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-list-constants", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-list-constants/package.json b/packages/kbn-securitysolution-list-constants/package.json index 2b8be64d9454..adba0ce4ab22 100644 --- a/packages/kbn-securitysolution-list-constants/package.json +++ b/packages/kbn-securitysolution-list-constants/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution list constants to use across plugins such lists, security_solution, cases, etc...", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-constants/tsconfig.json b/packages/kbn-securitysolution-list-constants/tsconfig.json index 57c1dd1c94e0..0cd8de173ed4 100644 --- a/packages/kbn-securitysolution-list-constants/tsconfig.json +++ b/packages/kbn-securitysolution-list-constants/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/std" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel deleted file mode 100644 index e1cbefa4ab0c..000000000000 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ /dev/null @@ -1,131 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-list-hooks" -PKG_REQUIRE_NAME = "@kbn/securitysolution-list-hooks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-securitysolution-hook-utils", - "//packages/kbn-securitysolution-io-ts-list-types", - "//packages/kbn-securitysolution-list-api", - "//packages/kbn-securitysolution-list-constants", - "//packages/kbn-securitysolution-list-utils", - "//packages/kbn-securitysolution-utils", - "@npm//@testing-library/react-hooks", - "@npm//fp-ts", - "@npm//react", -] - -TYPES_DEPS = [ - "//packages/kbn-securitysolution-hook-utils:npm_module_types", - "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", - "//packages/kbn-securitysolution-list-api:npm_module_types", - "//packages/kbn-securitysolution-list-constants:npm_module_types", - "//packages/kbn-securitysolution-list-utils:npm_module_types", - "//packages/kbn-securitysolution-utils:npm_module_types", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "@npm//fp-ts", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-list-hooks/kibana.jsonc b/packages/kbn-securitysolution-list-hooks/kibana.jsonc index 12d670f46ae3..bf885e2ac37c 100644 --- a/packages/kbn-securitysolution-list-hooks/kibana.jsonc +++ b/packages/kbn-securitysolution-list-hooks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-list-hooks", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-list-hooks/package.json b/packages/kbn-securitysolution-list-hooks/package.json index 75d0ec81e656..0a21618561b2 100644 --- a/packages/kbn-securitysolution-list-hooks/package.json +++ b/packages/kbn-securitysolution-list-hooks/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "Security solution list ReactJS hooks", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts index aab7dfd7b2b7..6b46fb33cfab 100644 --- a/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts +++ b/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts @@ -19,7 +19,7 @@ import { removeIdFromExceptionItemsEntries, transformInput, transformOutput, -} from '@kbn/securitysolution-list-hooks'; +} from '../..'; import { getCreateExceptionListItemSchemaMock } from '../mocks/request/create_exception_list_item_schema.mock'; import { getUpdateExceptionListItemSchemaMock } from '../mocks/request/update_exception_list_item_schema.mock'; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts deleted file mode 100644 index 7ccf2146594b..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useApi', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts deleted file mode 100644 index e0285d39f2fa..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useCreateListIndex', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts deleted file mode 100644 index 7236000fef99..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useExceptionLists', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.test.ts deleted file mode 100644 index 92ac43c83427..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useExceptionLists', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.test.ts deleted file mode 100644 index 0bf2a722a833..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useImportList', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts deleted file mode 100644 index 3971d066ddee..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('usePersistExceptionItem', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts deleted file mode 100644 index 6fe38f4d6d27..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('usePersistExceptionList', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts deleted file mode 100644 index bb63ed86d01e..000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('useReadListIndex', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/tsconfig.json b/packages/kbn-securitysolution-list-hooks/tsconfig.json index 57c1dd1c94e0..417beef57542 100644 --- a/packages/kbn-securitysolution-list-hooks/tsconfig.json +++ b/packages/kbn-securitysolution-list-hooks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-hook-utils", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-list-api", + "@kbn/securitysolution-list-utils", + "@kbn/securitysolution-utils", + "@kbn/core-http-browser-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel deleted file mode 100644 index 20a6074aee9c..000000000000 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-list-utils" -PKG_REQUIRE_NAME = "@kbn/securitysolution-list-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-es-query", - "//packages/kbn-i18n", - "//packages/kbn-securitysolution-io-ts-list-types", - "//packages/kbn-securitysolution-io-ts-utils", - "//packages/kbn-securitysolution-list-constants", - "//packages/kbn-securitysolution-utils", - "@npm//lodash", - "@npm//uuid", -] - -TYPES_DEPS = [ - "//packages/kbn-es-query:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-securitysolution-io-ts-list-types:npm_module_types", - "//packages/kbn-securitysolution-io-ts-utils:npm_module_types", - "//packages/kbn-securitysolution-list-constants:npm_module_types", - "//packages/kbn-securitysolution-utils:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/uuid", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], - -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], - -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-list-utils/kibana.jsonc b/packages/kbn-securitysolution-list-utils/kibana.jsonc index db7d0a5ec334..0c6f734a2360 100644 --- a/packages/kbn-securitysolution-list-utils/kibana.jsonc +++ b/packages/kbn-securitysolution-list-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-list-utils", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-list-utils/package.json b/packages/kbn-securitysolution-list-utils/package.json index 548f68c1f0eb..0cb4d35b2d5e 100644 --- a/packages/kbn-securitysolution-list-utils/package.json +++ b/packages/kbn-securitysolution-list-utils/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution list utilities", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts b/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts deleted file mode 100644 index e0cab13b4452..000000000000 --- a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -describe('Exception builder helpers', () => { - test('we should port these tests', () => { - // See the file outside of this at: x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts - // for the tests. We cannot port the tests over until we move the mocks into their own package - // and possibly core mocks end up within packages. - expect(true).toBe(true); - }); -}); diff --git a/packages/kbn-securitysolution-list-utils/tsconfig.json b/packages/kbn-securitysolution-list-utils/tsconfig.json index 57c1dd1c94e0..c0aaedaafd84 100644 --- a/packages/kbn-securitysolution-list-utils/tsconfig.json +++ b/packages/kbn-securitysolution-list-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,16 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/es-query", + "@kbn/i18n", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/securitysolution-utils" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-rules/BUILD.bazel b/packages/kbn-securitysolution-rules/BUILD.bazel deleted file mode 100644 index 7519e7bae1dd..000000000000 --- a/packages/kbn-securitysolution-rules/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-rules" -PKG_REQUIRE_NAME = "@kbn/securitysolution-rules" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//tslib", - "@npm//uuid", -] - -TYPES_DEPS = [ - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/uuid" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-rules/kibana.jsonc b/packages/kbn-securitysolution-rules/kibana.jsonc index b7e64cfd39e6..38deebcbbdc5 100644 --- a/packages/kbn-securitysolution-rules/kibana.jsonc +++ b/packages/kbn-securitysolution-rules/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-rules", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-rules/package.json b/packages/kbn-securitysolution-rules/package.json index 5e41733300a3..1ca22df9300f 100644 --- a/packages/kbn-securitysolution-rules/package.json +++ b/packages/kbn-securitysolution-rules/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution rule utilities to use across plugins", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-rules/tsconfig.json b/packages/kbn-securitysolution-rules/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-securitysolution-rules/tsconfig.json +++ b/packages/kbn-securitysolution-rules/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-t-grid/BUILD.bazel b/packages/kbn-securitysolution-t-grid/BUILD.bazel deleted file mode 100644 index 219d8e85a664..000000000000 --- a/packages/kbn-securitysolution-t-grid/BUILD.bazel +++ /dev/null @@ -1,120 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-t-grid" -PKG_REQUIRE_NAME = "@kbn/securitysolution-t-grid" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//jest", - "@npm//lodash", - "@npm//react-beautiful-dnd", - "@npm//tslib", -] - -TYPES_DEPS = [ - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react-beautiful-dnd", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-t-grid/kibana.jsonc b/packages/kbn-securitysolution-t-grid/kibana.jsonc index bc0f533b7212..bc63fa6a8cb1 100644 --- a/packages/kbn-securitysolution-t-grid/kibana.jsonc +++ b/packages/kbn-securitysolution-t-grid/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-t-grid", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-t-grid/package.json b/packages/kbn-securitysolution-t-grid/package.json index 95c525df9b15..5144111cca18 100644 --- a/packages/kbn-securitysolution-t-grid/package.json +++ b/packages/kbn-securitysolution-t-grid/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.json b/packages/kbn-securitysolution-t-grid/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-securitysolution-t-grid/tsconfig.json +++ b/packages/kbn-securitysolution-t-grid/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-securitysolution-utils/BUILD.bazel b/packages/kbn-securitysolution-utils/BUILD.bazel deleted file mode 100644 index 1144c136e74a..000000000000 --- a/packages/kbn-securitysolution-utils/BUILD.bazel +++ /dev/null @@ -1,119 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-securitysolution-utils" -PKG_REQUIRE_NAME = "@kbn/securitysolution-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "@npm//tslib", - "@npm//uuid" -] - -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/uuid" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ["--pretty"], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-securitysolution-utils/kibana.jsonc b/packages/kbn-securitysolution-utils/kibana.jsonc index 24e63965c20c..de28a8dae699 100644 --- a/packages/kbn-securitysolution-utils/kibana.jsonc +++ b/packages/kbn-securitysolution-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/securitysolution-utils", - "owner": "@elastic/security-solution-platform", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/security-solution-platform" } diff --git a/packages/kbn-securitysolution-utils/package.json b/packages/kbn-securitysolution-utils/package.json index 2c77139c326d..63bcac7f14f1 100644 --- a/packages/kbn-securitysolution-utils/package.json +++ b/packages/kbn-securitysolution-utils/package.json @@ -3,8 +3,5 @@ "version": "1.0.0", "description": "security solution utilities to use across plugins such lists, security_solution, cases, etc...", "license": "SSPL-1.0 OR Elastic License 2.0", - "browser": "./target_web/index.js", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-securitysolution-utils/tsconfig.json b/packages/kbn-securitysolution-utils/tsconfig.json index 57c1dd1c94e0..9e62b09e954f 100644 --- a/packages/kbn-securitysolution-utils/tsconfig.json +++ b/packages/kbn-securitysolution-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/i18n" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-server-http-tools/BUILD.bazel b/packages/kbn-server-http-tools/BUILD.bazel deleted file mode 100644 index 6cbd74e12656..000000000000 --- a/packages/kbn-server-http-tools/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-server-http-tools" -PKG_REQUIRE_NAME = "@kbn/server-http-tools" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.mocks.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-config-schema", - "//packages/kbn-crypto", - "@npm//@hapi/hapi", - "@npm//@hapi/hoek", - "@npm//joi", - "@npm//moment", - "@npm//uuid", -] - -TYPES_DEPS = [ - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-crypto:npm_module_types", - "@npm//@hapi/hapi", - "@npm//@hapi/hoek", - "@npm//joi", - "@npm//moment", - "@npm//@types/hapi__hapi", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/uuid", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-server-http-tools/kibana.jsonc b/packages/kbn-server-http-tools/kibana.jsonc index b96916745c98..c2b6aae999c2 100644 --- a/packages/kbn-server-http-tools/kibana.jsonc +++ b/packages/kbn-server-http-tools/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/server-http-tools", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-server-http-tools/package.json b/packages/kbn-server-http-tools/package.json index b0abbd436e93..309e405200e4 100644 --- a/packages/kbn-server-http-tools/package.json +++ b/packages/kbn-server-http-tools/package.json @@ -1,9 +1,7 @@ { "name": "@kbn/server-http-tools", - "main": "./target_node/index.js", "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-server-http-tools/tsconfig.json b/packages/kbn-server-http-tools/tsconfig.json index 57c1dd1c94e0..179eec6f37c2 100644 --- a/packages/kbn-server-http-tools/tsconfig.json +++ b/packages/kbn-server-http-tools/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/crypto" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-server-route-repository/BUILD.bazel b/packages/kbn-server-route-repository/BUILD.bazel deleted file mode 100644 index 19360a1da0f8..000000000000 --- a/packages/kbn-server-route-repository/BUILD.bazel +++ /dev/null @@ -1,130 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-server-route-repository" -PKG_REQUIRE_NAME = "@kbn/server-route-repository" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-config-schema", - "//packages/kbn-io-ts-utils", - "@npm//@hapi/boom", - "@npm//fp-ts", - "@npm//lodash", - "@npm//utility-types" -] - -TYPES_DEPS = [ - "//packages/kbn-config-schema:npm_module_types", - "//packages/kbn-io-ts-utils:npm_module_types", - "@npm//@hapi/boom", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//utility-types", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = [ - "web_index.ts", - "src/format_request.ts", - "src/parse_endpoint.ts", - ], - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-server-route-repository/web_index.ts b/packages/kbn-server-route-repository/browser_index.ts similarity index 100% rename from packages/kbn-server-route-repository/web_index.ts rename to packages/kbn-server-route-repository/browser_index.ts diff --git a/packages/kbn-server-route-repository/kibana.jsonc b/packages/kbn-server-route-repository/kibana.jsonc index e1e69049b179..8161be4b8095 100644 --- a/packages/kbn-server-route-repository/kibana.jsonc +++ b/packages/kbn-server-route-repository/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/server-route-repository", - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-server-route-repository/package.json b/packages/kbn-server-route-repository/package.json index 04ca169ad0ab..a1c4cfa51563 100644 --- a/packages/kbn-server-route-repository/package.json +++ b/packages/kbn-server-route-repository/package.json @@ -1,9 +1,7 @@ { "name": "@kbn/server-route-repository", - "browser": "./target_web/web_index.js", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", "private": true, - "types": "./target_types/index.d.ts" -} + "browser": "./browser_index" +} \ No newline at end of file diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index a1cd5336c625..68e576e00b06 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/io-ts-utils" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-shared-svg/BUILD.bazel b/packages/kbn-shared-svg/BUILD.bazel deleted file mode 100644 index 79262ef0b54b..000000000000 --- a/packages/kbn-shared-svg/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-shared-svg" -PKG_REQUIRE_NAME = "@kbn/shared-svg" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react" -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-shared-svg/kibana.jsonc b/packages/kbn-shared-svg/kibana.jsonc index e816819c9c24..6634bd9dffc5 100644 --- a/packages/kbn-shared-svg/kibana.jsonc +++ b/packages/kbn-shared-svg/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-svg", - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-shared-svg/package.json b/packages/kbn-shared-svg/package.json index d28953d0d843..16d0ddda0851 100644 --- a/packages/kbn-shared-svg/package.json +++ b/packages/kbn-shared-svg/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-svg", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-shared-svg/tsconfig.json b/packages/kbn-shared-svg/tsconfig.json index df76c43764ad..faea0b4bf076 100644 --- a/packages/kbn-shared-svg/tsconfig.json +++ b/packages/kbn-shared-svg/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,10 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-shared-ux-utility/BUILD.bazel b/packages/kbn-shared-ux-utility/BUILD.bazel deleted file mode 100644 index d19df36a5ea4..000000000000 --- a/packages/kbn-shared-ux-utility/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-shared-ux-utility" -PKG_REQUIRE_NAME = "@kbn/shared-ux-utility" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@elastic/eui", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@emotion/react", - "@npm//@emotion/css", - "@npm//@elastic/eui", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-shared-ux-utility/kibana.jsonc b/packages/kbn-shared-ux-utility/kibana.jsonc index 63b05a89f558..db3608957229 100644 --- a/packages/kbn-shared-ux-utility/kibana.jsonc +++ b/packages/kbn-shared-ux-utility/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-utility", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/kbn-shared-ux-utility/package.json b/packages/kbn-shared-ux-utility/package.json index 6bf6571104b4..302da6f03a81 100644 --- a/packages/kbn-shared-ux-utility/package.json +++ b/packages/kbn-shared-ux-utility/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-utility", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-shared-ux-utility/tsconfig.json b/packages/kbn-shared-ux-utility/tsconfig.json index 4990376ba906..b89bc5610aa1 100644 --- a/packages/kbn-shared-ux-utility/tsconfig.json +++ b/packages/kbn-shared-ux-utility/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,8 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-some-dev-log/BUILD.bazel b/packages/kbn-some-dev-log/BUILD.bazel deleted file mode 100644 index 02ba30b3d1db..000000000000 --- a/packages/kbn-some-dev-log/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-some-dev-log" -PKG_REQUIRE_NAME = "@kbn/some-dev-log" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-some-dev-log/kibana.jsonc b/packages/kbn-some-dev-log/kibana.jsonc index e39904defc55..d83704903bdf 100644 --- a/packages/kbn-some-dev-log/kibana.jsonc +++ b/packages/kbn-some-dev-log/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/some-dev-log", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-some-dev-log/package.json b/packages/kbn-some-dev-log/package.json index 2dccc54aa1e3..e68e9b1e2906 100644 --- a/packages/kbn-some-dev-log/package.json +++ b/packages/kbn-some-dev-log/package.json @@ -2,7 +2,5 @@ "name": "@kbn/some-dev-log", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-some-dev-log/tsconfig.json b/packages/kbn-some-dev-log/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-some-dev-log/tsconfig.json +++ b/packages/kbn-some-dev-log/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-sort-package-json/BUILD.bazel b/packages/kbn-sort-package-json/BUILD.bazel deleted file mode 100644 index 9014d4cc2ada..000000000000 --- a/packages/kbn-sort-package-json/BUILD.bazel +++ /dev/null @@ -1,124 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-sort-package-json" -PKG_REQUIRE_NAME = "@kbn/sort-package-json" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//sort-package-json", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//sort-package-json", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-sort-package-json/kibana.jsonc b/packages/kbn-sort-package-json/kibana.jsonc index 72345c2ccd31..cc7f2b8a1ecb 100644 --- a/packages/kbn-sort-package-json/kibana.jsonc +++ b/packages/kbn-sort-package-json/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/sort-package-json", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-sort-package-json/package.json b/packages/kbn-sort-package-json/package.json index 316213bcac01..d0b12357f5c2 100644 --- a/packages/kbn-sort-package-json/package.json +++ b/packages/kbn-sort-package-json/package.json @@ -2,7 +2,5 @@ "name": "@kbn/sort-package-json", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-sort-package-json/tsconfig.json b/packages/kbn-sort-package-json/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-sort-package-json/tsconfig.json +++ b/packages/kbn-sort-package-json/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-spec-to-console/BUILD.bazel b/packages/kbn-spec-to-console/BUILD.bazel deleted file mode 100644 index 9d41b5762d47..000000000000 --- a/packages/kbn-spec-to-console/BUILD.bazel +++ /dev/null @@ -1,56 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-spec-to-console" -PKG_REQUIRE_NAME = "@kbn/spec-to-console" - -SOURCE_FILES = glob( - [ - "bin/**/*", - "lib/**/*", - "index.js" - ], - exclude = [ - "**/*.test.*", - "**/__fixtures__/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//globby", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-spec-to-console/kibana.jsonc b/packages/kbn-spec-to-console/kibana.jsonc index cf71c222f6f1..8138406cbeaa 100644 --- a/packages/kbn-spec-to-console/kibana.jsonc +++ b/packages/kbn-spec-to-console/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/spec-to-console", "devOnly": true, - "owner": "@elastic/platform-deployment-management", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/platform-deployment-management" } diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index b5b198ffd873..5ddc74ab55de 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -1,11 +1,6 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") -PKG_DIRNAME = "kbn-std" -PKG_REQUIRE_NAME = "@kbn/std" - -SOURCE_FILES = glob( +SRCS = glob( [ "**/*.ts", ], @@ -25,93 +20,17 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-utility-types", +BUNDLER_DEPS = [ "@npm//lodash", "@npm//query-string", "@npm//rxjs", "@npm//tslib", ] -TYPES_DEPS = [ - "//packages/kbn-utility-types:npm_module_types", - "@npm//query-string", - "@npm//rxjs", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + name = "kbn-std", + package_name = "@kbn/std", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, visibility = ["//visibility:public"], ) diff --git a/packages/kbn-std/kibana.jsonc b/packages/kbn-std/kibana.jsonc index 246c11ee7c3f..062ba5970f53 100644 --- a/packages/kbn-std/kibana.jsonc +++ b/packages/kbn-std/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/std", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-std/package.json b/packages/kbn-std/package.json index b338657ccea3..d8317ac361f5 100644 --- a/packages/kbn-std/package.json +++ b/packages/kbn-std/package.json @@ -1,9 +1,7 @@ { "name": "@kbn/std", - "main": "./target_node/index.js", "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-std/src/deep_freeze.ts b/packages/kbn-std/src/deep_freeze.ts index dbc31f06b36b..49d3e5bfb17b 100644 --- a/packages/kbn-std/src/deep_freeze.ts +++ b/packages/kbn-std/src/deep_freeze.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { RecursiveReadonly } from '@kbn/utility-types'; +import type { RecursiveReadonly } from '@kbn/utility-types'; /** @public */ export type Freezable = { [k: string]: any } | any[]; diff --git a/packages/kbn-std/tsconfig.json b/packages/kbn-std/tsconfig.json index 292157c18591..a293593c7b03 100644 --- a/packages/kbn-std/tsconfig.json +++ b/packages/kbn-std/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,11 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-stdio-dev-helpers/BUILD.bazel b/packages/kbn-stdio-dev-helpers/BUILD.bazel deleted file mode 100644 index fee92d0b182d..000000000000 --- a/packages/kbn-stdio-dev-helpers/BUILD.bazel +++ /dev/null @@ -1,126 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-stdio-dev-helpers" -PKG_REQUIRE_NAME = "@kbn/stdio-dev-helpers" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//tslib", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//rxjs", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-stdio-dev-helpers/kibana.jsonc b/packages/kbn-stdio-dev-helpers/kibana.jsonc index 0001ba53d7b7..4cb58f510906 100644 --- a/packages/kbn-stdio-dev-helpers/kibana.jsonc +++ b/packages/kbn-stdio-dev-helpers/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/stdio-dev-helpers", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-stdio-dev-helpers/package.json b/packages/kbn-stdio-dev-helpers/package.json index 6d0237b0d0f6..64334acad336 100644 --- a/packages/kbn-stdio-dev-helpers/package.json +++ b/packages/kbn-stdio-dev-helpers/package.json @@ -2,7 +2,5 @@ "name": "@kbn/stdio-dev-helpers", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-stdio-dev-helpers/tsconfig.json b/packages/kbn-stdio-dev-helpers/tsconfig.json index 57c1dd1c94e0..9bd4f35cf62a 100644 --- a/packages/kbn-stdio-dev-helpers/tsconfig.json +++ b/packages/kbn-stdio-dev-helpers/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel deleted file mode 100644 index aed873551d32..000000000000 --- a/packages/kbn-storybook/BUILD.bazel +++ /dev/null @@ -1,149 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-storybook" -PKG_REQUIRE_NAME = "@kbn/storybook" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.ejs", - ], - exclude = [ - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "preset/package.json", - "package.json", - "README.md", - "preset.js", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-ui-shared-deps-npm", - "//packages/kbn-ui-shared-deps-src", - "//packages/kbn-utils", - "@npm//@elastic/eui", - "@npm//@emotion/cache", - "@npm//@storybook/addons", - "@npm//@storybook/api", - "@npm//@storybook/components", - "@npm//@storybook/core", - "@npm//@storybook/core-common", - "@npm//@storybook/node-logger", - "@npm//@storybook/react", - "@npm//@storybook/theming", - "@npm//loader-utils", - "@npm//react", - "@npm//webpack", - "@npm//webpack-merge", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-ui-shared-deps-src:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-ambient-storybook-types:npm_module_types", - "@npm//@elastic/eui", - "@npm//@emotion/cache", - "@npm//@storybook/addons", - "@npm//@storybook/api", - "@npm//@storybook/components", - "@npm//@storybook/core", - "@npm//@storybook/core-common", - "@npm//@storybook/node-logger", - "@npm//@storybook/react", - "@npm//@storybook/theming", - "@npm//@types/loader-utils", - "@npm//@types/node", - "@npm//@types/react", - "@npm//@types/webpack", - "@npm//@types/webpack-merge", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-storybook/kibana.jsonc b/packages/kbn-storybook/kibana.jsonc index b5499440f46a..4faf58c30926 100644 --- a/packages/kbn-storybook/kibana.jsonc +++ b/packages/kbn-storybook/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/storybook", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-storybook/package.json b/packages/kbn-storybook/package.json index 59f6a1a58e3a..77fc16106c99 100644 --- a/packages/kbn-storybook/package.json +++ b/packages/kbn-storybook/package.json @@ -3,7 +3,5 @@ "author": "Operations", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-storybook/preset.js b/packages/kbn-storybook/preset.js index dae3529f878a..5757609ec90c 100644 --- a/packages/kbn-storybook/preset.js +++ b/packages/kbn-storybook/preset.js @@ -6,16 +6,16 @@ * Side Public License, v 1. */ -const webpackConfig = require('./target_node/src/webpack.config'); +const webpackConfig = require('./src/webpack.config'); module.exports = { managerEntries: (entry = []) => { - return [require.resolve('./target_node/src/lib/register'), ...entry]; + return [require.resolve('./src/lib/register'), ...entry]; }, webpackFinal: (config) => { return webpackConfig({ config }); }, config: (entry) => { - return [...entry, require.resolve('./target_node/src/lib/decorators')]; + return [...entry, require.resolve('./src/lib/decorators')]; }, }; diff --git a/packages/kbn-storybook/src/lib/constants.ts b/packages/kbn-storybook/src/lib/constants.ts index 69b05c94ea1b..df339111c699 100644 --- a/packages/kbn-storybook/src/lib/constants.ts +++ b/packages/kbn-storybook/src/lib/constants.ts @@ -7,7 +7,7 @@ */ import { resolve } from 'path'; -import { REPO_ROOT as KIBANA_ROOT } from '@kbn/utils'; +import { REPO_ROOT as KIBANA_ROOT } from '@kbn/repo-info'; export const REPO_ROOT = KIBANA_ROOT; export const ASSET_DIR = resolve(KIBANA_ROOT, 'built_assets/storybook'); diff --git a/packages/kbn-storybook/src/lib/run_storybook_cli.ts b/packages/kbn-storybook/src/lib/run_storybook_cli.ts index 0d6a9302c197..ad074e6dbfc4 100644 --- a/packages/kbn-storybook/src/lib/run_storybook_cli.ts +++ b/packages/kbn-storybook/src/lib/run_storybook_cli.ts @@ -12,7 +12,7 @@ import buildStandalone from '@storybook/react/standalone'; import { Flags, run } from '@kbn/dev-cli-runner'; import UiSharedDepsNpm from '@kbn/ui-shared-deps-npm'; import * as UiSharedDepsSrc from '@kbn/ui-shared-deps-src'; -import { REPO_ROOT } from '@kbn/utils'; + // @ts-expect-error internal dep of storybook import interpret from 'interpret'; // eslint-disable-line import/no-extraneous-dependencies import * as constants from './constants'; @@ -49,6 +49,7 @@ export function runStorybookCli({ configDir, name }: { configDir: string; name: mode: flags.site ? 'static' : 'dev', port: 9001, staticDir, + debugWebpack: true, }; if (flags.site) { config.outputDir = join(constants.ASSET_DIR, name); @@ -57,9 +58,9 @@ export function runStorybookCli({ configDir, name }: { configDir: string; name: logger.setLevel(getLogLevelFromFlags(flags)); // force storybook to use our transpilation rather than ts-node or anything else - interpret.extensions['.ts'] = [join(REPO_ROOT, 'src/setup_node_env')]; - interpret.extensions['.tsx'] = [join(REPO_ROOT, 'src/setup_node_env')]; - interpret.extensions['.jsx'] = [join(REPO_ROOT, 'src/setup_node_env')]; + interpret.extensions['.ts'] = [require.resolve('@kbn/babel-register/install')]; + interpret.extensions['.tsx'] = [require.resolve('@kbn/babel-register/install')]; + interpret.extensions['.jsx'] = [require.resolve('@kbn/babel-register/install')]; await buildStandalone(config); diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index cca984fbe83b..93c746e66af3 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -85,7 +85,7 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { { test: /\.peggy$/, use: { - loader: '@kbn/peggy-loader', + loader: require.resolve('@kbn/peggy-loader'), }, }, { @@ -98,7 +98,7 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { loader: 'postcss-loader', options: { postcssOptions: { - config: require.resolve('@kbn/optimizer/postcss.config.js'), + config: require.resolve('@kbn/optimizer/postcss.config'), }, }, }, @@ -151,8 +151,9 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { // move the plugins to the top of the preset array so they will run after the typescript preset options.presets = [ + require.resolve('@kbn/babel-preset/common_preset'), { - plugins: [...plugins, require.resolve('@kbn/babel-plugin-synthetic-packages')], + plugins: [...plugins, require.resolve('@kbn/babel-plugin-package-imports')], }, ...(options.presets as Preset[]).filter(isDesiredPreset).map((preset) => { const tsPreset = getTsPreset(preset); diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index 3621ceb664a1..765dd18aee08 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -1,11 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "skipLibCheck": true, - "target": "es2015", + "outDir": "target/types", "types": [ "node", "@kbn/ambient-storybook-types" @@ -14,5 +10,14 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/ui-shared-deps-npm", + "@kbn/ui-shared-deps-src", + "@kbn/repo-info", + "@kbn/dev-cli-runner", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-synthetic-package-map/BUILD.bazel b/packages/kbn-synthetic-package-map/BUILD.bazel deleted file mode 100644 index 6b1d32fcbbb1..000000000000 --- a/packages/kbn-synthetic-package-map/BUILD.bazel +++ /dev/null @@ -1,51 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-synthetic-package-map" -PKG_REQUIRE_NAME = "@kbn/synthetic-package-map" - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "index.js", - "index.d.ts", - "synthetic-packages.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-synthetic-package-map/kibana.jsonc b/packages/kbn-synthetic-package-map/kibana.jsonc deleted file mode 100644 index 153b6548ce84..000000000000 --- a/packages/kbn-synthetic-package-map/kibana.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/synthetic-package-map", - "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] -} diff --git a/packages/kbn-synthetic-package-map/tsconfig.json b/packages/kbn-synthetic-package-map/tsconfig.json deleted file mode 100644 index 75177b5488a9..000000000000 --- a/packages/kbn-synthetic-package-map/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.bazel.json", - "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "types": [ - "node" - ] - }, - "include": [ - "index.d.ts" - ] -} diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel deleted file mode 100644 index 7b55705968e7..000000000000 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ /dev/null @@ -1,123 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-telemetry-tools" -PKG_REQUIRE_NAME = "@kbn/telemetry-tools" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ] -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", - "GUIDELINE.md", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-eslint-plugin-imports", - "//packages/kbn-utility-types", - "//packages/kbn-utils", - "@npm//globby", - "@npm//listr", - "@npm//normalize-path", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-eslint-plugin-imports:npm_module_types", - "//packages/kbn-utility-types:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//globby", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/listr", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/normalize-path", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-telemetry-tools/kibana.jsonc b/packages/kbn-telemetry-tools/kibana.jsonc index c182ddd3e696..f36e6d272b81 100644 --- a/packages/kbn-telemetry-tools/kibana.jsonc +++ b/packages/kbn-telemetry-tools/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/telemetry-tools", "devOnly": true, - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-telemetry-tools/package.json b/packages/kbn-telemetry-tools/package.json index 9381f23de133..e4e890b32ab2 100644 --- a/packages/kbn-telemetry-tools/package.json +++ b/packages/kbn-telemetry-tools/package.json @@ -3,7 +3,5 @@ "version": "1.0.0", "author": "Kibana Core", "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node/index.js", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-telemetry-tools/src/tools/compiler_host.ts b/packages/kbn-telemetry-tools/src/tools/compiler_host.ts index a49bee64e564..55dcfe61b865 100644 --- a/packages/kbn-telemetry-tools/src/tools/compiler_host.ts +++ b/packages/kbn-telemetry-tools/src/tools/compiler_host.ts @@ -9,7 +9,7 @@ import Path from 'path'; import ts from 'typescript'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ImportResolver } from '@kbn/import-resolver'; function readTsConfigFile(path: string) { diff --git a/packages/kbn-telemetry-tools/tsconfig.json b/packages/kbn-telemetry-tools/tsconfig.json index 59c205335d6a..1b30dc5c7516 100644 --- a/packages/kbn-telemetry-tools/tsconfig.json +++ b/packages/kbn-telemetry-tools/tsconfig.json @@ -1,10 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,15 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/repo-info", + "@kbn/import-resolver", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-test-jest-helpers/BUILD.bazel b/packages/kbn-test-jest-helpers/BUILD.bazel deleted file mode 100644 index 7562c7aded78..000000000000 --- a/packages/kbn-test-jest-helpers/BUILD.bazel +++ /dev/null @@ -1,182 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@npm//@babel/cli:index.bzl", "babel") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-test-jest-helpers" -PKG_REQUIRE_NAME = "@kbn/test-jest-helpers" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ] -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "jest.config.js", - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-i18n-react", - "//packages/kbn-axe-config", - "//packages/kbn-std", - "//packages/kbn-utils", - "@npm//@elastic/elasticsearch", - "@npm//axios", - "@npm//@babel/traverse", - "@npm//chance", - "@npm//dedent", - "@npm//del", - "@npm//enzyme", - "@npm//execa", - "@npm//exit-hook", - "@npm//form-data", - "@npm//getopts", - "@npm//globby", - "@npm//he", - "@npm//history", - "@npm//jest", - "@npm//jest-axe", - "@npm//jest-cli", - "@npm//jest-snapshot", - "@npm//jest-styled-components", - "@npm//@jest/reporters", - "@npm//joi", - "@npm//mustache", - "@npm//normalize-path", - "@npm//prettier", - "@npm//react", - "@npm//react-dom", - "@npm//react-redux", - "@npm//react-router-dom", - "@npm//redux", - "@npm//rxjs", - "@npm//semver", - "@npm//strip-ansi", - "@npm//xmlbuilder", - "@npm//xml2js", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-axe-config:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//axios", - "@npm//axe-core", - "@npm//elastic-apm-node", - "@npm//del", - "@npm//exit-hook", - "@npm//form-data", - "@npm//getopts", - "@npm//jest", - "@npm//jest-cli", - "@npm//jest-snapshot", - "@npm//redux", - "@npm//rxjs", - "@npm//xmlbuilder", - "@npm//@types/chance", - "@npm//@types/dedent", - "@npm//@types/enzyme", - "@npm//@types/he", - "@npm//@types/history", - "@npm//@types/jest", - "@npm//@types/jest-axe", - "@npm//joi", - "@npm//@types/lodash", - "@npm//@types/mustache", - "@npm//@types/normalize-path", - "@npm//@types/node", - "@npm//@types/prettier", - "@npm//@types/react", - "@npm//@types/react-dom", - "@npm//@types/react-router-dom", - "@npm//@types/semver", - "@npm//@types/xml2js", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-test-jest-helpers/kibana.jsonc b/packages/kbn-test-jest-helpers/kibana.jsonc index 70750f8f4f28..4780aa00d4aa 100644 --- a/packages/kbn-test-jest-helpers/kibana.jsonc +++ b/packages/kbn-test-jest-helpers/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/test-jest-helpers", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-test-jest-helpers/package.json b/packages/kbn-test-jest-helpers/package.json index 646b0baa96a1..216350e757a8 100644 --- a/packages/kbn-test-jest-helpers/package.json +++ b/packages/kbn-test-jest-helpers/package.json @@ -2,7 +2,5 @@ "name": "@kbn/test-jest-helpers", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-test-jest-helpers/src/stub_web_worker.ts b/packages/kbn-test-jest-helpers/src/stub_web_worker.ts index 987f6ea7867f..76302be07bcc 100644 --- a/packages/kbn-test-jest-helpers/src/stub_web_worker.ts +++ b/packages/kbn-test-jest-helpers/src/stub_web_worker.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -function stubWebWorker() { +export function stubWebWorker() { if (!window.Worker) { // @ts-ignore we aren't honoring the real Worker spec here window.Worker = function Worker() { @@ -18,8 +18,3 @@ function stubWebWorker() { }; } } - -stubWebWorker(); - -// Add an export to avoid TS complaining "stub_web_worker.ts" is not a module. -export { stubWebWorker }; diff --git a/packages/kbn-test-jest-helpers/tsconfig.json b/packages/kbn-test-jest-helpers/tsconfig.json index 2b02a63db1d0..5a79ec9d8b01 100644 --- a/packages/kbn-test-jest-helpers/tsconfig.json +++ b/packages/kbn-test-jest-helpers/tsconfig.json @@ -1,13 +1,18 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["jest", "node"] }, "include": [ "**/*.ts", "**/*.tsx", ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/axe-config", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/packages/kbn-test-subj-selector/BUILD.bazel b/packages/kbn-test-subj-selector/BUILD.bazel deleted file mode 100644 index 57afbf86c1bc..000000000000 --- a/packages/kbn-test-subj-selector/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-test-subj-selector" -PKG_REQUIRE_NAME = "@kbn/test-subj-selector" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-test-subj-selector/kibana.jsonc b/packages/kbn-test-subj-selector/kibana.jsonc index 708e1fd44ac3..53a90dc467c8 100644 --- a/packages/kbn-test-subj-selector/kibana.jsonc +++ b/packages/kbn-test-subj-selector/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/test-subj-selector", "owner": "@elastic/kibana-operations", - "devOnly": true, - "runtimeDeps": [], - "typeDeps": [], + "devOnly": true } diff --git a/packages/kbn-test-subj-selector/package.json b/packages/kbn-test-subj-selector/package.json index 1cb9f52b9e02..6175fe871061 100644 --- a/packages/kbn-test-subj-selector/package.json +++ b/packages/kbn-test-subj-selector/package.json @@ -2,7 +2,5 @@ "name": "@kbn/test-subj-selector", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-test-subj-selector/tsconfig.json b/packages/kbn-test-subj-selector/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-test-subj-selector/tsconfig.json +++ b/packages/kbn-test-subj-selector/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel deleted file mode 100644 index 11ff0fbadebb..000000000000 --- a/packages/kbn-test/BUILD.bazel +++ /dev/null @@ -1,211 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@npm//@babel/cli:index.bzl", "babel") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-test" -PKG_REQUIRE_NAME = "@kbn/test" - -SOURCE_FILES = glob( - [ - "src/failed_tests_reporter/es_config", - "src/jest/jest_flags.json", - "**/*.html", - "**/*.js", - "**/*.ts", - ], - exclude = [ - "types/**/*", - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/*.snap", - "**/__fixture__/**", - "**/__fixtures__/**", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "jest-preset.js", - "jest_integration/jest-preset.js", - "jest_integration_node/jest-preset.js", - "jest_node/jest-preset.js", - "jest.config.js", - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-dev-utils", - "//packages/kbn-i18n-react", - "//packages/kbn-std", - "//packages/kbn-utils", - "//packages/kbn-bazel-packages", - "@npm//@elastic/elasticsearch", - "@npm//@babel/traverse", - "@npm//@jest/console", - "@npm//@jest/reporters", - "@npm//axios", - "@npm//chance", - "@npm//dedent", - "@npm//del", - "@npm//enzyme", - "@npm//execa", - "@npm//exit-hook", - "@npm//form-data", - "@npm//get-port", - "@npm//getopts", - "@npm//globby", - "@npm//he", - "@npm//history", - "@npm//jest", - "@npm//jest-cli", - "@npm//jest-snapshot", - "@npm//jest-styled-components", - "@npm//joi", - "@npm//js-yaml", - "@npm//minimatch", - "@npm//mustache", - "@npm//normalize-path", - "@npm//prettier", - "@npm//react-dom", - "@npm//react-redux", - "@npm//react-router-dom", - "@npm//redux", - "@npm//rxjs", - "@npm//semver", - "@npm//strip-ansi", - "@npm//supertest", - "@npm//xmlbuilder", - "@npm//xml2js", -] - -TYPES_DEPS = [ - "//packages/kbn-dev-utils:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-tooling-log:npm_module_types", - "//packages/kbn-bazel-packages:npm_module_types", - "//packages/kbn-get-repo-files:npm_module_types", - "//packages/kbn-ftr-screenshot-filename:npm_module_types", - "//packages/kbn-peggy:npm_module_types", - "@npm//@elastic/elasticsearch", - "@npm//@jest/console", - "@npm//@jest/reporters", - "@npm//axe-core", - "@npm//axios", - "@npm//elastic-apm-node", - "@npm//del", - "@npm//exit-hook", - "@npm//form-data", - "@npm//get-port", - "@npm//getopts", - "@npm//globby", - "@npm//jest", - "@npm//jest-cli", - "@npm//jest-snapshot", - "@npm//redux", - "@npm//rxjs", - "@npm//playwright", - "@npm//xmlbuilder", - "@npm//@jest/transform", - "@npm//@types/archiver", - "@npm//@types/chance", - "@npm//@types/dedent", - "@npm//@types/enzyme", - "@npm//@types/he", - "@npm//@types/history", - "@npm//@types/jest", - "@npm//@types/js-yaml", - "@npm//joi", - "@npm//@types/lodash", - "@npm//@types/minimatch", - "@npm//@types/mustache", - "@npm//@types/normalize-path", - "@npm//@types/node", - "@npm//@types/prettier", - "@npm//@types/react-dom", - "@npm//@types/react-router-dom", - "@npm//@types/semver", - "@npm//@types/supertest", - "@npm//@types/uuid", - "@npm//@types/xml2js", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), - additional_args = [ - "--copy-files", - "--quiet" - ] -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-test/jest-preset.js b/packages/kbn-test/jest-preset.js index e9031f0d022b..dbbbc7481e89 100644 --- a/packages/kbn-test/jest-preset.js +++ b/packages/kbn-test/jest-preset.js @@ -9,10 +9,7 @@ // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html -const pkgMap = require('@kbn/synthetic-package-map').readPackageMap(); - -/** @typedef {import("@jest/types").Config.InitialOptions} JestConfig */ -/** @type {JestConfig} */ +/** @type {import("@jest/types").Config.InitialOptions} */ module.exports = { // The directory where Jest should output its coverage files coverageDirectory: '/target/kibana-coverage/jest', @@ -26,32 +23,10 @@ module.exports = { : ['html', 'text'], // An array of file extensions your modules use - moduleFileExtensions: ['js', 'mjs', 'json', 'ts', 'tsx', 'node'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'mjs', 'json', 'node'], - // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module moduleNameMapper: { - '@elastic/eui/lib/(.*)?': '/node_modules/@elastic/eui/test-env/$1', - '@elastic/eui$': '/node_modules/@elastic/eui/test-env', - 'elastic-apm-node': - '/node_modules/@kbn/test/target_node/src/jest/mocks/apm_agent_mock.js', - '\\.module.(css|scss)$': - '/node_modules/@kbn/test/target_node/src/jest/mocks/css_module_mock.js', - '\\.(css|less|scss)$': - '/node_modules/@kbn/test/target_node/src/jest/mocks/style_mock.js', - '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': - '/node_modules/@kbn/test/target_node/src/jest/mocks/file_mock.js', - '\\.ace\\.worker$': - '/node_modules/@kbn/test/target_node/src/jest/mocks/worker_module_mock.js', - '\\.editor\\.worker(\\.js)?$': - '/node_modules/@kbn/test/target_node/src/jest/mocks/worker_module_mock.js', - '^(!!)?file-loader!': - '/node_modules/@kbn/test/target_node/src/jest/mocks/file_mock.js', - ...Object.fromEntries( - Array.from(pkgMap.entries()).map(([pkgId, repoRelativeDir]) => [ - `^${pkgId}(/.*)?$`, - `/${repoRelativeDir}$1`, - ]) - ), + // do not use these, they're so slow. We have a custom resolver that can handle resolving different types of requests. }, // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader @@ -61,7 +36,7 @@ module.exports = { reporters: [ 'default', [ - '@kbn/test/target_node/src/jest/junit_reporter', + '/packages/kbn-test/src/jest/junit_reporter', { rootDirectory: '.', }, @@ -69,7 +44,7 @@ module.exports = { ...(process.env.TEST_GROUP_TYPE_UNIT ? [ [ - '@kbn/test/target_node/src/jest/ci_stats_jest_reporter', + '/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts', { testGroupType: process.env.TEST_GROUP_TYPE_UNIT, }, @@ -80,20 +55,18 @@ module.exports = { // The paths to modules that run some code to configure or set up the testing environment before each test setupFiles: [ - '/node_modules/@kbn/test/target_node/src/jest/setup/babel_polyfill.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/polyfills.jsdom.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/enzyme.js', + '/src/setup_node_env/polyfill.ts', + '/packages/kbn-test/src/jest/setup/polyfills.jsdom.js', + '/packages/kbn-test/src/jest/setup/enzyme.js', ], // A list of paths to modules that run some code to configure or set up the testing framework before each test setupFilesAfterEnv: [ - '/node_modules/@kbn/test/target_node/src/jest/setup/setup_test.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/mocks.moment_timezone.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/mocks.eui.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/react_testing_library.js', - process.env.CI - ? '/node_modules/@kbn/test/target_node/src/jest/setup/disable_console_logs.js' - : [], + '/packages/kbn-test/src/jest/setup/setup_test.js', + '/packages/kbn-test/src/jest/setup/mocks.moment_timezone.js', + '/packages/kbn-test/src/jest/setup/mocks.eui.js', + '/packages/kbn-test/src/jest/setup/react_testing_library.js', + process.env.CI ? '/packages/kbn-test/src/jest/setup/disable_console_logs.js' : [], ].flat(), snapshotFormat: { @@ -104,8 +77,8 @@ module.exports = { // A list of paths to snapshot serializer modules Jest should use for snapshot testing snapshotSerializers: [ '/src/plugins/kibana_react/public/util/test_helpers/react_mount_serializer.ts', - '/node_modules/enzyme-to-json/serializer', - '/node_modules/@kbn/test/target_node/src/jest/setup/emotion.js', + 'enzyme-to-json/serializer', + '/packages/kbn-test/src/jest/setup/emotion.js', ], // The test environment that will be used for testing @@ -123,9 +96,9 @@ module.exports = { // A map from regular expressions to paths to transformers transform: { - '^.+\\.(js|tsx?)$': '/node_modules/@kbn/test/target_node/src/jest/transforms/babel.js', - '^.+\\.(txt|html)?$': '/node_modules/@kbn/test/target_node/src/jest/transforms/raw.js', - '^.+\\.peggy?$': '/node_modules/@kbn/test/target_node/src/jest/transforms/peggy.js', + '^.+\\.(js|tsx?)$': '/packages/kbn-test/src/jest/transforms/babel.js', + '^.+\\.(txt|html)?$': '/packages/kbn-test/src/jest/transforms/raw.js', + '^.+\\.peggy?$': '/packages/kbn-test/src/jest/transforms/peggy.js', }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation @@ -146,9 +119,7 @@ module.exports = { '!**/index.{js,ts,tsx}', ], - // A custom resolver to preserve symlinks by default - resolver: - '/node_modules/@kbn/test/target_node/src/jest/setup/preserve_symlinks_resolver.js', - watchPathIgnorePatterns: ['.*/__tmp__/.*'], + + resolver: '/packages/kbn-test/src/jest/resolver.js', }; diff --git a/packages/kbn-test/jest_integration/jest-preset.js b/packages/kbn-test/jest_integration/jest-preset.js index 8b40dca6a5db..6ccdb6cc98fc 100644 --- a/packages/kbn-test/jest_integration/jest-preset.js +++ b/packages/kbn-test/jest_integration/jest-preset.js @@ -8,22 +8,21 @@ const preset = require('../jest-preset'); -/** @typedef {import("@jest/types").Config.InitialOptions} JestConfig */ -/** @type {JestConfig} */ +/** @type {import("@jest/types").Config.InitialOptions} */ module.exports = { ...preset, - testMatch: ['**/integration_tests**/*.test.{js,mjs,ts,tsx}'], + testMatch: ['**/integration_tests/**/*.test.{js,mjs,ts,tsx}'], testPathIgnorePatterns: preset.testPathIgnorePatterns.filter( (pattern) => !pattern.includes('integration_tests') ), setupFilesAfterEnv: [ ...preset.setupFilesAfterEnv, - '/node_modules/@kbn/test/target_node/src/jest/setup/after_env.integration.js', + '/packages/kbn-test/src/jest/setup/after_env.integration.js', ], reporters: [ 'default', [ - '@kbn/test/target_node/src/jest/junit_reporter', + '/packages/kbn-test/src/jest/junit_reporter', { rootDirectory: '.', reportName: 'Jest Integration Tests', @@ -32,7 +31,7 @@ module.exports = { ...(process.env.TEST_GROUP_TYPE_INTEGRATION ? [ [ - '@kbn/test/target_node/src/jest/ci_stats_jest_reporter', + '/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts', { testGroupType: process.env.TEST_GROUP_TYPE_INTEGRATION, }, diff --git a/packages/kbn-test/jest_integration_node/jest-preset.js b/packages/kbn-test/jest_integration_node/jest-preset.js index 0e793093708f..43373e41db5c 100644 --- a/packages/kbn-test/jest_integration_node/jest-preset.js +++ b/packages/kbn-test/jest_integration_node/jest-preset.js @@ -12,8 +12,7 @@ const presetClone = { ...preset }; delete presetClone.testEnvironment; // simply redefining as `testEnvironment: 'node'` has some weird side-effects (https://github.com/elastic/kibana/pull/138877) -/** @typedef {import("@jest/types").Config.InitialOptions} JestConfig */ -/** @type {JestConfig} */ +/** @type {import("@jest/types").Config.InitialOptions} */ module.exports = { ...presetClone, testMatch: ['**/integration_tests**/*.test.{js,mjs,ts,tsx}'], @@ -21,20 +20,20 @@ module.exports = { (pattern) => !pattern.includes('integration_tests') ), setupFilesAfterEnv: [ - '/node_modules/@kbn/test/target_node/src/jest/setup/after_env.integration.js', - '/node_modules/@kbn/test/target_node/src/jest/setup/mocks.moment_timezone.js', + '/packages/kbn-test/src/jest/setup/after_env.integration.js', + '/packages/kbn-test/src/jest/setup/mocks.moment_timezone.js', ], reporters: [ 'default', [ - '@kbn/test/target_node/src/jest/junit_reporter', + '/packages/kbn-test/src/jest/junit_reporter', { rootDirectory: '.', reportName: 'Jest Integration Tests', }, ], [ - '@kbn/test/target_node/src/jest/ci_stats_jest_reporter', + '/packages/kbn-test/src/jest/ci_stats_jest_reporter.ts', { testGroupType: 'Jest Integration Tests', }, @@ -45,7 +44,7 @@ module.exports = { : ['html', 'text'], snapshotSerializers: [], - setupFiles: ['/node_modules/@kbn/test/target_node/src/jest/setup/babel_polyfill.js'], + setupFiles: ['/src/setup_node_env/polyfill.ts'], haste: { ...preset.haste, throwOnModuleCollision: true, diff --git a/packages/kbn-test/jest_node/jest-preset.js b/packages/kbn-test/jest_node/jest-preset.js index 94d973807fc9..f259ca5d9d99 100644 --- a/packages/kbn-test/jest_node/jest-preset.js +++ b/packages/kbn-test/jest_node/jest-preset.js @@ -12,12 +12,11 @@ const presetClone = { ...preset }; delete presetClone.testEnvironment; // simply redefining as `testEnvironment: 'node'` has some weird side-effects (https://github.com/elastic/kibana/pull/138877#issuecomment-1222366247) -/** @typedef {import("@jest/types").Config.InitialOptions} JestConfig */ -/** @type {JestConfig} */ +/** @type {import("@jest/types").Config.InitialOptions} */ module.exports = { ...presetClone, snapshotSerializers: [], - setupFiles: ['/node_modules/@kbn/test/target_node/src/jest/setup/babel_polyfill.js'], + setupFiles: ['/src/setup_node_env/polyfill.ts'], haste: { ...preset.haste, throwOnModuleCollision: true, diff --git a/packages/kbn-test/kibana.jsonc b/packages/kbn-test/kibana.jsonc index c921f7ac3962..c38e4f38bf65 100644 --- a/packages/kbn-test/kibana.jsonc +++ b/packages/kbn-test/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/test", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-test/package.json b/packages/kbn-test/package.json index dff56ec9b524..79c74b2e3ae8 100644 --- a/packages/kbn-test/package.json +++ b/packages/kbn-test/package.json @@ -3,7 +3,5 @@ "author": "Operations", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "./target_node", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 7abfe25545cd..c31728b0fd7d 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import Url from 'url'; import { systemIndicesSuperuser } from '../kbn'; diff --git a/packages/kbn-test/src/es/test_es_cluster.ts b/packages/kbn-test/src/es/test_es_cluster.ts index 70fa5f2e8d37..6f7310e4bd2e 100644 --- a/packages/kbn-test/src/es/test_es_cluster.ts +++ b/packages/kbn-test/src/es/test_es_cluster.ts @@ -14,12 +14,10 @@ import globby from 'globby'; import createArchiver from 'archiver'; import Fs from 'fs'; import { pipeline } from 'stream/promises'; -import type { ChildProcess } from 'child_process'; -// @ts-expect-error in js import { Cluster } from '@kbn/es'; import { Client, HttpConnection } from '@elastic/elasticsearch'; import type { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { CI_PARALLEL_PROCESS_PREFIX } from '../ci_parallel_process_prefix'; import { esTestConfig } from './es_test_config'; @@ -37,23 +35,9 @@ interface TestEsClusterNodesOptions { dataArchive?: string; } -interface Node { - installSource: (opts: Record) => Promise<{ installPath: string }>; - installSnapshot: (opts: Record) => Promise<{ installPath: string }>; - extractDataDirectory: ( - installPath: string, - archivePath: string, - extractDirName?: string - ) => Promise<{ insallPath: string }>; - start: (installPath: string, opts: Record) => Promise; - stop: () => Promise; - kill: () => Promise; - _process?: ChildProcess; -} - export interface ICluster { ports: number[]; - nodes: Node[]; + nodes: Cluster[]; getStartTimeout: () => number; start: () => Promise; stop: () => Promise; @@ -207,7 +191,7 @@ export function createTestEsCluster< return new (class TestCluster { ports: number[] = []; - nodes: Node[] = []; + nodes: Cluster[] = []; constructor() { for (let i = 0; i < nodes.length; i++) { diff --git a/packages/kbn-test/src/functional_test_runner/fake_mocha_types.ts b/packages/kbn-test/src/functional_test_runner/fake_mocha_types.ts index 17e9663e3388..f5091b01735f 100644 --- a/packages/kbn-test/src/functional_test_runner/fake_mocha_types.ts +++ b/packages/kbn-test/src/functional_test_runner/fake_mocha_types.ts @@ -14,7 +14,12 @@ import { EventEmitter } from 'events'; -export interface Suite { +export interface Suite extends Runnable { + _beforeAll: Runnable[]; + _beforeEach: Runnable[]; + _afterEach: Runnable[]; + _afterAll: Runnable[]; + currentTest?: Test; suites: Suite[]; tests: Test[]; @@ -26,7 +31,7 @@ export interface Suite { suiteTag: string; } -export interface Test { +export interface Test extends Runnable { fullTitle(): string; title: string; file?: string; @@ -35,6 +40,16 @@ export interface Test { pending?: boolean; } +export interface Runnable { + isFailed(): boolean; + isPending(): boolean; + duration?: number; + titlePath(): string[]; + file?: string; + title: string; + parent?: Suite; +} + export interface Runner extends EventEmitter { abort(): void; failures: any[]; diff --git a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts b/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts index 11f99abfa6fb..5b06393cf7d5 100644 --- a/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts +++ b/packages/kbn-test/src/functional_test_runner/functional_test_runner.ts @@ -9,7 +9,7 @@ import { writeFileSync, mkdirSync } from 'fs'; import Path, { dirname } from 'path'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Suite, Test } from './fake_mocha_types'; import { diff --git a/packages/kbn-test/src/functional_test_runner/integration_tests/basic.test.js b/packages/kbn-test/src/functional_test_runner/integration_tests/basic.test.js index dbc3094e29ae..d026a80a7984 100644 --- a/packages/kbn-test/src/functional_test_runner/integration_tests/basic.test.js +++ b/packages/kbn-test/src/functional_test_runner/integration_tests/basic.test.js @@ -9,7 +9,7 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js'); const BASIC_CONFIG = require.resolve('./__fixtures__/simple_project/config.js'); diff --git a/packages/kbn-test/src/functional_test_runner/integration_tests/failure_hooks.test.js b/packages/kbn-test/src/functional_test_runner/integration_tests/failure_hooks.test.js index 47ae51ca62f1..7efd431e3ceb 100644 --- a/packages/kbn-test/src/functional_test_runner/integration_tests/failure_hooks.test.js +++ b/packages/kbn-test/src/functional_test_runner/integration_tests/failure_hooks.test.js @@ -10,7 +10,7 @@ import { spawnSync } from 'child_process'; import { resolve } from 'path'; import stripAnsi from 'strip-ansi'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const SCRIPT = resolve(REPO_ROOT, 'scripts/functional_test_runner.js'); const FAILURE_HOOKS_CONFIG = require.resolve('./__fixtures__/failure_hooks/config.js'); diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/config_loading.ts b/packages/kbn-test/src/functional_test_runner/lib/config/config_loading.ts index cfa2cabec4df..ad03d6d1c76b 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/config_loading.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/config_loading.ts @@ -10,7 +10,7 @@ import Path from 'path'; import { ToolingLog } from '@kbn/tooling-log'; import { defaultsDeep } from 'lodash'; import { createFlagError, createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { FtrConfigProvider, GenericFtrProviderContext } from '../../public_types'; import { Config } from './config'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/ftr_configs_manifest.ts b/packages/kbn-test/src/functional_test_runner/lib/config/ftr_configs_manifest.ts index 0452c0b7de30..f45f4e7a5736 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/ftr_configs_manifest.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/ftr_configs_manifest.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import JsYaml from 'js-yaml'; export const FTR_CONFIGS_MANIFEST_REL = '.buildkite/ftr_configs.yml'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts index 7f69ad6de5df..bfc727537fe2 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts @@ -8,7 +8,7 @@ import execa from 'execa'; import { readFileSync } from 'fs'; import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/es_version.ts b/packages/kbn-test/src/functional_test_runner/lib/es_version.ts index ccdd9cc902c5..c7cf398debde 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/es_version.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/es_version.ts @@ -7,7 +7,7 @@ */ import semver from 'semver'; -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; export class EsVersion { static getDefault() { diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js index a0db7db6f001..af73af1f50bb 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/decorate_mocha_ui.js @@ -7,7 +7,7 @@ */ import { relative } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createAssignmentProxy } from './assignment_proxy'; import { wrapFunction } from './wrap_function'; import { wrapRunnableArgs } from './wrap_runnable_args'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts index 96900555db74..f8cfabfc0bc7 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts @@ -8,7 +8,7 @@ import * as Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { CiStatsReporter, CiStatsReportTestsOptions, @@ -16,38 +16,21 @@ import { } from '@kbn/ci-stats-reporter'; import { Config } from '../../config'; -import { Runner } from '../../../fake_mocha_types'; +import { Runner, Runnable } from '../../../fake_mocha_types'; import { Lifecycle } from '../../lifecycle'; import { getSnapshotOfRunnableLogs } from '../../../../mocha'; -interface Suite { - _beforeAll: Runnable[]; - _beforeEach: Runnable[]; - _afterEach: Runnable[]; - _afterAll: Runnable[]; -} - -interface Runnable { - isFailed(): boolean; - isPending(): boolean; - duration?: number; - titlePath(): string[]; - file: string; - title: string; - parent: Suite; -} - function getHookType(hook: Runnable): CiStatsTestType { - if (hook.parent._afterAll.includes(hook)) { + if (hook.parent?._afterAll.includes(hook)) { return 'after all hook'; } - if (hook.parent._afterEach.includes(hook)) { + if (hook.parent?._afterEach.includes(hook)) { return 'after each hook'; } - if (hook.parent._beforeEach.includes(hook)) { + if (hook.parent?._beforeEach.includes(hook)) { return 'before each hook'; } - if (hook.parent._beforeAll.includes(hook)) { + if (hook.parent?._beforeAll.includes(hook)) { return 'before all hook'; } @@ -100,7 +83,7 @@ export function setupCiStatsFtrTestGroupReporter({ startTime: new Date(Date.now() - (runnable.duration ?? 0)).toJSON(), durationMs: runnable.duration ?? 0, seq: testRuns.length + 1, - file: Path.relative(REPO_ROOT, runnable.file), + file: Path.relative(REPO_ROOT, runnable.file ?? '.'), name: runnable.title, suites: runnable.titlePath().slice(0, -1), result: runnable.isFailed() ? 'fail' : runnable.isPending() ? 'skip' : 'pass', diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts index e2a29f8d1571..9bc399ea1215 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/setup_mocha.ts @@ -8,7 +8,7 @@ import { relative } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; // @ts-expect-error we don't use @types/mocha so it doesn't conflict with @types/jest import Mocha from 'mocha'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js b/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js index a0298b635a13..826971a30b83 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/validate_ci_group_tags.js @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; /** * Traverse the suites configured and ensure that each suite has no more than one ciGroup assigned diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts b/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts index 8723a424f6e2..06815d7ff38a 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/providers/provider_collection.ts @@ -10,21 +10,19 @@ import { ToolingLog } from '@kbn/tooling-log'; import { loadTracer } from '../load_tracer'; import { createAsyncInstance, isAsyncInstance } from './async_instance'; -import { Providers } from './read_provider_spec'; +import { Providers, ProviderFn, isProviderConstructor } from './read_provider_spec'; import { createVerboseInstance } from './verbose_instance'; -import { GenericFtrService } from '../../public_types'; export class ProviderCollection { - static callProviderFn(providerFn: any, ctx: any) { - if (providerFn.prototype instanceof GenericFtrService) { - const Constructor = providerFn as any as new (ctx: any) => any; - return new Constructor(ctx); + static callProviderFn(providerFn: ProviderFn, ctx: any) { + if (isProviderConstructor(providerFn)) { + return new providerFn(ctx); } return providerFn(ctx); } - private readonly instances = new Map(); + private readonly instances = new Map(); constructor(private readonly log: ToolingLog, private readonly providers: Providers) {} @@ -67,7 +65,7 @@ export class ProviderCollection { } } - public invokeProviderFn(provider: (args: any) => any) { + public invokeProviderFn(provider: ProviderFn) { return ProviderCollection.callProviderFn(provider, { getService: this.getService, hasService: this.hasService, diff --git a/packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts b/packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts index 0e4c10b4a851..573507eef404 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/providers/read_provider_spec.ts @@ -6,10 +6,20 @@ * Side Public License, v 1. */ +import { GenericFtrService } from '../../public_types'; + +export type ProviderConstructor = new (...args: any[]) => any; +export type ProviderFactory = (...args: any[]) => any; + +export function isProviderConstructor(x: unknown): x is ProviderConstructor { + return typeof x === 'function' && x.prototype instanceof GenericFtrService; +} + +export type ProviderFn = ProviderConstructor | ProviderFactory; export type Providers = ReturnType; export type Provider = Providers extends Array ? X : unknown; -export function readProviderSpec(type: string, providers: Record any>) { +export function readProviderSpec(type: string, providers: Record) { return Object.keys(providers).map((name) => { return { type, diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts index 43f1508ab793..2d417b5cdc80 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.test.ts @@ -12,11 +12,11 @@ import { join, resolve } from 'path'; import { ToolingLog } from '@kbn/tooling-log'; jest.mock('fs'); -jest.mock('@kbn/utils', () => { +jest.mock('@kbn/repo-info', () => { return { REPO_ROOT: '/dev/null/root' }; }); -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Lifecycle } from './lifecycle'; import { SuiteTracker } from './suite_tracker'; import { Suite } from '../fake_mocha_types'; diff --git a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts index 7832e89cb32c..74e33321e1fa 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/suite_tracker.ts @@ -9,7 +9,7 @@ import fs from 'fs'; import { dirname, relative, resolve } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Lifecycle } from './lifecycle'; diff --git a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js index 9888116e7227..823881ee4a31 100644 --- a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js +++ b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js @@ -6,31 +6,20 @@ * Side Public License, v 1. */ -const Fs = require('fs'); const Path = require('path'); -const { REPO_ROOT: REPO_ROOT_FOLLOWING_SYMLINKS } = require('@kbn/utils'); -const BASE_REPO_ROOT = Path.resolve( - Fs.realpathSync(Path.resolve(REPO_ROOT_FOLLOWING_SYMLINKS, 'package.json')), - '..' -); +const { REPO_ROOT } = require('@kbn/repo-info'); -const transpileKbnPaths = [ - 'test', - 'x-pack/test', - 'examples', - 'x-pack/examples', - // TODO: should should probably remove this link back to the source - 'x-pack/plugins/task_manager/server/config.ts', - 'src/plugins/field_formats/common', -].map((path) => Path.resolve(BASE_REPO_ROOT, path)); - -// modifies all future calls to require() to automatically -// compile the required source with babel -require('@babel/register')({ - ignore: [/[\/\\](node_modules|target|dist)[\/\\]/], - only: transpileKbnPaths, - babelrc: false, - presets: [require.resolve('@kbn/babel-preset/node_preset')], - extensions: ['.js', '.ts', '.tsx'], +require('@kbn/babel-register').install({ + only: [ + 'test', + 'x-pack/test', + 'examples', + 'x-pack/examples', + // TODO: should should probably remove this link back to the source + 'x-pack/plugins/task_manager/server/config.ts', + 'src/plugins/field_formats/common', + 'packages', + 'x-pack/packages', + ].map((path) => Path.resolve(REPO_ROOT, path)), }); diff --git a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts index b367af4daf49..24f3eb9a527b 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts +++ b/packages/kbn-test/src/functional_tests/lib/run_elasticsearch.ts @@ -9,7 +9,7 @@ import { resolve } from 'path'; import type { ToolingLog } from '@kbn/tooling-log'; import getPort from 'get-port'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import type { Config } from '../../functional_test_runner'; import { createTestEsCluster } from '../../es'; diff --git a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.ts b/packages/kbn-test/src/functional_tests/lib/run_kibana_server.ts index 2ab4af2df2e2..2f82d23d7287 100644 --- a/packages/kbn-test/src/functional_tests/lib/run_kibana_server.ts +++ b/packages/kbn-test/src/functional_tests/lib/run_kibana_server.ts @@ -11,7 +11,7 @@ import Os from 'os'; import Uuid from 'uuid'; import type { ProcRunner } from '@kbn/dev-proc-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import type { Config } from '../../functional_test_runner'; import { DedicatedTaskRunner } from '../../functional_test_runner/lib'; diff --git a/packages/kbn-test/src/functional_tests/run_tests/flags.ts b/packages/kbn-test/src/functional_tests/run_tests/flags.ts index 7639ae341f07..5d7fffc2a965 100644 --- a/packages/kbn-test/src/functional_tests/run_tests/flags.ts +++ b/packages/kbn-test/src/functional_tests/run_tests/flags.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { v4 as uuidV4 } from 'uuid'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { FlagsReader, FlagOptions } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; diff --git a/packages/kbn-test/src/functional_tests/run_tests/run_tests.ts b/packages/kbn-test/src/functional_tests/run_tests/run_tests.ts index 3eb8348691a1..e936264d8bf0 100644 --- a/packages/kbn-test/src/functional_tests/run_tests/run_tests.ts +++ b/packages/kbn-test/src/functional_tests/run_tests/run_tests.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { setTimeout } from 'timers/promises'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; import { withProcRunner } from '@kbn/dev-proc-runner'; diff --git a/packages/kbn-test/src/functional_tests/start_servers/flags.test.ts b/packages/kbn-test/src/functional_tests/start_servers/flags.test.ts index a8498d9e4e49..95c989b00cf1 100644 --- a/packages/kbn-test/src/functional_tests/start_servers/flags.test.ts +++ b/packages/kbn-test/src/functional_tests/start_servers/flags.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import { getFlags, FlagsReader } from '@kbn/dev-cli-runner'; import { createAnyInstanceSerializer, createAbsolutePathSerializer } from '@kbn/jest-serializers'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { EsVersion } from '../../functional_test_runner'; import { parseFlags, FLAG_OPTIONS } from './flags'; diff --git a/packages/kbn-test/src/functional_tests/start_servers/flags.ts b/packages/kbn-test/src/functional_tests/start_servers/flags.ts index 99c7de9e53ea..0f53ca6866fa 100644 --- a/packages/kbn-test/src/functional_tests/start_servers/flags.ts +++ b/packages/kbn-test/src/functional_tests/start_servers/flags.ts @@ -11,7 +11,7 @@ import Path from 'path'; import { v4 as uuidV4 } from 'uuid'; import { FlagsReader, FlagOptions } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { EsVersion } from '../../functional_test_runner'; diff --git a/packages/kbn-test/src/functional_tests/start_servers/start_servers.ts b/packages/kbn-test/src/functional_tests/start_servers/start_servers.ts index 3bb601fabe00..8c351db9b42f 100644 --- a/packages/kbn-test/src/functional_tests/start_servers/start_servers.ts +++ b/packages/kbn-test/src/functional_tests/start_servers/start_servers.ts @@ -10,7 +10,7 @@ import Path from 'path'; import * as Rx from 'rxjs'; import dedent from 'dedent'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog } from '@kbn/tooling-log'; import { withProcRunner } from '@kbn/dev-proc-runner'; import { getTimeReporter } from '@kbn/ci-stats-reporter'; diff --git a/packages/kbn-test/src/jest/integration_tests/__fixtures__/jest.config.js b/packages/kbn-test/src/jest/integration_tests/__fixtures__/jest.config.js deleted file mode 100644 index 0795e7f39166..000000000000 --- a/packages/kbn-test/src/jest/integration_tests/__fixtures__/jest.config.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const { resolve } = require('path'); -const { REPO_ROOT } = require('@kbn/utils'); - -module.exports = { - reporters: [ - 'default', - [ - `${REPO_ROOT}/node_modules/@kbn/test/target_node/src/jest/junit_reporter`, - { - reportName: 'JUnit Reporter Integration Test', - rootDirectory: resolve( - REPO_ROOT, - 'packages/kbn-test/src/jest/integration_tests/__fixtures__' - ), - }, - ], - ], -}; diff --git a/packages/kbn-test/src/jest/integration_tests/__fixtures__/test.js b/packages/kbn-test/src/jest/integration_tests/__fixtures__/test.js deleted file mode 100644 index 140b981482ff..000000000000 --- a/packages/kbn-test/src/jest/integration_tests/__fixtures__/test.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -describe('JUnit Reporter', () => { - it('fails', () => { - throw new Error('failure'); - }); -}); diff --git a/packages/kbn-test/src/jest/integration_tests/junit_reporter.test.ts b/packages/kbn-test/src/jest/integration_tests/junit_reporter.test.ts deleted file mode 100644 index f2bf25067a9b..000000000000 --- a/packages/kbn-test/src/jest/integration_tests/junit_reporter.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { resolve } from 'path'; -import { promisify } from 'util'; -import { readFileSync } from 'fs'; - -import del from 'del'; -import execa from 'execa'; -import xml2js from 'xml2js'; -import { getUniqueJunitReportPath } from '../../report_path'; -import { REPO_ROOT } from '@kbn/utils'; - -const MINUTE = 1000 * 60; -const FIXTURE_DIR = resolve(__dirname, '__fixtures__'); -const TARGET_DIR = resolve(FIXTURE_DIR, 'target'); -const XML_PATH = getUniqueJunitReportPath(FIXTURE_DIR, 'JUnit Reporter Integration Test'); - -afterAll(async () => { - await del(TARGET_DIR); -}); - -const parseXml = promisify(xml2js.parseString); -it( - 'produces a valid junit report for failures', - async () => { - const result = await execa( - 'node', - [ - '--preserve-symlinks', - './node_modules/.bin/jest', - '--config', - 'packages/kbn-test/src/jest/integration_tests/__fixtures__/jest.config.js', - ], - { - cwd: REPO_ROOT, - env: { - CI: 'true', - }, - reject: false, - } - ); - - expect(result.exitCode).toBe(1); - await expect(parseXml(readFileSync(XML_PATH, 'utf8'))).resolves.toEqual({ - testsuites: { - $: { - failures: '1', - name: 'jest', - skipped: '0', - tests: '1', - time: expect.anything(), - timestamp: expect.anything(), - }, - testsuite: [ - { - $: { - failures: '1', - file: resolve(FIXTURE_DIR, './test.js'), - name: 'test.js', - skipped: '0', - tests: '1', - time: expect.anything(), - timestamp: expect.anything(), - }, - testcase: [ - { - $: { - classname: 'JUnit Reporter Integration Test.·', - name: 'JUnit Reporter fails', - time: expect.anything(), - }, - failure: [expect.stringMatching(/Error: failure\s+at /m)], - }, - ], - }, - ], - }, - }); - }, - 3 * MINUTE -); diff --git a/packages/kbn-optimizer/src/worker/run_worker_from_source.js b/packages/kbn-test/src/jest/junit_reporter/index.js similarity index 80% rename from packages/kbn-optimizer/src/worker/run_worker_from_source.js rename to packages/kbn-test/src/jest/junit_reporter/index.js index bebe984a447d..5196e584cdd1 100644 --- a/packages/kbn-optimizer/src/worker/run_worker_from_source.js +++ b/packages/kbn-test/src/jest/junit_reporter/index.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('@kbn/optimizer').registerNodeAutoTranspilation(); -require('./run_worker'); +require('@kbn/babel-register').install(); +module.exports = require('./junit_reporter'); diff --git a/packages/kbn-test/src/jest/junit_reporter.ts b/packages/kbn-test/src/jest/junit_reporter/junit_reporter.ts similarity index 96% rename from packages/kbn-test/src/jest/junit_reporter.ts rename to packages/kbn-test/src/jest/junit_reporter/junit_reporter.ts index 6a1ce9d51ded..edb109eaa700 100644 --- a/packages/kbn-test/src/jest/junit_reporter.ts +++ b/packages/kbn-test/src/jest/junit_reporter/junit_reporter.ts @@ -11,12 +11,12 @@ import { writeFileSync, mkdirSync } from 'fs'; import xmlBuilder from 'xmlbuilder'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import type { Config } from '@jest/types'; import { AggregatedResult, Test, BaseReporter } from '@jest/reporters'; -import { escapeCdata } from '../mocha/xml'; -import { getUniqueJunitReportPath } from '../report_path'; +import { escapeCdata } from '../../mocha/xml'; +import { getUniqueJunitReportPath } from '../../report_path'; interface ReporterOptions { reportName?: string; diff --git a/packages/kbn-test/src/jest/resolver.js b/packages/kbn-test/src/jest/resolver.js new file mode 100644 index 000000000000..9334cdbf74be --- /dev/null +++ b/packages/kbn-test/src/jest/resolver.js @@ -0,0 +1,101 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// Inspired in a discussion found at https://github.com/facebook/jest/issues/5356 as Jest currently doesn't +// offer any other option to preserve symlinks. +// +// It would be available once https://github.com/facebook/jest/pull/9976 got merged. + +const Path = require('path'); +const resolve = require('resolve'); +const { REPO_ROOT } = require('@kbn/repo-info'); +const { readPackageMap } = require('@kbn/package-map'); + +const pkgMap = readPackageMap(); + +const APM_AGENT_MOCK = Path.resolve(__dirname, 'mocks/apm_agent_mock.ts'); +const CSS_MODULE_MOCK = Path.resolve(__dirname, 'mocks/css_module_mock.js'); +const STYLE_MOCK = Path.resolve(__dirname, 'mocks/style_mock.js'); +const FILE_MOCK = Path.resolve(__dirname, 'mocks/file_mock.js'); +const WORKER_MOCK = Path.resolve(__dirname, 'mocks/worker_module_mock.js'); + +const STATIC_FILE_EXT = + `jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga` + .split('|') + .map((e) => `.${e}`); + +/** + * @param {string} request + * @param {import('resolve').SyncOpts} options + * @returns + */ +module.exports = (request, options) => { + if (request === `@elastic/eui`) { + return module.exports(`@elastic/eui/test-env`, options); + } + + if (request.startsWith('@elastic/eui/lib/')) { + return module.exports(request.replace('@elastic/eui/lib/', '@elastic/eui/test-env/'), options); + } + + if (request === `elastic-apm-node`) { + return APM_AGENT_MOCK; + } + + const reqExt = Path.extname(request); + if (reqExt) { + const reqBasename = Path.basename(request, reqExt); + if ((reqExt === '.css' || reqExt === '.scss') && reqBasename.endsWith('.module')) { + return CSS_MODULE_MOCK; + } + + if (reqExt === '.css' || reqExt === '.less' || reqExt === '.scss') { + return STYLE_MOCK; + } + + if (STATIC_FILE_EXT.includes(reqExt)) { + return FILE_MOCK; + } + + if (reqExt === '.worker' && (reqBasename.endsWith('.ace') || reqBasename.endsWith('.editor'))) { + return WORKER_MOCK; + } + } + + if (request.startsWith('file-loader!') || request.startsWith('!!file-loader!')) { + return FILE_MOCK; + } + + if (request.startsWith('@kbn/')) { + const [, id, ...sub] = request.split('/'); + const pkgDir = pkgMap.get(`@kbn/${id}`); + if (!pkgDir) { + throw new Error( + `unable to resolve pkg import, pkg '@kbn/${id}' is not in the pkg map. Do you need to bootstrap?` + ); + } + + return resolve.sync(`./${pkgDir}${sub.length ? `/${sub.join('/')}` : ''}`, { + basedir: REPO_ROOT, + extensions: options.extensions, + }); + } + + try { + return resolve.sync(request, { + basedir: options.basedir, + extensions: options.extensions, + }); + } catch (error) { + if (error.code === 'MODULE_NOT_FOUND') { + return options.defaultResolver(request, options); + } + + throw error; + } +}; diff --git a/packages/kbn-test/src/jest/run.ts b/packages/kbn-test/src/jest/run.ts index 262d483dfd41..c517e8d323de 100644 --- a/packages/kbn-test/src/jest/run.ts +++ b/packages/kbn-test/src/jest/run.ts @@ -23,7 +23,7 @@ import { run } from 'jest'; import { ToolingLog } from '@kbn/tooling-log'; import { getTimeReporter } from '@kbn/ci-stats-reporter'; import { createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { map } from 'lodash'; import getopts from 'getopts'; import jestFlags from './jest_flags.json'; diff --git a/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts b/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts index 5adbe0afdbef..b2628490d749 100644 --- a/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts +++ b/packages/kbn-test/src/jest/run_check_jest_configs_cli.ts @@ -9,7 +9,7 @@ import Path from 'path'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getAllJestPaths, getTestsForConfigPaths } from './configs'; diff --git a/packages/kbn-test/src/jest/setup/babel_polyfill.js b/packages/kbn-test/src/jest/setup/babel_polyfill.js deleted file mode 100644 index 8d85e0043b8b..000000000000 --- a/packages/kbn-test/src/jest/setup/babel_polyfill.js +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// Note: In theory importing the polyfill should not be needed, as Babel should -// include the necessary polyfills when using `@babel/preset-env`, but for some -// reason it did not work. See https://github.com/elastic/kibana/issues/14506 -import '@kbn/optimizer/target_node/src/node/polyfill'; diff --git a/packages/kbn-test/src/jest/setup/preserve_symlinks_resolver.js b/packages/kbn-test/src/jest/setup/preserve_symlinks_resolver.js deleted file mode 100644 index 711bf2c9aa18..000000000000 --- a/packages/kbn-test/src/jest/setup/preserve_symlinks_resolver.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// Inspired in a discussion found at https://github.com/facebook/jest/issues/5356 as Jest currently doesn't -// offer any other option to preserve symlinks. -// -// It would be available once https://github.com/facebook/jest/pull/9976 got merged. - -const resolve = require('resolve'); - -module.exports = (request, options) => { - try { - return resolve.sync(request, { - basedir: options.basedir, - extensions: options.extensions, - preserveSymlinks: true, - }); - } catch (error) { - if (error.code === 'MODULE_NOT_FOUND') { - return options.defaultResolver(request, options); - } - - throw error; - } -}; diff --git a/packages/kbn-test/src/jest/transforms/babel.js b/packages/kbn-test/src/jest/transforms/babel.js index f2fbbfe00b60..907a9a66297c 100644 --- a/packages/kbn-test/src/jest/transforms/babel.js +++ b/packages/kbn-test/src/jest/transforms/babel.js @@ -18,6 +18,7 @@ module.exports = babelJest.default.createTransformer({ useBuiltIns: false, corejs: false, }, + 'kibana/ignoreAllPkgImports': true, }, ], ], diff --git a/packages/kbn-test/src/kbn/users.ts b/packages/kbn-test/src/kbn/users.ts index 9e35e9d7b6c0..b0db9e88ffc4 100644 --- a/packages/kbn-test/src/kbn/users.ts +++ b/packages/kbn-test/src/kbn/users.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -// @ts-expect-error no types import { SYSTEM_INDICES_SUPERUSER } from '@kbn/es'; const env = process.env; diff --git a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts index 4b2b4da3f75c..5259b50cfce8 100644 --- a/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts +++ b/packages/kbn-test/src/kbn_client/kbn_client_import_export.ts @@ -15,7 +15,7 @@ import FormData from 'form-data'; import { isAxiosResponseError } from '@kbn/dev-utils'; import { createFailError } from '@kbn/dev-cli-errors'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { KbnClientRequester, uriencode, ReqOptions } from './kbn_client_requester'; import { KbnClientSavedObjects } from './kbn_client_saved_objects'; diff --git a/packages/kbn-test/src/mocha/junit_report_generation.js b/packages/kbn-test/src/mocha/junit_report_generation.js index 599d1f366194..001fe79a3806 100644 --- a/packages/kbn-test/src/mocha/junit_report_generation.js +++ b/packages/kbn-test/src/mocha/junit_report_generation.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { dirname, relative } from 'path'; import { writeFileSync, mkdirSync } from 'fs'; import { inspect } from 'util'; diff --git a/packages/kbn-test/src/mocha/log_cache.js b/packages/kbn-test/src/mocha/log_cache.js index 669ad34463f4..e1c0030b53d1 100644 --- a/packages/kbn-test/src/mocha/log_cache.js +++ b/packages/kbn-test/src/mocha/log_cache.js @@ -12,7 +12,7 @@ const cachesRunnableLogs = new WeakMap(); /** * Add a chunk of log output to the cached * output for a suite - * @param {Mocha.Suite} suite + * @param {import('../functional_test_runner/fake_mocha_types').Suite} suite * @param {string} chunk */ export function recordLog(suite, chunk) { @@ -23,7 +23,7 @@ export function recordLog(suite, chunk) { /** * Recursively walk up from a runnable to collect * the cached log for its suite and all its parents - * @param {Mocha.Suite} suite + * @param {import('../functional_test_runner/fake_mocha_types').Suite} suite */ function getCurrentCachedSuiteLogs(suite) { const history = suite.parent ? getCurrentCachedSuiteLogs(suite.parent) : ''; @@ -35,6 +35,7 @@ function getCurrentCachedSuiteLogs(suite) { * Snapshot the logs from this runnable's suite at this point, * as the suite logs will get updated to include output from * subsequent runnables + * @param {import('../functional_test_runner/fake_mocha_types').Runnable} runnable * @param {Mocha.Runnable} runnable */ export function snapshotLogsForRunnable(runnable) { @@ -44,7 +45,7 @@ export function snapshotLogsForRunnable(runnable) { /** * Get the suite logs as they were when the logs for this runnable * were snapshotted - * @param {Mocha.Runnable} runnable + * @param {import('../functional_test_runner/fake_mocha_types').Runnable} runnable */ export function getSnapshotOfRunnableLogs(runnable) { return cachesRunnableLogs.get(runnable); diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json index 282d23e8bcb1..b1f4e9f0a152 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/kbn-test/tsconfig.json @@ -1,18 +1,35 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": true, "types": ["jest", "node"] }, "include": [ "**/*.ts", "**/*.js", + "src/jest/jest_flags.json", ], "exclude": [ "types/**/*", - "**/__fixtures__/**/*" + "**/__fixtures__/**/*", + "target/**/*", + ], + "kbn_references": [ + "@kbn/dev-utils", + "@kbn/std", + "@kbn/tooling-log", + "@kbn/get-repo-files", + "@kbn/peggy", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/ci-stats-reporter", + "@kbn/repo-info", + "@kbn/es", + "@kbn/dev-proc-runner", + "@kbn/jest-serializers", + "@kbn/stdio-dev-helpers", + "@kbn/babel-register", + "@kbn/package-map", ] } diff --git a/packages/kbn-timelion-grammar/BUILD.bazel b/packages/kbn-timelion-grammar/BUILD.bazel deleted file mode 100644 index 7898fef88f1f..000000000000 --- a/packages/kbn-timelion-grammar/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-timelion-grammar" -PKG_REQUIRE_NAME = "@kbn/timelion-grammar" - -NPM_MODULE_EXTRA_FILES = [ - "index.js", - "chain.peggy", - "package.json", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-timelion-grammar/kibana.jsonc b/packages/kbn-timelion-grammar/kibana.jsonc index ec0f5079abb8..88b61e0c1587 100644 --- a/packages/kbn-timelion-grammar/kibana.jsonc +++ b/packages/kbn-timelion-grammar/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/timelion-grammar", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-timelion-grammar/tsconfig.json b/packages/kbn-timelion-grammar/tsconfig.json new file mode 100644 index 000000000000..939903f56b52 --- /dev/null +++ b/packages/kbn-timelion-grammar/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "*.js", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-tinymath/BUILD.bazel b/packages/kbn-tinymath/BUILD.bazel deleted file mode 100644 index b9f1fb9daf84..000000000000 --- a/packages/kbn-tinymath/BUILD.bazel +++ /dev/null @@ -1,52 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-tinymath" -PKG_REQUIRE_NAME = "@kbn/tinymath" - -SOURCE_FILES = glob( - [ - "src/**/*", - ] -) - -TYPE_FILES = [ - "index.d.ts", -] - -SRCS = SOURCE_FILES + TYPE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [ - "@npm//lodash", -] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [":srcs"], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-tinymath/kibana.jsonc b/packages/kbn-tinymath/kibana.jsonc index 3a26322d2394..dd790aee9fe9 100644 --- a/packages/kbn-tinymath/kibana.jsonc +++ b/packages/kbn-tinymath/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/tinymath", - "owner": "@elastic/kibana-visualizations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-visualizations" } diff --git a/packages/kbn-tinymath/test/library.test.js b/packages/kbn-tinymath/test/library.test.js index 054d78fc60ad..fc5c94298d79 100644 --- a/packages/kbn-tinymath/test/library.test.js +++ b/packages/kbn-tinymath/test/library.test.js @@ -11,7 +11,7 @@ Need tests for spacing, etc */ -import { evaluate, parse } from '@kbn/tinymath'; +import { evaluate, parse } from '../src'; function variableEqual(value) { return expect.objectContaining({ type: 'variable', value }); diff --git a/packages/kbn-tinymath/tsconfig.json b/packages/kbn-tinymath/tsconfig.json index 748eb53a69e3..791a6d85a685 100644 --- a/packages/kbn-tinymath/tsconfig.json +++ b/packages/kbn-tinymath/tsconfig.json @@ -1,4 +1,10 @@ { - "extends": "../../tsconfig.bazel.json", - "include": ["index.d.ts"] + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["index.d.ts"], + "exclude": [ + "target/**/*", + ] } diff --git a/packages/kbn-tooling-log/BUILD.bazel b/packages/kbn-tooling-log/BUILD.bazel deleted file mode 100644 index a61c6039312a..000000000000 --- a/packages/kbn-tooling-log/BUILD.bazel +++ /dev/null @@ -1,128 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-tooling-log" -PKG_REQUIRE_NAME = "@kbn/tooling-log" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//rxjs", - "@npm//tslib", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//rxjs", - "@npm//tslib", - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-some-dev-log:npm_module_types", - "//packages/kbn-jest-serializers:npm_module_types", # needed for windows development, only used in tests -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-tooling-log/kibana.jsonc b/packages/kbn-tooling-log/kibana.jsonc index 88eecfa75bf3..d855a7dc46c7 100644 --- a/packages/kbn-tooling-log/kibana.jsonc +++ b/packages/kbn-tooling-log/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/tooling-log", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-tooling-log/package.json b/packages/kbn-tooling-log/package.json index 45bdc79a120d..eb1071293b98 100644 --- a/packages/kbn-tooling-log/package.json +++ b/packages/kbn-tooling-log/package.json @@ -2,7 +2,5 @@ "name": "@kbn/tooling-log", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-tooling-log/tsconfig.json b/packages/kbn-tooling-log/tsconfig.json index 57c1dd1c94e0..7f4d0f5e1c7c 100644 --- a/packages/kbn-tooling-log/tsconfig.json +++ b/packages/kbn-tooling-log/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/some-dev-log", + "@kbn/jest-serializers" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ts-project-linter-cli/README.md b/packages/kbn-ts-project-linter-cli/README.md new file mode 100644 index 000000000000..d78e88f74e28 --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/README.md @@ -0,0 +1,3 @@ +# @kbn/ts-project-linter-cli + +Empty package generated by @kbn/generate diff --git a/packages/kbn-ts-project-linter-cli/jest.config.js b/packages/kbn-ts-project-linter-cli/jest.config.js new file mode 100644 index 000000000000..544d6f3afa2f --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-ts-project-linter-cli'], +}; diff --git a/packages/kbn-ts-project-linter-cli/kibana.jsonc b/packages/kbn-ts-project-linter-cli/kibana.jsonc new file mode 100644 index 000000000000..d92db6b07177 --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/ts-project-linter-cli", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-ts-project-linter-cli/package.json b/packages/kbn-ts-project-linter-cli/package.json new file mode 100644 index 000000000000..e82f4b23467b --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/ts-project-linter-cli", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "main": "./run_lint_ts_projects_cli" +} diff --git a/packages/kbn-ts-project-linter-cli/run_lint_ts_projects_cli.ts b/packages/kbn-ts-project-linter-cli/run_lint_ts_projects_cli.ts new file mode 100644 index 000000000000..ea3c9dbd4cb0 --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/run_lint_ts_projects_cli.ts @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { run } from '@kbn/dev-cli-runner'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { RepoPath } from '@kbn/repo-path'; +import { getRepoFiles } from '@kbn/get-repo-files'; +import { PROJECTS as ALL_PROJECTS, type Project } from '@kbn/ts-projects'; +import { lintProjects, ProjectFileMap } from '@kbn/ts-project-linter'; + +run( + async ({ log, flagsReader }) => { + const projectFilter = new Set( + flagsReader.arrayOfStrings('project')?.map((i) => Path.resolve(i)) + ); + const projects = projectFilter.size + ? ALL_PROJECTS.filter((p) => projectFilter.has(p.path)) + : ALL_PROJECTS; + + const projectFileMap = new ProjectFileMap(); + await projectFileMap.preload(ALL_PROJECTS); + + const { lintingErrorCount } = await lintProjects(log, projects, { + fix: flagsReader.boolean('fix'), + projectFileMap, + skipRefs: + flagsReader.boolean('refs-check') === false || + flagsReader.boolean('no-refs-check') === true, + }); + + let failed = lintingErrorCount > 0; + + const isInMultipleTsProjects = new Map>(); + const pathsToProject = new Map(); + for (const proj of ALL_PROJECTS) { + const paths = projectFileMap.getFiles(proj); + + for (const path of paths) { + if (!pathsToProject.has(path.repoRel)) { + pathsToProject.set(path.repoRel, proj); + continue; + } + + if (path.isTypeScriptAmbient()) { + continue; + } + + isInMultipleTsProjects.set( + path.repoRel, + new Set([...(isInMultipleTsProjects.get(path.repoRel) ?? []), proj]) + ); + } + } + + if (isInMultipleTsProjects.size) { + failed = true; + const details = Array.from(isInMultipleTsProjects) + .map( + ([repoRel, list]) => + ` - ${repoRel}:\n${Array.from(list) + .map((p) => ` - ${p.repoRel}`) + .join('\n')}` + ) + .join('\n'); + + log.error( + `The following files belong to multiple tsconfig.json files listed in packages/kbn-ts-projects/projects.ts\n${details}` + ); + } + + const isNotInTsProject: RepoPath[] = []; + for (const path of await getRepoFiles()) { + if (!path.isTypeScript() || path.isFixture()) { + continue; + } + + const proj = pathsToProject.get(path.repoRel); + if (proj === undefined) { + isNotInTsProject.push(path); + } + } + + if (isNotInTsProject.length) { + failed = true; + log.error( + `The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in packages/kbn-ts-projects/projects.ts\n${isNotInTsProject + .map((file) => ` - ${file.repoRel}`) + .join('\n')}` + ); + } + + if (failed) { + throw createFailError('see above errors'); + } else { + log.success('All TS files belong to a single ts project'); + } + }, + { + usage: `node scripts/ts_project_linter`, + flags: { + boolean: ['fix', 'refs-check', 'no-refs-check'], + string: ['project'], + alias: { f: 'fix', R: 'no-refs-check' }, + default: { 'refs-check': true }, + help: ` + --no-lint Disables linting rules, only validting that every file is a member of just one project + --project Focus linting on a specific project, disables project membership checks, can be specified multiple times + --fix Automatically fix some issues in tsconfig.json files + -R, --no-refs-check Disables the reference checking rules, making the linting much faster, but less accruate + `, + }, + description: + 'Check that all .ts and .tsx files in the repository are assigned to a tsconfig.json file', + } +); diff --git a/packages/kbn-ts-project-linter-cli/tsconfig.json b/packages/kbn-ts-project-linter-cli/tsconfig.json new file mode 100644 index 000000000000..16064f576481 --- /dev/null +++ b/packages/kbn-ts-project-linter-cli/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/repo-path", + "@kbn/get-repo-files", + "@kbn/ts-projects", + "@kbn/ts-project-linter", + ] +} diff --git a/packages/kbn-ts-project-linter/README.md b/packages/kbn-ts-project-linter/README.md new file mode 100644 index 000000000000..68e886e6b66d --- /dev/null +++ b/packages/kbn-ts-project-linter/README.md @@ -0,0 +1,3 @@ +# @kbn/ts-project-linter + +Empty package generated by @kbn/generate diff --git a/packages/kbn-utils/src/package_json/index.test.ts b/packages/kbn-ts-project-linter/ast/ast.ts similarity index 57% rename from packages/kbn-utils/src/package_json/index.test.ts rename to packages/kbn-ts-project-linter/ast/ast.ts index 263e277dd3b4..9881a9f96f00 100644 --- a/packages/kbn-utils/src/package_json/index.test.ts +++ b/packages/kbn-ts-project-linter/ast/ast.ts @@ -6,8 +6,12 @@ * Side Public License, v 1. */ -import { kibanaPackageJson } from '.'; +import { T, parseExpression } from './babel'; -it('parses package.json', () => { - expect(kibanaPackageJson.name).toEqual('kibana'); -}); +export function getAst(source: string) { + const ast = parseExpression(source); + if (!T.isObjectExpression(ast)) { + throw new Error('expected tsconfig.json file to be an object expression'); + } + return ast; +} diff --git a/packages/kbn-ts-project-linter/ast/babel.ts b/packages/kbn-ts-project-linter/ast/babel.ts new file mode 100644 index 000000000000..911166a49f90 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/babel.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as T from '@babel/types'; +import { parseExpression } from '@babel/parser'; +export { T, parseExpression }; diff --git a/packages/kbn-ts-project-linter/ast/compiler_options.test.ts b/packages/kbn-ts-project-linter/ast/compiler_options.test.ts new file mode 100644 index 000000000000..7a421d966d72 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/compiler_options.test.ts @@ -0,0 +1,292 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; + +import { removeCompilerOption, setCompilerOption } from './compiler_options'; + +describe('removeCompilerOption()', () => { + it('handles strings with trailing comma', () => { + const updated = removeCompilerOption( + dedent` + { + "compilerOptions": { + "foo": "bar", + } + } + `, + 'foo' + ); + + expect(updated).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + } + }" + `); + }); + it('handles booleans with trailing comma', () => { + const updated = removeCompilerOption( + dedent` + { + "compilerOptions": { + "foo": true, + } + } + `, + 'foo' + ); + + expect(updated).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + } + }" + `); + }); + it('handles numbers with trailing comma', () => { + const updated = removeCompilerOption( + dedent` + { + "compilerOptions": { + "foo": 1, + } + } + `, + 'foo' + ); + + expect(updated).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + } + }" + `); + }); + it('handles inline properties', () => { + const updated = removeCompilerOption( + dedent` + { + "compilerOptions": {"foo": 1} + } + `, + 'foo' + ); + + expect(updated).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": {} + }" + `); + }); + it('handles inline properties with trailing commas', () => { + const updated = removeCompilerOption( + dedent` + { + "compilerOptions": {"foo": 1,} + } + `, + 'foo' + ); + + expect(updated).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": {} + }" + `); + }); +}); + +describe('setCompilerOptions()', () => { + it('updated existing compiler options', () => { + expect( + setCompilerOption( + dedent` + { + "compilerOptions": {"foo": 1} + } + `, + 'foo', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": {\\"foo\\": 2} + }" + `); + + expect( + setCompilerOption( + dedent` + { + "compilerOptions": {"foo": true} + } + `, + 'foo', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": {\\"foo\\": 2} + }" + `); + + expect( + setCompilerOption( + dedent` + { + "compilerOptions": {"foo": "bar"} + } + `, + 'foo', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": {\\"foo\\": 2} + }" + `); + + expect( + setCompilerOption( + dedent` + { + "compilerOptions": { + "foo": "bar" + } + } + `, + 'foo', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + \\"foo\\": 2 + } + }" + `); + + expect( + setCompilerOption( + dedent` + { + "compilerOptions": { + "foo": "bar", + } + } + `, + 'foo', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + \\"foo\\": 2, + } + }" + `); + }); + + it('expands single line compiler options', () => { + expect( + setCompilerOption( + dedent` + { + "compilerOptions": {"foo": 1} + } + `, + 'bar', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + \\"foo\\": 1, + \\"bar\\": 2 + } + }" + `); + }); + + it('adds to multi-line compiler options', () => { + expect( + setCompilerOption( + dedent` + { + "compilerOptions": { + "foo": 1 + } + } + `, + 'bar', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + \\"foo\\": 1, + \\"bar\\": 2 + } + }" + `); + + expect( + setCompilerOption( + dedent` + { + "compilerOptions": { + "foo": 1, + } + } + `, + 'bar', + 2 + ) + ).toMatchInlineSnapshot(` + "{ + \\"compilerOptions\\": { + \\"foo\\": 1, + \\"bar\\": 2, + } + }" + `); + + expect( + setCompilerOption( + removeCompilerOption( + dedent` + { + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "skipLibCheck": false + }, + "include": [ + "expect.d.ts" + ] + } + `, + 'skipLibCheck' + ), + + 'outDir', + 'foo/bar' + ) + ).toMatchInlineSnapshot(` + "{ + \\"extends\\": \\"../../tsconfig.base.json\\", + \\"compilerOptions\\": { + \\"outDir\\": \\"foo/bar\\" + }, + \\"include\\": [ + \\"expect.d.ts\\" + ] + }" + `); + }); +}); diff --git a/packages/kbn-ts-project-linter/ast/compiler_options.ts b/packages/kbn-ts-project-linter/ast/compiler_options.ts new file mode 100644 index 000000000000..9b368d5ee4a5 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/compiler_options.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Jsonc } from '@kbn/bazel-packages'; + +import { T } from './babel'; +import { getAst } from './ast'; +import { getEnds, getExpandedEnds } from './ends'; +import { getProp, getEndOfLastProp } from './props'; + +export function getCompilerOptions(source: string) { + const compilerOptions = getProp(getAst(source), 'compilerOptions'); + if (!compilerOptions) { + throw new Error('unable to find compilerOptions property'); + } + if (!T.isObjectExpression(compilerOptions.value)) { + throw new Error('expected compilerOptions property to be an object expression'); + } + + return compilerOptions.value; +} + +export function setCompilerOption(source: string, name: string, value: any) { + const compilerOptions = getCompilerOptions(source); + + const existing = getProp(compilerOptions, name); + if (existing) { + const [start, end] = getEnds(existing.value); + return source.slice(0, start) + JSON.stringify(value) + source.slice(end); + } + + if ( + !compilerOptions.properties.length || + compilerOptions.loc?.start.line === compilerOptions.loc?.end.line + ) { + // convert to multiline + const orig = (Jsonc.parse(source) as any).compilerOptions; + const [start, end] = getEnds(compilerOptions); + return ( + source.slice(0, start) + + JSON.stringify( + { + ...orig, + [name]: value, + }, + null, + 2 + ) + .split('\n') + .map((l, i) => (i === 0 ? l : ` ${l}`)) + .join('\n') + + source.slice(end) + ); + } + + const endOfLastProp = getEndOfLastProp(compilerOptions); + let left = source.slice(0, endOfLastProp); + while (left.at(-1) === ',') { + left = left.slice(0, -1); + } + const right = source.slice(endOfLastProp); + return left + `,\n ${JSON.stringify(name)}: ${JSON.stringify(value)}` + right; +} + +export function removeCompilerOption(source: string, name: string) { + const compilerOptions = getCompilerOptions(source); + + const culprit = getProp(compilerOptions, name); + if (!culprit) { + throw new Error(`unable to find compiler option "${name}"`); + } + + const [start, end] = getExpandedEnds(source, culprit); + return source.slice(0, start) + source.slice(end); +} diff --git a/packages/kbn-ts-project-linter/ast/ends.test.ts b/packages/kbn-ts-project-linter/ast/ends.test.ts new file mode 100644 index 000000000000..eff216136342 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/ends.test.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getAst } from './ast'; +import { getProp } from './props'; +import { getEnds, getExpandedEnds } from './ends'; + +const source = `{ + "foo": "bar", +}`; +const ast = getAst(source); +const foo = getProp(ast, 'foo')!; + +describe('getEnds()', () => { + it('returns the index of the first char of a node, and the index just past the last char', () => { + expect(getEnds(foo.value)).toMatchInlineSnapshot(` + Array [ + 11, + 16, + ] + `); + expect(source.slice(...getEnds(foo.value))).toMatchInlineSnapshot(`"\\"bar\\""`); + }); +}); + +describe('getExpandedEnds()', () => { + it('returns the index of the first char of whitespace preceding a node, and the index just past the last char and optionally trailing comma', () => { + expect(getExpandedEnds(source, foo.value)).toMatchInlineSnapshot(` + Array [ + 10, + 17, + ] + `); + expect(source.slice(...getExpandedEnds(source, foo.value))).toMatchInlineSnapshot( + `" \\"bar\\","` + ); + }); +}); diff --git a/packages/kbn-ts-project-linter/ast/ends.ts b/packages/kbn-ts-project-linter/ast/ends.ts new file mode 100644 index 000000000000..4d0d23076fc7 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/ends.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import * as T from '@babel/types'; + +export function getEnds(node: T.Node): [number, number] { + const { start, end } = node; + if (start == null || end == null) { + throw new Error('missing start/end of node'); + } + return [start, end]; +} + +export function getExpandedEnds(source: string, node: T.Node): [number, number] { + let [start, end] = getEnds(node); + while (source[start - 1] === ' ' || source[start - 1] === '\n') { + start -= 1; + } + + while (source[end] === ',') { + end += 1; + } + + return [start, end]; +} diff --git a/packages/kbn-ts-project-linter/ast/exclude.test.ts b/packages/kbn-ts-project-linter/ast/exclude.test.ts new file mode 100644 index 000000000000..9539eaed9298 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/exclude.test.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; + +import { setExclude } from './exclude'; + +describe('setExclude()', () => { + it('overwrites previous formatting', () => { + expect( + setExclude( + dedent` + { + "exclude": [1, 2, + "foo" + ] + } + `, + ['1', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"exclude\\": [ + \\"1\\", + \\"bar\\", + ] + }" + `); + }); + + it('adds the property at the end if it does not exist', () => { + expect( + setExclude( + dedent` + { + "foo": 1 + } + `, + ['1', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"foo\\": 1, + \\"exclude\\": [ + \\"1\\", + \\"bar\\", + ] + }" + `); + expect( + setExclude( + dedent` + { + "foo": 1, + } + `, + ['1', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"foo\\": 1, + \\"exclude\\": [ + \\"1\\", + \\"bar\\", + ], + }" + `); + }); +}); diff --git a/packages/kbn-ts-project-linter/ast/exclude.ts b/packages/kbn-ts-project-linter/ast/exclude.ts new file mode 100644 index 000000000000..c66cd9a21af4 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/exclude.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getAst } from './ast'; +import { getProp } from './props'; +import { getEnds } from './ends'; +import { getEndOfLastProp } from './props'; + +export function setExclude(source: string, excludes: string[]) { + const ast = getAst(source); + const newExcludes = `"exclude": [\n${excludes + .map((e) => ` ${JSON.stringify(e)},`) + .join('\n')}\n ]`; + + const existing = getProp(ast, 'exclude'); + if (existing) { + const [start, end] = getEnds(existing); + return source.slice(0, start) + newExcludes + source.slice(end); + } + + const endOfLastProp = getEndOfLastProp(ast); + return source.slice(0, endOfLastProp) + `,\n ${newExcludes}` + source.slice(endOfLastProp); +} diff --git a/packages/kbn-optimizer/src/node/transforms/index.ts b/packages/kbn-ts-project-linter/ast/index.ts similarity index 63% rename from packages/kbn-optimizer/src/node/transforms/index.ts rename to packages/kbn-ts-project-linter/ast/index.ts index bda2dcfa1982..83fd16c68198 100644 --- a/packages/kbn-optimizer/src/node/transforms/index.ts +++ b/packages/kbn-ts-project-linter/ast/index.ts @@ -6,10 +6,6 @@ * Side Public License, v 1. */ -import { peggyTransform } from './peggy'; -import { babelTransform } from './babel'; - -export const TRANSFORMS = { - '.peggy': peggyTransform, - default: babelTransform, -}; +export { removeCompilerOption, setCompilerOption } from './compiler_options'; +export { setExclude } from './exclude'; +export { addReferences, removeReferences, replaceReferences } from './references'; diff --git a/packages/kbn-ts-project-linter/ast/props.ts b/packages/kbn-ts-project-linter/ast/props.ts new file mode 100644 index 000000000000..00549a291b96 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/props.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { T } from './babel'; +import { getEnds } from './ends'; + +export function getProp(obj: T.ObjectExpression, name: string) { + return obj.properties.find((p): p is T.ObjectProperty & { key: T.StringLiteral } => { + return T.isObjectProperty(p) && T.isStringLiteral(p.key) && p.key.value === name; + }); +} + +export function getEndOfLastProp(obj: T.ObjectExpression) { + if (obj.properties.length === 0) { + throw new Error('object has no properties'); + } + + return obj.properties.reduce((acc, prop) => Math.max(acc, getEnds(prop)[1]), 0); +} diff --git a/packages/kbn-ts-project-linter/ast/references.test.ts b/packages/kbn-ts-project-linter/ast/references.test.ts new file mode 100644 index 000000000000..cd3a071bddac --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/references.test.ts @@ -0,0 +1,215 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; + +import { addReferences, removeReferences, replaceReferences } from './references'; + +describe('addReferences()', () => { + it('replaces single line refs', () => { + expect( + addReferences( + dedent` + { + "kbn_references": [] + } + `, + ['foo', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + \\"foo\\", + \\"bar\\", + ] + }" + `); + expect( + addReferences( + dedent` + { + "kbn_references": [{"path": "x"}] + } + `, + ['foo', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + { \\"path\\": \\"x\\" }, + \\"foo\\", + \\"bar\\", + ] + }" + `); + }); + it('adds items to the end of existing expanded lists', () => { + expect( + addReferences( + dedent` + { + "kbn_references": [ + // this is a comment + {"path": "b" }, + "other", + "x", + ] + } + `, + ['foo', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + // this is a comment + {\\"path\\": \\"b\\" }, + \\"other\\", + \\"x\\", + \\"foo\\", + \\"bar\\", + ] + }" + `); + expect( + addReferences( + dedent` + { + "kbn_references": [ + // this is a comment + {"path": "b" }, + "other", + "x" + ] + } + `, + ['foo', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + // this is a comment + {\\"path\\": \\"b\\" }, + \\"other\\", + \\"x\\", + \\"foo\\", + \\"bar\\" + ] + }" + `); + }); +}); + +describe('removeReferences()', () => { + it('throws if the values are not found', () => { + expect(() => + removeReferences( + dedent` + { + "kbn_references": [] + } + `, + ['foo'] + ) + ).toThrowErrorMatchingInlineSnapshot(`"unable to find reference \\"foo\\""`); + }); + it('adds removes items from single-line and expanded lists', () => { + expect( + removeReferences( + dedent` + { + "kbn_references": ["foo", "bar", "baz"] + } + `, + ['foo', 'bar'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ \\"baz\\"] + }" + `); + expect( + removeReferences( + dedent` + { + "kbn_references": [ + // this is a comment + {"path": "b" }, + "other", + "x", + ] + } + `, + ['other', 'x'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + // this is a comment + {\\"path\\": \\"b\\" }, + ] + }" + `); + expect( + removeReferences( + dedent` + { + "kbn_references": [ + // this is a comment + {"path": "b" }, + "other", + "x" + ] + } + `, + ['other'] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + // this is a comment + {\\"path\\": \\"b\\" }, + \\"x\\" + ] + }" + `); + }); +}); + +describe('replaceReferences()', () => { + it('removes the old path refs and replaces them with the given pkgId', () => { + expect( + replaceReferences( + dedent` + { + "kbn_references": [ + "@kbn/core", + { + "path": "foo", + }, + "@kbn/other", + { "path": "bar" } + ] + } + `, + [ + ['foo', '@kbn/a'], + ['bar', '@kbn/b'], + ] + ) + ).toMatchInlineSnapshot(` + "{ + \\"kbn_references\\": [ + \\"@kbn/core\\", + \\"@kbn/a\\", + \\"@kbn/other\\", + \\"@kbn/b\\" + ] + }" + `); + }); +}); diff --git a/packages/kbn-ts-project-linter/ast/references.ts b/packages/kbn-ts-project-linter/ast/references.ts new file mode 100644 index 000000000000..6b3563f0e911 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/references.ts @@ -0,0 +1,110 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { T } from './babel'; +import { getAst } from './ast'; +import { getEnds, getExpandedEnds } from './ends'; +import { getProp, getEndOfLastProp } from './props'; +import { snip } from './snip'; + +const PROP = 'kbn_references'; + +export function addReferences(source: string, refsToAdd: string[]) { + const ast = getAst(source); + + const existing = getProp(ast, PROP); + const value = existing?.value; + if (value && !T.isArrayExpression(value)) { + throw new Error(`expected "${PROP}" to have an array value`); + } + + if (value && value.elements.length > 0 && value.loc?.start.line !== value.loc?.end.line) { + const lastEl = value.elements.at(-1); + if (!lastEl) { + throw new Error('missing last element...'); + } + + const [, endOfLastEl] = getEnds(lastEl); + return ( + source.slice(0, endOfLastEl) + + `,\n${refsToAdd.map((r) => ` ${JSON.stringify(r)}`).join(',\n')}` + + source.slice(endOfLastEl) + ); + } + + // replace/print JSON printed refs + const refs = [...(!value ? [] : JSON.parse(source.slice(...getEnds(value)))), ...refsToAdd]; + const refsSrc = `${JSON.stringify(PROP)}: [\n${refs + .map((l) => + typeof l === 'string' + ? ` ${JSON.stringify(l)},` + : ` { "path": ${JSON.stringify(l.path)} },` + ) + .join('\n')}\n ]`; + + if (!existing) { + const endOfLastProp = getEndOfLastProp(ast); + return source.slice(0, endOfLastProp) + `,\n ${refsSrc}` + source.slice(endOfLastProp); + } + + const [start, end] = getEnds(existing); + return source.slice(0, start) + refsSrc + source.slice(end); +} + +export function removeReferences(source: string, refs: string[]) { + const ast = getAst(source); + + const existing = getProp(ast, PROP); + const value = existing?.value; + if (!value || !T.isArrayExpression(value)) { + throw new Error(`expected "${PROP}" to have an array value`); + } + + return snip( + source, + refs.map((ref) => { + const el = value.elements.find((e) => T.isStringLiteral(e) && e.value === ref); + if (!el) { + throw new Error(`unable to find reference "${ref}"`); + } + + return getExpandedEnds(source, el); + }) + ); +} + +export function replaceReferences( + source: string, + replacements: Array<[path: string, pkgId: string]> +) { + const ast = getAst(source); + + const existing = getProp(ast, PROP); + const value = existing?.value; + if (!value || !T.isArrayExpression(value)) { + throw new Error(`expected "${PROP}" to have an array value`); + } + + return snip( + source, + replacements.map(([path, pkgId]) => { + const el = value.elements.find((e) => { + if (!T.isObjectExpression(e)) return; + const prop = getProp(e, 'path'); + if (!prop || !T.isStringLiteral(prop.value)) return; + return prop.value.value === path; + }); + + if (!el) { + throw new Error(`unable to find reference with path "${path}"`); + } + + return [...getEnds(el), JSON.stringify(pkgId)]; + }) + ); +} diff --git a/packages/kbn-ts-project-linter/ast/snip.test.ts b/packages/kbn-ts-project-linter/ast/snip.test.ts new file mode 100644 index 000000000000..b3047d1360cd --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/snip.test.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import dedent from 'dedent'; +import { snip } from './snip'; + +describe('snip()', () => { + it('removes ranges from a string', () => { + expect(snip('abcd', [[0, 1]])).toBe('bcd'); + expect( + snip('abcd', [ + [0, 1], + [2, 3], + ]) + ).toBe('bd'); + }); + + it('handles weirdly ordered and overlapping ranges', () => { + expect( + snip( + dedent` + This is the sentence and I would like to remove specific words to make it say something else. + `, + [ + [29, 59], + [30, 41], + [78, 80], + [12, 25], + [87, 92], + ] + ) + ).toMatchInlineSnapshot(`"This is the I words to make it say mething."`); + }); + + it('throws if the snips are misordered', () => { + expect(() => snip('foo', [[2, 1]])).toThrowErrorMatchingInlineSnapshot( + `"snips can not be reversed, received [2,1]"` + ); + }); + + it("supports snips with replacements, as long as they don't overlap", () => { + expect( + snip('foo bar', [ + [2, 3, 'Oo0'], + [4, 5, 'BbB'], + ]) + ).toMatchInlineSnapshot(`"foOo0 BbBar"`); + }); +}); diff --git a/packages/kbn-ts-project-linter/ast/snip.ts b/packages/kbn-ts-project-linter/ast/snip.ts new file mode 100644 index 000000000000..c9c9915475e0 --- /dev/null +++ b/packages/kbn-ts-project-linter/ast/snip.ts @@ -0,0 +1,44 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +type Snip = [number, number] | [number, number, string]; +export function snip(source: string, snips: Snip[]) { + const queue = snips + .map((s): Snip => { + if (s[0] > s[1]) { + throw new Error(`snips can not be reversed, received [${s}]`); + } + return s; + }) + // sort snips by their starting position + .sort((a, b) => a[0] - b[0]) + // merge snips that overlap + .reduce((acc: Snip[], s) => { + const prev = acc.at(-1); + if (!prev || prev[1] < s[0]) { + return [...acc, s]; + } + + if (prev[2] || s[2]) { + throw new Error('snip() does not support replacement snips which overlap'); + } + + const merged: Snip = [Math.min(prev[0], s[0]), Math.max(prev[1], s[1])]; + return [...acc.slice(0, -1), merged]; + }, []); + + let offset = 0; + let snipped = source; + for (const [start, end, replacement = ''] of queue) { + snipped = snipped.slice(0, start + offset) + replacement + snipped.slice(end + offset); + const origLen = end - start; + offset += replacement.length - origLen; + } + + return snipped; +} diff --git a/packages/kbn-ts-project-linter/index.ts b/packages/kbn-ts-project-linter/index.ts new file mode 100644 index 000000000000..7dd644fd6c4b --- /dev/null +++ b/packages/kbn-ts-project-linter/index.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { lintProjects } from './lib/lint_projects'; +export { ProjectFileMap } from './lib/project_file_map'; diff --git a/packages/kbn-ts-project-linter/jest.config.js b/packages/kbn-ts-project-linter/jest.config.js new file mode 100644 index 000000000000..fb273e1cafea --- /dev/null +++ b/packages/kbn-ts-project-linter/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-ts-project-linter'], +}; diff --git a/packages/kbn-ts-project-linter/kibana.jsonc b/packages/kbn-ts-project-linter/kibana.jsonc new file mode 100644 index 000000000000..ea1fe1715bee --- /dev/null +++ b/packages/kbn-ts-project-linter/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/ts-project-linter", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-ts-project-linter/lib/import_locator.ts b/packages/kbn-ts-project-linter/lib/import_locator.ts new file mode 100644 index 000000000000..20d6ab013fcb --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/import_locator.ts @@ -0,0 +1,79 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +// based on the code in https://github.com/nrwl/nx/blob/e12922b02908c90797e038324f2afa4bf69e2eab/packages/nx/src/project-graph/build-dependencies/typescript-import-locator.ts#L62 +// simplified to focuse on what we need, see license info in ./strip_source_code + +import Fsp from 'fs/promises'; +import Ts from 'typescript'; +import { RepoPath } from '@kbn/repo-path'; + +import { stripSourceCode } from './strip_source_code'; + +const EMPTY = new Set(); + +export class TypeScriptImportLocator { + private readonly scanner: Ts.Scanner; + + constructor() { + this.scanner = Ts.createScanner(Ts.ScriptTarget.Latest, false, Ts.LanguageVariant.JSX); + } + + async get(path: RepoPath): Promise> { + const content = await Fsp.readFile(path.abs, 'utf8'); + const strippedContent = stripSourceCode(this.scanner, content); + if (strippedContent === '') { + return EMPTY; + } + + const imports = new Set(); + const queue: Ts.Node[] = [ + Ts.createSourceFile(path.abs, strippedContent, Ts.ScriptTarget.Latest, true), + ]; + const addNodeToQueue = (n: Ts.Node) => { + queue.push(n); + }; + + while (queue.length) { + const node = queue.shift()!; + + if ( + (Ts.isImportDeclaration(node) || Ts.isExportDeclaration(node)) && + node.moduleSpecifier && + Ts.isStringLiteral(node.moduleSpecifier) + ) { + imports.add(node.moduleSpecifier.text); + continue; + } + + if ( + Ts.isCallExpression(node) && + node.expression.kind === Ts.SyntaxKind.ImportKeyword && + node.arguments.length === 1 && + Ts.isStringLiteral(node.arguments[0]) + ) { + imports.add(node.arguments[0].text); + continue; + } + + if ( + Ts.isCallExpression(node) && + node.expression.getText() === 'require' && + node.arguments.length === 1 && + Ts.isStringLiteral(node.arguments[0]) + ) { + imports.add(node.arguments[0].text); + continue; + } + + Ts.forEachChild(node, addNodeToQueue); + } + + return imports; + } +} diff --git a/packages/kbn-ts-project-linter/lib/lint_projects.ts b/packages/kbn-ts-project-linter/lib/lint_projects.ts new file mode 100644 index 000000000000..590b88656309 --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/lint_projects.ts @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Fs from 'fs'; +import Path from 'path'; + +import { ToolingLog } from '@kbn/tooling-log'; +import { Project } from '@kbn/ts-projects'; + +import { PROJECT_LINTER_RULES } from '../rules'; +import { ProjectFileMap } from './project_file_map'; +import { Rule, NamedViolation } from './rule'; + +export interface LintOptions { + fix: boolean; + projectFileMap: ProjectFileMap; + skipRefs?: boolean; +} + +export async function lintProjects(log: ToolingLog, projects: Project[], options: LintOptions) { + let errorCount = 0; + let fixedCount = 0; + const ruleCache = new Map(); + + if (options.skipRefs) { + log.warning('skipping [referenceUsedPkgs] rule'); + } + + for (const project of projects) { + log.debug('starting to lint project:', project.name); + const unfixedJsonc = Fs.readFileSync(project.path, 'utf8'); + const unfixedErrors: NamedViolation[] = []; + let fixedJsonc = unfixedJsonc; + + await log.indent(4, async () => { + let haveNewFixes = false; + + for (const rule of PROJECT_LINTER_RULES) { + if (options.skipRefs && rule.name === 'referenceUsedPkgs') { + continue; + } + + if (haveNewFixes) { + haveNewFixes = false; + log.debug('overriding config with fixed config'); + project.overrideConfig(fixedJsonc); + } + + log.debug('rule:', rule.name); + await log.indent(4, async () => { + const errors = await rule.check(project, ruleCache, options.projectFileMap); + for (const error of errors) { + if (!error.fix || !options.fix) { + unfixedErrors.push(error); + continue; + } + + let update; + try { + update = error.fix(fixedJsonc); + } catch (e) { + log.debug(`error fixing project:`, e); + } + + if (update !== undefined && update !== fixedJsonc) { + fixedJsonc = update; + haveNewFixes = true; + } else { + unfixedErrors.push(error); + } + } + }); + } + }); + + if (fixedJsonc !== unfixedJsonc) { + Fs.writeFileSync(project.path, fixedJsonc, 'utf8'); + project.reloadFromDisk(); + log.debug('fixed', project.path); + fixedCount += 1; + } + + if (unfixedErrors.length) { + let msg = `Lint errors in ${Path.relative(process.cwd(), project.path)}:\n`; + for (const error of unfixedErrors) { + msg += ` [${error.name}]: ${error.msg}\n`; + } + errorCount += 1; + log.error(msg); + } + } + + if (fixedCount) { + log.success(`Applied ${fixedCount} fixes to projects`); + } + + if (errorCount) { + if (options.fix) { + log.error(`Found ${errorCount} un-fixable errors when linting projects.`); + } else { + log.error( + `Found ${errorCount} errors when linting projects. Pass --fix to try auto-fixing them.` + ); + } + } else { + log.success('All TS projects linted successfully'); + } + + return { + lintingErrorCount: errorCount, + }; +} diff --git a/packages/kbn-ts-project-linter/lib/project_file_map.ts b/packages/kbn-ts-project-linter/lib/project_file_map.ts new file mode 100644 index 000000000000..eac7e369b7fc --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/project_file_map.ts @@ -0,0 +1,58 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import globby from 'globby'; + +import { asyncForEachWithLimit } from '@kbn/std'; +import { RepoPath } from '@kbn/repo-path'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { Project } from '@kbn/ts-projects'; + +export class ProjectFileMap { + private readonly filesByProject = new Map(); + + async preload(projects: Project[]) { + await asyncForEachWithLimit(projects, 5, async (project) => { + const paths = await globby(project.config.include ?? [], { + ignore: project.config.exclude ?? [], + cwd: project.directory, + onlyFiles: true, + absolute: true, + }); + + this.filesByProject.set( + project, + paths.map((path) => new RepoPath(REPO_ROOT, Path.relative(REPO_ROOT, path))) + ); + }); + } + + getFiles(project: Project) { + const cached = this.filesByProject.get(project); + if (cached) { + return cached; + } + + const files = globby + .sync(project.config.include ?? [], { + ignore: project.config.exclude ?? [], + cwd: project.directory, + onlyFiles: true, + absolute: true, + }) + .map((abs) => { + return new RepoPath(REPO_ROOT, Path.relative(REPO_ROOT, abs)); + }); + + this.filesByProject.set(project, files); + + return files; + } +} diff --git a/packages/kbn-ts-project-linter/lib/rule.ts b/packages/kbn-ts-project-linter/lib/rule.ts new file mode 100644 index 000000000000..6a1b92803af7 --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/rule.ts @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Project } from '@kbn/ts-projects'; + +import { ProjectFileMap } from './project_file_map'; +import { RuleContext } from './rule_context'; + +export interface NamedViolation extends Violation { + name: string; +} + +export interface Violation { + msg: string; + fix?(source: string): string; +} + +export type CheckFn = ( + this: RuleContext, + project: Project +) => void | Violation[] | Violation | string | Promise; + +export class Rule { + static create(name: string, options: { check: CheckFn }) { + return new Rule(name, options.check); + } + + private constructor(public readonly name: string, private readonly fn: CheckFn) {} + + async check(project: Project, ruleCache: Map, projectFileMap: ProjectFileMap) { + const failures: NamedViolation[] = []; + + const ctx = new RuleContext(failures, project, this, ruleCache, projectFileMap); + const extraFailures = (await this.fn.call(ctx, project)) ?? []; + + for (const failure of Array.isArray(extraFailures) ? extraFailures : [extraFailures]) { + if (typeof failure === 'string') { + failures.push({ + name: this.name, + msg: failure, + }); + } else { + failures.push({ + name: this.name, + ...failure, + }); + } + } + + return failures; + } +} diff --git a/packages/kbn-ts-project-linter/lib/rule_context.ts b/packages/kbn-ts-project-linter/lib/rule_context.ts new file mode 100644 index 000000000000..cdf05278f5d7 --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/rule_context.ts @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { Project } from '@kbn/ts-projects'; + +import { ProjectFileMap } from './project_file_map'; +import { NamedViolation, Rule } from './rule'; + +export class RuleContext { + constructor( + private readonly failures: NamedViolation[], + private readonly project: Project, + private readonly rule: Rule, + private readonly ruleCache: Map, + private readonly projectFileMap: ProjectFileMap + ) {} + + getCache(init: () => T) { + const cached = this.ruleCache.get(this.rule) as T | undefined; + if (cached !== undefined) { + return cached; + } + + const value = init(); + this.ruleCache.set(this.rule, value); + return value; + } + + /** + * Report an error with an optional fix for that erro + */ + err(msg: string, fix?: (source: string) => string) { + this.failures.push({ + name: this.rule.name, + msg, + fix, + }); + } + + /** + * Resolve a path relative to the directory of the current project being linted + */ + resolve(rel: string) { + return Path.resolve(this.project.directory, rel); + } + + getAllFiles() { + return this.projectFileMap.getFiles(this.project); + } +} diff --git a/packages/kbn-ts-project-linter/lib/strip_source_code.ts b/packages/kbn-ts-project-linter/lib/strip_source_code.ts new file mode 100644 index 000000000000..f12810970c49 --- /dev/null +++ b/packages/kbn-ts-project-linter/lib/strip_source_code.ts @@ -0,0 +1,137 @@ +/* eslint-disable @kbn/eslint/require-license-header */ +/* eslint-disable @typescript-eslint/no-shadow */ + +// pulled from https://github.com/nrwl/nx/blob/e12922b02908c90797e038324f2afa4bf69e2eab/packages/nx/src/utils/strip-source-code.ts#L4 + +/** + * @notice + * + * This project includes code from the NX project, which is MIT licensed: + * + * (The MIT License) + * + * Copyright (c) 2017-2022 Narwhal Technologies Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * 'Software'), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +import { SyntaxKind } from 'typescript'; +import type { Scanner } from 'typescript'; + +export function stripSourceCode(scanner: Scanner, contents: string): string { + scanner.setText(contents); + let token = scanner.scan(); + const statements = []; + let start = null; + while (token !== SyntaxKind.EndOfFileToken) { + const potentialStart = scanner.getStartPos(); + switch (token) { + case SyntaxKind.MultiLineCommentTrivia: + case SyntaxKind.SingleLineCommentTrivia: { + const isMultiLineCommentTrivia = token === SyntaxKind.MultiLineCommentTrivia; + const start = potentialStart + 2; + token = scanner.scan(); + const end = scanner.getStartPos() - (isMultiLineCommentTrivia ? 2 : 0); + const comment = contents.substring(start, end).trim(); + if (comment === 'nx-ignore-next-line') { + // reading till the end of the line + while (token === SyntaxKind.WhitespaceTrivia || token === SyntaxKind.NewLineTrivia) { + token = scanner.scan(); + } + + // ignore next line + while (token !== SyntaxKind.NewLineTrivia && token !== SyntaxKind.EndOfFileToken) { + token = scanner.scan(); + } + } + break; + } + + case SyntaxKind.RequireKeyword: + case SyntaxKind.ImportKeyword: { + token = scanner.scan(); + while (token === SyntaxKind.WhitespaceTrivia || token === SyntaxKind.NewLineTrivia) { + token = scanner.scan(); + } + start = potentialStart; + break; + } + + case SyntaxKind.ExportKeyword: { + token = scanner.scan(); + while (token === SyntaxKind.WhitespaceTrivia || token === SyntaxKind.NewLineTrivia) { + token = scanner.scan(); + } + if ( + token === SyntaxKind.OpenBraceToken || + token === SyntaxKind.AsteriskToken || + token === SyntaxKind.TypeKeyword + ) { + start = potentialStart; + } + break; + } + + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: { + while (true) { + token = scanner.scan(); + + if (token === SyntaxKind.SlashToken) { + token = scanner.reScanSlashToken(); + } + + if (token === SyntaxKind.EndOfFileToken) { + // either the template is unterminated, or there + // is some other edge case we haven't compensated for + break; + } + + if (token === SyntaxKind.CloseBraceToken) { + token = scanner.reScanTemplateToken(false); + break; + } + } + break; + } + + case SyntaxKind.StringLiteral: { + if (start !== null) { + token = scanner.scan(); + if (token === SyntaxKind.CloseParenToken) { + token = scanner.scan(); + } + const end = scanner.getStartPos(); + statements.push(contents.substring(start, end)); + start = null; + } else { + token = scanner.scan(); + } + break; + } + + default: { + token = scanner.scan(); + } + } + } + + return statements.join('\n'); +} diff --git a/packages/kbn-ts-project-linter/package.json b/packages/kbn-ts-project-linter/package.json new file mode 100644 index 000000000000..aadde23f6811 --- /dev/null +++ b/packages/kbn-ts-project-linter/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/ts-project-linter", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-ts-project-linter/rules/forbidden_compiler_options.ts b/packages/kbn-ts-project-linter/rules/forbidden_compiler_options.ts new file mode 100644 index 000000000000..f9d1cf8d4a22 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/forbidden_compiler_options.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Rule } from '../lib/rule'; +import { removeCompilerOption } from '../ast'; + +const NAMES = [ + 'declaration', + 'declarationMap', + 'emitDeclarationOnly', + 'skipLibCheck', + 'target', + 'paths', +]; + +export const forbiddenCompilerOptions = Rule.create('forbiddenCompilerOptions', { + check({ config, repoRel }) { + for (const optName of NAMES) { + if (repoRel === '.buildkite/tsconfig.json' && optName === 'paths') { + // allow "paths" in this specific config file + continue; + } + + const value = config.compilerOptions?.[optName]; + if (value === undefined) { + continue; + } + + this.err(`specifying the "${optName}" compiler option is forbidden`, (source) => { + return removeCompilerOption(source, optName); + }); + } + }, +}); diff --git a/packages/kbn-ts-project-linter/rules/index.ts b/packages/kbn-ts-project-linter/rules/index.ts new file mode 100644 index 000000000000..4ed4b40e8ab9 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/index.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { forbiddenCompilerOptions } from './forbidden_compiler_options'; +import { refPkgsIds } from './reference_pkg_ids'; +import { requiredCompilerOptions } from './required_compiler_options'; +import { validBaseConfig } from './valid_base_config'; +import { requiredExcludes } from './required_excludes'; +import { requiredFileSelectors } from './required_file_selectors'; +import { referenceUsedPkgs } from './reference_used_pkgs'; + +export const PROJECT_LINTER_RULES = [ + forbiddenCompilerOptions, + refPkgsIds, + requiredCompilerOptions, + validBaseConfig, + requiredExcludes, + requiredFileSelectors, + referenceUsedPkgs, +]; diff --git a/packages/kbn-ts-project-linter/rules/reference_pkg_ids.ts b/packages/kbn-ts-project-linter/rules/reference_pkg_ids.ts new file mode 100644 index 000000000000..f8b3209f8d37 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/reference_pkg_ids.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { REPO_ROOT } from '@kbn/repo-info'; +import { readPackageMap } from '@kbn/package-map'; + +import { Rule } from '../lib/rule'; +import { replaceReferences } from '../ast'; + +export const refPkgsIds = Rule.create('refPkgIds', { + check(proj) { + const dirsToPkgIds = this.getCache(() => { + const pkgMap = readPackageMap(); + return new Map(Array.from(pkgMap).map(([k, v]) => [v, k])); + }); + + const getPkgId = (tsconfigPath: string) => + dirsToPkgIds.get(Path.relative(REPO_ROOT, Path.dirname(tsconfigPath))); + + const replaceWithPkgId: Array<[string, string]> = []; + + for (const ref of proj.config.kbn_references ?? []) { + if (typeof ref === 'string' || ref.force === true) { + continue; + } + + const refPath = Path.resolve(proj.directory, ref.path); + const pkgIdJson = getPkgId(refPath); + if (pkgIdJson) { + replaceWithPkgId.push([ref.path, pkgIdJson]); + } + } + + if (!replaceWithPkgId.length) { + return; + } + + const list = replaceWithPkgId + .map(([from, to]) => ` - {"path": "${from}"} => ${JSON.stringify(to)}`) + .join('\n'); + + return { + msg: `kbn_references must use pkgIds to refer to other packages (use --fix to autofix, or add "force": true to ignore):\n${list}`, + fix(source) { + return replaceReferences(source, replaceWithPkgId); + }, + }; + }, +}); diff --git a/packages/kbn-ts-project-linter/rules/reference_used_pkgs.ts b/packages/kbn-ts-project-linter/rules/reference_used_pkgs.ts new file mode 100644 index 000000000000..5160701efdff --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/reference_used_pkgs.ts @@ -0,0 +1,65 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { asyncForEachWithLimit } from '@kbn/std'; + +import { Rule } from '../lib/rule'; +import { TypeScriptImportLocator } from '../lib/import_locator'; +import { addReferences, removeReferences } from '../ast'; + +export const referenceUsedPkgs = Rule.create('referenceUsedPkgs', { + async check(project) { + const importLocator = this.getCache(() => new TypeScriptImportLocator()); + const usedPkgIds = new Set(); + + await asyncForEachWithLimit(this.getAllFiles(), 20, async (path) => { + if (!path.isTypeScript() && !path.isJavaScript()) { + return; + } + + for (const req of await importLocator.get(path)) { + if (!req.startsWith('@kbn/')) { + continue; + } + + const [, id] = req.split('/'); + usedPkgIds.add(`@kbn/${id}`); + } + }); + + const refs = new Set( + (project.config.kbn_references ?? []).flatMap((r) => (typeof r === 'string' ? r : [])) + ); + const missing = new Set(); + const extra = new Set(refs); + for (const used of usedPkgIds) { + extra.delete(used); + if (!refs.has(used)) { + missing.add(used); + } + } + + if (missing.size) { + const ids = Array.from(missing); + const list = ids.map((id) => ` - ${id}`).join('\n'); + this.err( + `the following packages are referenced in the code of this package but not listed in kbn_references:\n${list}`, + (source) => addReferences(source, ids) + ); + } + + if (extra.size) { + const ids = Array.from(extra); + const list = ids.map((id) => ` - ${id}`).join('\n'); + this.err( + `the following packages are listed in kbn_references but there are no detectable references in the code:\n${list}`, + (source) => removeReferences(source, ids) + ); + } + }, +}); diff --git a/packages/kbn-ts-project-linter/rules/required_compiler_options.ts b/packages/kbn-ts-project-linter/rules/required_compiler_options.ts new file mode 100644 index 000000000000..8c5f0f374656 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/required_compiler_options.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Rule } from '../lib/rule'; +import { setCompilerOption } from '../ast'; + +const REQUIRED: Array<[string, string]> = [['outDir', 'target/types']]; + +export const requiredCompilerOptions = Rule.create('requiredCompilerOptions', { + check({ config }) { + for (const [key, value] of REQUIRED) { + if (config.compilerOptions?.[key] !== value) { + this.err(`the value of the compiler option "${key}" must be set to "${value}"`, (source) => + setCompilerOption(source, key, value) + ); + } + } + }, +}); diff --git a/packages/kbn-ts-project-linter/rules/required_excludes.ts b/packages/kbn-ts-project-linter/rules/required_excludes.ts new file mode 100644 index 000000000000..54f084c33f98 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/required_excludes.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Rule } from '../lib/rule'; +import { setExclude } from '../ast'; + +const REQUIRED_EXCLUDES = ['target/**/*']; + +export const requiredExcludes = Rule.create('requiredExcludes', { + check(project) { + const existing = project.config.exclude; + if (!existing) { + return { + msg: `excludes must be defined and include "${REQUIRED_EXCLUDES.join('", "')}"`, + fix: (source) => setExclude(source, REQUIRED_EXCLUDES), + }; + } + + const missing = REQUIRED_EXCLUDES.filter((re) => !existing.includes(re)); + if (missing.length) { + return { + msg: `excludes must include "${REQUIRED_EXCLUDES.join('", "')}"`, + fix: (source) => + setExclude(source, [ + ...(missing.includes('target/**/*') + ? existing.filter((e) => { + const normalized = e.startsWith('./') ? e.slice(2) : e; + return normalized === 'target' || normalized.startsWith('target/'); + }) + : existing), + ...missing, + ]), + }; + } + }, +}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts b/packages/kbn-ts-project-linter/rules/required_file_selectors.ts similarity index 50% rename from packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts rename to packages/kbn-ts-project-linter/rules/required_file_selectors.ts index f1a6f9e8348b..d04f06409f2e 100644 --- a/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts +++ b/packages/kbn-ts-project-linter/rules/required_file_selectors.ts @@ -6,9 +6,14 @@ * Side Public License, v 1. */ -describe('useDeleteList', () => { - test('Tests should be ported', () => { - // TODO: Port all the tests from: x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts here once mocks are figured out and kbn package mocks are figured out - expect(true).toBe(true); - }); +import { Rule } from '../lib/rule'; + +export const requiredFileSelectors = Rule.create('requiredFileSelectors', { + check(project) { + if (!project.config.include || project.config.files) { + return { + msg: 'every ts project must use the "include" key (and not the "files" key) to select the files for that project', + }; + } + }, }); diff --git a/packages/kbn-ts-project-linter/rules/valid_base_config.ts b/packages/kbn-ts-project-linter/rules/valid_base_config.ts new file mode 100644 index 000000000000..410f313851d2 --- /dev/null +++ b/packages/kbn-ts-project-linter/rules/valid_base_config.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { REPO_ROOT } from '@kbn/repo-info'; +import { Project } from '@kbn/ts-projects'; + +import { Rule } from '../lib/rule'; + +function getBaseConfigRels(proj: Project): string[] { + const base = proj.getBase(); + if (!base) { + return []; + } + return [base.repoRel, ...getBaseConfigRels(base)]; +} + +export const validBaseConfig = Rule.create('validBaseConfig', { + check(proj) { + const baseConfigRels = getBaseConfigRels(proj); + + if (baseConfigRels[0] === 'tsconfig.json') { + return `This tsconfig extends the root tsconfig.json file and shouldn't. The root tsconfig.json file is not a valid base config, you probably want to point to the tsconfig.base.json file.`; + } + + const configRel = Path.relative(REPO_ROOT, proj.path); + if (configRel !== 'tsconfig.base.json' && !baseConfigRels.includes('tsconfig.base.json')) { + return `This tsconfig does not extend the tsconfig.base.json file either directly or indirectly. The TS config setup for the repo expects every tsconfig file to extend this base config file.`; + } + }, +}); diff --git a/packages/kbn-ts-project-linter/tsconfig.json b/packages/kbn-ts-project-linter/tsconfig.json new file mode 100644 index 000000000000..14d04db83cb9 --- /dev/null +++ b/packages/kbn-ts-project-linter/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/bazel-packages", + "@kbn/tooling-log", + "@kbn/ts-projects", + "@kbn/std", + "@kbn/repo-path", + "@kbn/repo-info", + "@kbn/package-map", + ] +} diff --git a/packages/kbn-ts-projects/README.md b/packages/kbn-ts-projects/README.md new file mode 100644 index 000000000000..5f89b7e6c106 --- /dev/null +++ b/packages/kbn-ts-projects/README.md @@ -0,0 +1,3 @@ +# @kbn/ts-projects + +Empty package generated by @kbn/generate diff --git a/src/dev/typescript/index.ts b/packages/kbn-ts-projects/index.ts similarity index 81% rename from src/dev/typescript/index.ts rename to packages/kbn-ts-projects/index.ts index c390ecc60f01..cb565b3a73bf 100644 --- a/src/dev/typescript/index.ts +++ b/packages/kbn-ts-projects/index.ts @@ -7,4 +7,5 @@ */ export { Project } from './project'; -export { runTypeCheckCli } from './run_type_check_cli'; +export { PROJECTS } from './projects'; +export type { TsConfig } from './ts_configfile'; diff --git a/packages/kbn-ts-projects/jest.config.js b/packages/kbn-ts-projects/jest.config.js new file mode 100644 index 000000000000..23c8bd761378 --- /dev/null +++ b/packages/kbn-ts-projects/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-ts-projects'], +}; diff --git a/packages/kbn-ts-projects/kibana.jsonc b/packages/kbn-ts-projects/kibana.jsonc new file mode 100644 index 000000000000..f73c7a91f73d --- /dev/null +++ b/packages/kbn-ts-projects/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/ts-projects", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-ts-projects/package.json b/packages/kbn-ts-projects/package.json new file mode 100644 index 000000000000..32d2347fda8c --- /dev/null +++ b/packages/kbn-ts-projects/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/ts-projects", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-ts-projects/project.ts b/packages/kbn-ts-projects/project.ts new file mode 100644 index 000000000000..7fb658443e75 --- /dev/null +++ b/packages/kbn-ts-projects/project.ts @@ -0,0 +1,158 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +import { REPO_ROOT } from '@kbn/repo-info'; +import { PackageMap } from '@kbn/package-map'; + +import { readTsConfig, parseTsConfig, TsConfig } from './ts_configfile'; + +export interface ProjectOptions { + name?: string; + disableTypeCheck?: boolean; +} + +type KbnRef = string | { path: string; force?: boolean }; +function isValidKbnRefs(refs: unknown): refs is KbnRef[] { + return ( + Array.isArray(refs) && + refs.every( + (r) => + typeof r === 'string' || + (typeof r === 'object' && r !== null && 'path' in r && typeof r.path === 'string') + ) + ); +} + +export class Project { + /** + * The parsed config file from disk + */ + public config: TsConfig; + + /** absolute path to the tsconfig file defininig this project */ + public readonly path: string; + /** repo relative path to the tsconfig file defininig this project */ + public readonly repoRel: string; + /** name of this project */ + public readonly name: string; + /** The directory containing this ts project */ + public readonly dir: string; + /** The directory containing this ts project */ + public readonly directory: string; + + /** absolute path to the tsconfig file that will be generated for type checking this file */ + public readonly typeCheckConfigPath: string; + /** `true` if we want to explicitly exclude this entire project from type checking */ + public readonly disableTypeCheck: boolean; + + constructor(private readonly others: Map, path: string, opts?: ProjectOptions) { + if (!Path.isAbsolute(path)) { + throw new Error(`Unable to create ts Project from relative path [${path}]`); + } + + this.path = path; + this.config = readTsConfig(this.path); + this.repoRel = Path.relative(REPO_ROOT, path); + this.name = opts?.name || this.repoRel; + this.dir = this.directory = Path.dirname(path); + + this.typeCheckConfigPath = Path.resolve( + this.directory, + Path.basename(this.repoRel, '.json') + '.type_check.json' + ); + + this.disableTypeCheck = !!opts?.disableTypeCheck; + } + + /** + * updates the project so that the tsconfig file will be + * read from disk the next time that this.config is accessed + */ + public reloadFromDisk() { + this.config = readTsConfig(this.path); + } + + public overrideConfig(jsonc: string) { + try { + this.config = parseTsConfig(this.path, jsonc); + } catch (error) { + throw new Error(`unable to parse jsonc in order to override config: ${error.message}`); + } + } + + /** + * Gets the base config file for this tsconfig file. If the + * "extends" key is not defined this returns undefined + */ + public getBase(): Project | undefined { + if (!this.config.extends) { + return undefined; + } + + return this.getOther( + Path.resolve(this.directory, this.config.extends), + `extends: ${JSON.stringify(this.config.extends)}` + ); + } + + /** + * Get the kbnRefs for this project + */ + public getKbnRefs(pkgMap: PackageMap) { + if (!this.config.kbn_references) { + return []; + } + + if (!isValidKbnRefs(this.config.kbn_references)) { + throw new Error(`invalid kbn_references in ${this.name}`); + } + + return this.config.kbn_references.flatMap((ref) => { + if (typeof ref !== 'string') { + return ( + this.getOther( + Path.resolve(this.directory, ref.path), + `kbn_references: ${JSON.stringify(ref)}` + ) ?? [] + ); + } + + const pkgDir = pkgMap.get(ref); + if (!pkgDir) { + throw new Error(`invalid kbn_references in ${this.name}: ${ref} is not a known package`); + } + + return ( + this.getOther( + Path.resolve(pkgDir, 'tsconfig.json'), + `kbn_references: ${JSON.stringify(ref)}` + ) ?? [] + ); + }); + } + + private getOther(abs: string, from: string) { + const cached = this.others.get(abs); + if (cached) { + return cached; + } + + try { + const base = new Project(this.others, abs); + this.others.set(abs, base); + return base; + } catch (error) { + if (error.code === 'ENOENT') { + return undefined; + } + throw new Error(`Failed to load tsconfig file from ${from}: ${error.message}`); + } + } +} diff --git a/src/dev/typescript/projects.ts b/packages/kbn-ts-projects/projects.ts similarity index 95% rename from src/dev/typescript/projects.ts rename to packages/kbn-ts-projects/projects.ts index 7afb1e4649cb..3b791c12103b 100644 --- a/src/dev/typescript/projects.ts +++ b/packages/kbn-ts-projects/projects.ts @@ -8,7 +8,7 @@ import globby from 'globby'; import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { BAZEL_PACKAGE_DIRS } from '@kbn/bazel-packages'; import { Project, ProjectOptions } from './project'; @@ -19,9 +19,7 @@ import { Project, ProjectOptions } from './project'; export const PROJECT_CACHE = new Map(); const createProject = (rootRelativePath: string, options: ProjectOptions = {}) => - Project.load(Path.resolve(REPO_ROOT, rootRelativePath), options, { - cache: PROJECT_CACHE, - }); + new Project(PROJECT_CACHE, Path.resolve(REPO_ROOT, rootRelativePath), options); const findProjects = (patterns: string[]) => globby.sync(patterns, { cwd: REPO_ROOT }).map((path) => createProject(path)); @@ -31,7 +29,6 @@ export const PROJECTS = [ createProject('test/tsconfig.json', { name: 'kibana/test' }), createProject('x-pack/test/tsconfig.json', { name: 'x-pack/test' }), createProject('x-pack/performance/tsconfig.json', { name: 'x-pack/performance' }), - ...findProjects(['src/*/tsconfig.json']), createProject('.buildkite/tsconfig.json', { // this directory has additionally dependencies which scripts/type_check can't guarantee // are present or up-to-date, and users likely won't know how to manage either, so the @@ -91,6 +88,7 @@ export const PROJECTS = [ // Glob patterns to be all search at once ...findProjects([ + 'src/*/tsconfig.json', 'src/plugins/*/tsconfig.json', 'src/plugins/chart_expressions/*/tsconfig.json', 'src/plugins/vis_types/*/tsconfig.json', diff --git a/packages/kbn-ts-projects/ts_configfile.ts b/packages/kbn-ts-projects/ts_configfile.ts new file mode 100644 index 000000000000..c4cf8f5fe7dc --- /dev/null +++ b/packages/kbn-ts-projects/ts_configfile.ts @@ -0,0 +1,49 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Fs from 'fs'; + +import { parseConfigFileTextToJson } from 'typescript'; + +export interface TsConfig { + extends?: string; + compilerOptions?: { + types?: string[]; + [key: string]: unknown; + }; + include?: string[]; + exclude?: string[]; + kbn_references?: Array; + [key: string]: unknown; +} + +export function parseTsConfig(tsConfigPath: string, jsonc: string): TsConfig { + const { error, config } = parseConfigFileTextToJson(tsConfigPath, jsonc); + + if (error) { + throw new Error(`tsconfig parse error: [${error.file}] ${error.messageText}`); + } + + return config; +} + +export function readTsConfig(tsConfigPath: string): TsConfig { + try { + return parseTsConfig(tsConfigPath, Fs.readFileSync(tsConfigPath, 'utf8')); + } catch (error) { + if (error.code === 'ENOENT') { + const err = new Error( + `unable to read tsconfig file at ${tsConfigPath}. File does not exist.` + ); + Object.assign(err, { code: error.code }); + throw err; + } + + throw error; + } +} diff --git a/packages/kbn-ts-projects/tsconfig.json b/packages/kbn-ts-projects/tsconfig.json new file mode 100644 index 000000000000..7394e3b03ea7 --- /dev/null +++ b/packages/kbn-ts-projects/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/repo-info", + "@kbn/bazel-packages", + "@kbn/package-map", + ] +} diff --git a/packages/kbn-ts-type-check-cli/README.md b/packages/kbn-ts-type-check-cli/README.md new file mode 100644 index 000000000000..aed922084247 --- /dev/null +++ b/packages/kbn-ts-type-check-cli/README.md @@ -0,0 +1,3 @@ +# @kbn/ts-type-check-cli + +Empty package generated by @kbn/generate diff --git a/packages/kbn-ts-type-check-cli/jest.config.js b/packages/kbn-ts-type-check-cli/jest.config.js new file mode 100644 index 000000000000..a5a9aedfff02 --- /dev/null +++ b/packages/kbn-ts-type-check-cli/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-ts-type-check-cli'], +}; diff --git a/packages/kbn-ts-type-check-cli/kibana.jsonc b/packages/kbn-ts-type-check-cli/kibana.jsonc new file mode 100644 index 000000000000..dc98e123efb0 --- /dev/null +++ b/packages/kbn-ts-type-check-cli/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-common", + "id": "@kbn/ts-type-check-cli", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-ts-type-check-cli/package.json b/packages/kbn-ts-type-check-cli/package.json new file mode 100644 index 000000000000..64b7904e87db --- /dev/null +++ b/packages/kbn-ts-type-check-cli/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/ts-type-check-cli", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "main": "./run_type_check_cli" +} diff --git a/src/dev/typescript/root_refs_config.ts b/packages/kbn-ts-type-check-cli/root_refs_config.ts similarity index 83% rename from src/dev/typescript/root_refs_config.ts rename to packages/kbn-ts-type-check-cli/root_refs_config.ts index ebbc1574d85c..43d64e5d972f 100644 --- a/src/dev/typescript/root_refs_config.ts +++ b/packages/kbn-ts-type-check-cli/root_refs_config.ts @@ -10,13 +10,11 @@ import Path from 'path'; import Fsp from 'fs/promises'; import dedent from 'dedent'; -import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; -import { createFailError } from '@kbn/dev-cli-errors'; -import { BazelPackage } from '@kbn/bazel-packages'; import normalize from 'normalize-path'; - -import { PROJECTS } from './projects'; +import { ToolingLog } from '@kbn/tooling-log'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { PROJECTS } from '@kbn/ts-projects'; export const ROOT_REFS_CONFIG_PATH = Path.resolve(REPO_ROOT, 'tsconfig.refs.json'); export const REF_CONFIG_PATHS = [ROOT_REFS_CONFIG_PATH]; @@ -46,18 +44,15 @@ ${refs.map((p) => ` { "path": ${JSON.stringify(p)} },`).join('\n')} `; } -export async function updateRootRefsConfig(log: ToolingLog, bazelPackages: BazelPackage[]) { +export async function updateRootRefsConfig(log: ToolingLog) { if (await isRootRefsConfigSelfManaged()) { throw createFailError( `tsconfig.refs.json starts with "// SELF MANAGED" but we removed this functinality because of some complexity it caused with TS performance upgrades and we were pretty sure that nobody was using it. Please reach out to operations to discuss options <3` ); } - const bazelPackageDirs = new Set( - bazelPackages.map((p) => Path.resolve(REPO_ROOT, p.normalizedRepoRelativeDir)) - ); const refs = PROJECTS.flatMap((p) => { - if (p.disableTypeCheck || bazelPackageDirs.has(p.directory)) { + if (p.disableTypeCheck) { return []; } diff --git a/packages/kbn-ts-type-check-cli/run_type_check_cli.ts b/packages/kbn-ts-type-check-cli/run_type_check_cli.ts new file mode 100644 index 000000000000..20ea0845371b --- /dev/null +++ b/packages/kbn-ts-type-check-cli/run_type_check_cli.ts @@ -0,0 +1,177 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import Fsp from 'fs/promises'; + +import { run } from '@kbn/dev-cli-runner'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { asyncForEachWithLimit, asyncMapWithLimit } from '@kbn/std'; +import { SomeDevLog } from '@kbn/some-dev-log'; +import { readPackageMap } from '@kbn/package-map'; +import { Project, PROJECTS } from '@kbn/ts-projects'; + +import { + updateRootRefsConfig, + cleanupRootRefsConfig, + ROOT_REFS_CONFIG_PATH, +} from './root_refs_config'; + +const rel = (from: string, to: string) => { + const path = Path.relative(from, to); + return path.startsWith('.') ? path : `./${path}`; +}; + +async function createTypeCheckConfigs(log: SomeDevLog, projects: Project[]) { + const pkgMap = readPackageMap(); + const writes: Array<[path: string, content: string]> = []; + + // write tsconfig.type_check.json files for each project that is not the root + const queue = new Set(projects); + for (const project of queue) { + const config = project.config; + const base = project.getBase(); + if (base) { + queue.add(base); + } + + const typeCheckConfig = { + ...config, + extends: base ? rel(project.directory, base.typeCheckConfigPath) : undefined, + compilerOptions: { + ...config.compilerOptions, + composite: true, + rootDir: '.', + paths: project.repoRel === 'tsconfig.base.json' ? config.compilerOptions?.paths : undefined, + }, + kbn_references: undefined, + references: project.getKbnRefs(pkgMap).map((refd) => { + queue.add(refd); + + return { + path: rel(project.directory, refd.typeCheckConfigPath), + }; + }), + }; + + writes.push([project.typeCheckConfigPath, JSON.stringify(typeCheckConfig, null, 2)]); + } + + return new Set( + await asyncMapWithLimit(writes, 50, async ([path, content]) => { + try { + const existing = await Fsp.readFile(path, 'utf8'); + if (existing === content) { + return path; + } + } catch (err) { + if (err.code !== 'ENOENT') { + throw err; + } + } + + log.verbose('updating', path); + await Fsp.writeFile(path, content, 'utf8'); + return path; + }) + ); +} + +run( + async ({ log, flagsReader, procRunner }) => { + if (flagsReader.boolean('clean-cache')) { + await asyncForEachWithLimit(PROJECTS, 10, async (proj) => { + await Fsp.rm(Path.resolve(proj.directory, 'target/types'), { + force: true, + recursive: true, + }); + }); + log.warning('Deleted all typescript caches'); + } + + // if the tsconfig.refs.json file is not self-managed then make sure it has + // a reference to every composite project in the repo + await updateRootRefsConfig(log); + + const projectFilter = flagsReader.path('project'); + + const projects = PROJECTS.filter( + (p) => !p.disableTypeCheck && (!projectFilter || p.path === projectFilter) + ); + + const created = await createTypeCheckConfigs(log, projects); + + let pluginBuildResult; + try { + log.info( + `Building TypeScript projects to check types (For visible, though excessive, progress info you can pass --verbose)` + ); + + const relative = Path.relative( + REPO_ROOT, + projects.length === 1 ? projects[0].typeCheckConfigPath : ROOT_REFS_CONFIG_PATH + ); + + await procRunner.run('tsc', { + cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')), + args: [ + '-b', + relative, + '--pretty', + ...(flagsReader.boolean('verbose') ? ['--verbose'] : []), + ], + cwd: REPO_ROOT, + wait: true, + }); + + pluginBuildResult = { failed: false }; + } catch (error) { + pluginBuildResult = { failed: true }; + } + + // cleanup if requested + if (flagsReader.boolean('cleanup')) { + log.verbose('cleaning up'); + await cleanupRootRefsConfig(); + + await asyncForEachWithLimit(created, 40, async (path) => { + await Fsp.unlink(path); + }); + } + + if (pluginBuildResult.failed) { + throw createFailError('Unable to build TS project refs'); + } + }, + { + description: ` + Run the TypeScript compiler without emitting files so that it can check types during development. + + Examples: + # check types in all projects + node scripts/type_check + + # check types in a single project + node scripts/type_check --project packages/kbn-pm/tsconfig.json + `, + flags: { + string: ['project'], + boolean: ['clean-cache', 'cleanup'], + help: ` + --project [path] Path to a tsconfig.json file determines the project to check + --help Show this message + --clean-cache Delete any existing TypeScript caches before running type check + --cleanup Pass to avoid leaving temporary tsconfig files on disk. Leaving these + files in place makes subsequent executions faster because ts can + identify that none of the imports have changed (it uses creation/update + times) but cleaning them prevents leaving garbage around the repo. + `, + }, + } +); diff --git a/packages/kbn-ts-type-check-cli/tsconfig.json b/packages/kbn-ts-type-check-cli/tsconfig.json new file mode 100644 index 000000000000..bc51e37a4c1c --- /dev/null +++ b/packages/kbn-ts-type-check-cli/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/repo-info", + "@kbn/dev-cli-errors", + "@kbn/ts-projects", + "@kbn/dev-cli-runner", + "@kbn/std", + "@kbn/some-dev-log", + "@kbn/package-map", + ] +} diff --git a/packages/kbn-type-summarizer-cli/BUILD.bazel b/packages/kbn-type-summarizer-cli/BUILD.bazel deleted file mode 100644 index 441fa393e5e4..000000000000 --- a/packages/kbn-type-summarizer-cli/BUILD.bazel +++ /dev/null @@ -1,140 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "directory_file_path", "js_library", "nodejs_binary") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-type-summarizer-cli" -PKG_REQUIRE_NAME = "@kbn/type-summarizer-cli" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@babel/runtime", - "//packages/kbn-type-summarizer", - "//packages/kbn-type-summarizer-core", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "//packages/kbn-type-summarizer:npm_module_types", - "//packages/kbn-type-summarizer-core:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -directory_file_path( - name = "bazel-cli-path", - directory = ":target_node", - path = "index.js", -) - -nodejs_binary( - name = "bazel-cli", - data = [":" + PKG_DIRNAME], - entry_point = ":bazel-cli-path", - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-type-summarizer-cli/README.md b/packages/kbn-type-summarizer-cli/README.md deleted file mode 100644 index b35cfb615aae..000000000000 --- a/packages/kbn-type-summarizer-cli/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# @kbn/type-summarizer-cli - -Exposes the` @kbn/type-summarizer` via a command line interface. Run `node scripts/type_summarizer` for information about running this command. - -## Example: - -```sh -node scripts/type_summarizer packages/kbn-type-summarizer-cli -``` diff --git a/packages/kbn-type-summarizer-cli/index.ts b/packages/kbn-type-summarizer-cli/index.ts deleted file mode 100644 index 7b7bd535485a..000000000000 --- a/packages/kbn-type-summarizer-cli/index.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fsp from 'fs/promises'; - -import { Path } from '@kbn/type-summarizer-core'; -import { summarizePackage } from '@kbn/type-summarizer'; - -import { parseCliConfig } from './src/cli_config'; - -import { run } from './src/run'; - -const HELP = ` -Script called from bazel to create the summarized version of a package. When called by Bazel -config is passed as a JSON encoded object. To build config locally you can just pass a path to -a package directory. - -Usage: - - node scripts/type_summarizer -`; - -run( - async ({ argv, log }) => { - const { packageName, outputDir, inputPath, repoRelativePackageDir, tsconfigPath } = - parseCliConfig(argv); - - try { - await Fsp.rm(outputDir, { recursive: true }); - } catch (error) { - if (error && error.code !== 'ENOENT') { - throw error; - } - } - - await Fsp.mkdir(outputDir, { recursive: true }); - - // generate pkg json output - await Fsp.writeFile( - Path.join(outputDir, 'package.json'), - JSON.stringify( - { - name: `@types/${packageName.replaceAll('@', '').replaceAll('/', '__')}`, - description: 'Generated by @kbn/type-summarizer', - types: './index.d.ts', - private: true, - license: 'MIT', - version: '1.1.0', - }, - null, - 2 - ) - ); - - const sourceNode = await summarizePackage(log, { - dtsDir: Path.dirname(inputPath), - inputPath, - tsconfigPath, - repoRelativePackageDir, - }); - - const source = sourceNode.toStringWithSourceMap({ - file: 'index.d.ts', - sourceRoot: `../../../${Path.toNormal(repoRelativePackageDir)}`, - }); - - const code = `${source.code}${ - source.code.endsWith('\n') ? '' : '\n' - }//# sourceMappingURL=index.d.ts.map`; - - await Fsp.writeFile(Path.join(outputDir, 'index.d.ts'), code); - await Fsp.writeFile(Path.join(outputDir, 'index.d.ts.map'), JSON.stringify(source.map)); - - log.success('type summary created for', packageName); - }, - { - helpText: HELP, - defaultLogLevel: 'quiet', - } -); diff --git a/packages/kbn-type-summarizer-cli/kibana.jsonc b/packages/kbn-type-summarizer-cli/kibana.jsonc deleted file mode 100644 index 88434bc04812..000000000000 --- a/packages/kbn-type-summarizer-cli/kibana.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/type-summarizer-cli", - "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] -} diff --git a/packages/kbn-type-summarizer-cli/package.json b/packages/kbn-type-summarizer-cli/package.json deleted file mode 100644 index 2b013abe1570..000000000000 --- a/packages/kbn-type-summarizer-cli/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/type-summarizer-cli", - "private": true, - "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} diff --git a/packages/kbn-type-summarizer-cli/src/cli_config.ts b/packages/kbn-type-summarizer-cli/src/cli_config.ts deleted file mode 100644 index 50ca0e161536..000000000000 --- a/packages/kbn-type-summarizer-cli/src/cli_config.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs'; - -import { CliError, Path } from '@kbn/type-summarizer-core'; -import { parseCliFlags } from './cli_flags'; - -const isString = (i: any): i is string => typeof i === 'string' && i.length > 0; - -interface CliConfig { - packageName: string; - outputDir: string; - tsconfigPath: string; - inputPath: string; - repoRelativePackageDir: string; - dump: boolean; -} - -function isKibanaRepo(dir: string) { - try { - const json = Fs.readFileSync(Path.join(dir, 'package.json'), 'utf8'); - const parsed = JSON.parse(json); - return parsed.name === 'kibana'; - } catch { - return false; - } -} - -export function findRepoRoot() { - const start = Path.resolve(__dirname); - let dir = start; - while (true) { - if (isKibanaRepo(dir)) { - return dir; - } - - // this is not the kibana directory, try moving up a directory - const parent = Path.join(dir, '..'); - if (parent === dir) { - throw new Error( - `unable to find Kibana's package.json file when traversing up from [${start}]` - ); - } - - dir = parent; - } -} - -function parseConfigFromFlags(argv: string[]): CliConfig { - const { rawFlags, unknownFlags } = parseCliFlags(argv, { - boolean: ['dump'], - }); - - if (unknownFlags.length) { - throw new CliError(`Unknown flags: ${unknownFlags.join(', ')}`, { - showHelp: true, - }); - } - - const repoRoot = findRepoRoot(); - - const [relativePackagePath, ...extraPositional] = rawFlags._; - if (typeof relativePackagePath !== 'string') { - throw new CliError(`missing path to package as first positional argument`, { showHelp: true }); - } - if (extraPositional.length) { - throw new CliError(`extra positional arguments`, { showHelp: true }); - } - - const packageDir = Path.resolve(relativePackagePath); - const packageName: string = JSON.parse( - Fs.readFileSync(Path.join(packageDir, 'package.json'), 'utf8') - ).name; - const repoRelativePackageDir = Path.relative(repoRoot, packageDir); - - const dump = !!rawFlags.dump; - - return { - packageName, - tsconfigPath: Path.join(repoRoot, repoRelativePackageDir, 'tsconfig.json'), - inputPath: Path.join(repoRoot, 'node_modules', packageName, 'target_types/index.d.ts'), - repoRelativePackageDir, - outputDir: Path.join(repoRoot, 'data/type-summarizer-output'), - dump, - }; -} - -function parseJsonFromCli(json: string) { - try { - return JSON.parse(json); - } catch (error) { - // TODO: This is to handle a bug in Bazel which escapes `"` in .bat arguments incorrectly, replacing them with `\` - if ( - error.message === 'Unexpected token \\ in JSON at position 1' && - process.platform === 'win32' - ) { - const unescapedJson = json.replaceAll('\\', '"'); - try { - return JSON.parse(unescapedJson); - } catch (e) { - throw new CliError( - `unable to parse first positional argument as JSON: "${e.message}"\n unescaped value: ${unescapedJson}\n raw value: ${json}` - ); - } - } - - throw new CliError( - `unable to parse first positional argument as JSON: "${error.message}"\n value: ${json}` - ); - } -} - -function parseConfigFromJson(json: string): CliConfig { - const config = parseJsonFromCli(json); - if (typeof config !== 'object' || config === null) { - throw new CliError('config JSON must be an object'); - } - - const packageName = config.packageName; - if (!isString(packageName)) { - throw new CliError('packageName config must be a non-empty string'); - } - - const outputDir = config.outputDir; - if (!isString(outputDir)) { - throw new CliError('outputDir config must be a non-empty string'); - } - if (Path.isAbsolute(outputDir)) { - throw new CliError(`outputDir [${outputDir}] must be a relative path`); - } - - const tsconfigPath = config.tsconfigPath; - if (!isString(tsconfigPath)) { - throw new CliError('tsconfigPath config must be a non-empty string'); - } - if (Path.isAbsolute(tsconfigPath)) { - throw new CliError(`tsconfigPath [${tsconfigPath}] must be a relative path`); - } - - const inputPath = config.inputPath; - if (!isString(inputPath)) { - throw new CliError('inputPath config must be a non-empty string'); - } - if (Path.isAbsolute(inputPath)) { - throw new CliError(`inputPath [${inputPath}] must be a relative path`); - } - - const buildFilePath = config.buildFilePath; - if (!isString(buildFilePath)) { - throw new CliError('buildFilePath config must be a non-empty string'); - } - if (Path.isAbsolute(buildFilePath)) { - throw new CliError(`buildFilePath [${buildFilePath}] must be a relative path`); - } - - return { - packageName, - outputDir: Path.resolve(outputDir), - tsconfigPath: Path.resolve(tsconfigPath), - inputPath: Path.resolve(inputPath), - repoRelativePackageDir: Path.dirname(buildFilePath), - dump: false, - }; -} - -export function parseCliConfig(argv: string[]): CliConfig { - if (typeof argv[0] === 'string' && argv[0].startsWith('{')) { - return parseConfigFromJson(argv[0]); - } - return parseConfigFromFlags(argv); -} diff --git a/packages/kbn-type-summarizer-cli/src/cli_flags.ts b/packages/kbn-type-summarizer-cli/src/cli_flags.ts deleted file mode 100644 index 0f616dca873b..000000000000 --- a/packages/kbn-type-summarizer-cli/src/cli_flags.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import getopts from 'getopts'; - -interface ParseCliFlagsOptions { - alias?: Record; - boolean?: string[]; - string?: string[]; - default?: Record; -} - -export function parseCliFlags(argv = process.argv.slice(2), options: ParseCliFlagsOptions = {}) { - const unknownFlags: string[] = []; - - const string = options.string ?? []; - const boolean = ['help', 'verbose', 'debug', 'quiet', 'silent', ...(options.boolean ?? [])]; - const alias = { - v: 'verbose', - d: 'debug', - h: 'help', - ...options.alias, - }; - - const rawFlags = getopts(argv, { - alias, - boolean, - string, - default: options.default, - unknown(name) { - unknownFlags.push(name); - return false; - }, - }); - - return { - rawFlags, - unknownFlags, - }; -} diff --git a/packages/kbn-type-summarizer-cli/src/run.ts b/packages/kbn-type-summarizer-cli/src/run.ts deleted file mode 100644 index dfba870b359b..000000000000 --- a/packages/kbn-type-summarizer-cli/src/run.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import getopts from 'getopts'; - -import { CliLog, CliError, LogLevel, toError } from '@kbn/type-summarizer-core'; - -export interface RunContext { - argv: string[]; - log: CliLog; -} - -export interface RunOptions { - helpText: string; - defaultLogLevel?: LogLevel; -} - -export async function run(main: (ctx: RunContext) => Promise, options: RunOptions) { - const argv = process.argv.slice(2); - const rawFlags = getopts(argv); - - if (rawFlags.help) { - process.stdout.write(options.helpText); - process.exit(0); - } - - const log = new CliLog( - CliLog.pickLogLevelFromFlags(rawFlags, options.defaultLogLevel), - process.stdout - ); - - try { - await main({ argv, log }); - } catch (_) { - const error = toError(_); - if (error instanceof CliError) { - process.exitCode = error.exitCode; - log.error(error.message); - if (error.showHelp) { - process.stdout.write(options.helpText); - } - } else { - log.error('UNHANDLED ERROR', error.stack); - process.exitCode = 1; - } - } -} diff --git a/packages/kbn-type-summarizer-cli/tsconfig.json b/packages/kbn-type-summarizer-cli/tsconfig.json deleted file mode 100644 index 57c1dd1c94e0..000000000000 --- a/packages/kbn-type-summarizer-cli/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.bazel.json", - "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/packages/kbn-type-summarizer-core/BUILD.bazel b/packages/kbn-type-summarizer-core/BUILD.bazel deleted file mode 100644 index b63a38b44d08..000000000000 --- a/packages/kbn-type-summarizer-core/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-type-summarizer-core" -PKG_REQUIRE_NAME = "@kbn/type-summarizer-core" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//getopts", - "@npm//chalk", - "@npm//normalize-path", - "@npm//strip-ansi", - "@npm//tslib", - "@npm//typescript", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/normalize-path", - "@npm//chalk", - "@npm//getopts", - "@npm//tslib", - "@npm//strip-ansi", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-type-summarizer-core/README.md b/packages/kbn-type-summarizer-core/README.md deleted file mode 100644 index b9e10dadd8d6..000000000000 --- a/packages/kbn-type-summarizer-core/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @kbn/type-summarizer-core - -Contains the common code needed for both `@kbn/type-summarizer` and `@kbn/type-summarizer-cli` \ No newline at end of file diff --git a/packages/kbn-type-summarizer-core/index.ts b/packages/kbn-type-summarizer-core/index.ts deleted file mode 100644 index 2785bb096372..000000000000 --- a/packages/kbn-type-summarizer-core/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export type { LogLevel } from './src/log'; -export type { LogWriter, Logger } from './src/log'; -export { CliLog, TestLog } from './src/log'; - -export { isSystemError, toError } from './src/error'; -export { tryReadFile } from './src/fs'; -export { parseJson } from './src/json'; -export type { CliErrorOptions } from './src/cli_error'; -export { CliError } from './src/cli_error'; -export { - describeNode, - describeSymbol, - getKindName, - hasIdentifierName, - isAliasSymbol, -} from './src/ts_helpers'; -import * as Path from './src/path'; -export { Path }; -export { SetMap } from './src/set_map'; diff --git a/packages/kbn-type-summarizer-core/kibana.jsonc b/packages/kbn-type-summarizer-core/kibana.jsonc deleted file mode 100644 index 322a6c152b2f..000000000000 --- a/packages/kbn-type-summarizer-core/kibana.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/type-summarizer-core", - "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] -} diff --git a/packages/kbn-type-summarizer-core/package.json b/packages/kbn-type-summarizer-core/package.json deleted file mode 100644 index cae83a800eb3..000000000000 --- a/packages/kbn-type-summarizer-core/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/type-summarizer-core", - "private": true, - "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} diff --git a/packages/kbn-type-summarizer-core/src/cli_error.ts b/packages/kbn-type-summarizer-core/src/cli_error.ts deleted file mode 100644 index c15e5478ea34..000000000000 --- a/packages/kbn-type-summarizer-core/src/cli_error.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * Options for customizing CliError instances - */ -export interface CliErrorOptions { - exitCode?: number; - showHelp?: boolean; -} - -/** - * An error type with specicial behavior when it bubbles up all the way to the root of the CLI - */ -export class CliError extends Error { - public readonly exitCode: number; - public readonly showHelp: boolean; - - constructor(message: string, options: CliErrorOptions = {}) { - super(message); - - this.exitCode = options.exitCode ?? 1; - this.showHelp = options.showHelp ?? false; - } -} diff --git a/packages/kbn-type-summarizer-core/src/error.ts b/packages/kbn-type-summarizer-core/src/error.ts deleted file mode 100644 index 080fa8990ec4..000000000000 --- a/packages/kbn-type-summarizer-core/src/error.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * Convert an unknown thrown value to an Error instance if it isn't alread - */ -export function toError(thrown: unknown) { - if (thrown instanceof Error) { - return thrown; - } - - return new Error(`${thrown} thrown`); -} - -/** - * Is this error instance a Node.js system error which has an error code attached? - */ -export function isSystemError(error: Error): error is NodeJS.ErrnoException { - return typeof (error as any).code === 'string'; -} diff --git a/packages/kbn-type-summarizer-core/src/fs.ts b/packages/kbn-type-summarizer-core/src/fs.ts deleted file mode 100644 index eafe789c9d05..000000000000 --- a/packages/kbn-type-summarizer-core/src/fs.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fsp from 'fs/promises'; -import { toError, isSystemError } from './error'; - -/** - * Read a file, if the file doesn't exist return undefined. If any other - * error occurs they will be thrown. - */ -export async function tryReadFile( - path: string, - encoding: 'utf-8' | 'utf8' -): Promise; -/** - * Read a file, if the file doesn't exist return undefined. If any other - * error occurs they will be thrown. - */ -export async function tryReadFile(path: string, encoding?: BufferEncoding) { - try { - return await Fsp.readFile(path, encoding); - } catch (_) { - const error = toError(_); - if (isSystemError(error) && error.code === 'ENOENT') { - return undefined; - } - throw error; - } -} diff --git a/packages/kbn-type-summarizer-core/src/json.test.ts b/packages/kbn-type-summarizer-core/src/json.test.ts deleted file mode 100644 index 4bb86652221d..000000000000 --- a/packages/kbn-type-summarizer-core/src/json.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { parseJson } from './json'; - -it('parses JSON', () => { - expect(parseJson('{"foo": "bar"}')).toMatchInlineSnapshot(` - Object { - "foo": "bar", - } - `); -}); - -it('throws more helpful errors', () => { - expect(() => parseJson('{"foo": bar}')).toThrowErrorMatchingInlineSnapshot( - `"Failed to parse JSON: Unexpected token b in JSON at position 8"` - ); -}); diff --git a/packages/kbn-type-summarizer-core/src/json.ts b/packages/kbn-type-summarizer-core/src/json.ts deleted file mode 100644 index dbabff5cbadd..000000000000 --- a/packages/kbn-type-summarizer-core/src/json.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { toError } from './error'; - -/** - * Parse JSON, but thrown a more meaningful error message when parsing fails - */ -export function parseJson(json: string, from?: string) { - try { - return JSON.parse(json); - } catch (_) { - const error = toError(_); - throw new Error(`Failed to parse JSON${from ? ` from ${from}` : ''}: ${error.message}`); - } -} diff --git a/packages/kbn-type-summarizer-core/src/log/cli_log.ts b/packages/kbn-type-summarizer-core/src/log/cli_log.ts deleted file mode 100644 index 35195dc1d213..000000000000 --- a/packages/kbn-type-summarizer-core/src/log/cli_log.ts +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Util from 'util'; - -import { bold, dim, blueBright, yellowBright, gray, bgRed } from 'chalk'; -import getopts from 'getopts'; -import ts from 'typescript'; -import stripAnsi from 'strip-ansi'; - -import { Logger } from './logger'; -import { describeNode, describeSymbol } from '../ts_helpers'; - -const LOG_LEVEL_RANKS = { - silent: 0, - quiet: 1, - info: 2, - debug: 3, - verbose: 4, -}; - -/** - * Level that the logger is running at, any message logged "above" this level will be dropped - */ -export type LogLevel = keyof typeof LOG_LEVEL_RANKS; - -const LOG_LEVELS = (Object.keys(LOG_LEVEL_RANKS) as LogLevel[]).sort( - (a, b) => LOG_LEVEL_RANKS[a] - LOG_LEVEL_RANKS[b] -); -const LOG_LEVELS_DESC = LOG_LEVELS.slice().reverse(); - -type LogLevelMap = { [k in LogLevel]: boolean }; - -const now = - typeof performance !== 'undefined' ? performance.now.bind(performance) : Date.now.bind(Date); - -const fmt = (prefix: string, msg: string, ...args: string[]) => { - const lines = Util.format(msg, ...args).split('\n'); - - let formatted = lines[0]; - if (lines.length > 1) { - const padding = ' '.repeat(stripAnsi(prefix).length + 1); - for (const line of lines.slice(1)) { - formatted += `\n${padding}${line}`; - } - } - - return `${prefix} ${formatted}\n`; -}; - -const fmtMs = (ms: number) => { - if (ms < 1) { - return dim(`${Math.floor(ms * 100)}µs`); - } - - if (ms <= 5) { - return dim(`${Math.round(ms)}ms`); - } - - if (ms <= 500) { - return `${Math.round(ms)}ms`; - } - - return bold.yellow(`${(ms / 1000).toFixed(2)}s`); -}; - -const fmtDesc = (desc: string | ts.Symbol | ts.Node) => { - if (typeof desc === 'string') { - return Path.isAbsolute(desc) ? Path.relative(process.cwd(), desc) : desc; - } - - return 'kind' in desc ? describeNode(desc) : describeSymbol(desc); -}; - -/** - * Interface of objects which receive log messages, often times points to stdout, but - * replaced with a log message collector in tests - */ -export interface LogWriter { - write(chunk: string): void; -} - -interface Step { - verboseSteps: Map; -} - -/** - * Logger which writes messages in a text format designed for CLIs - */ -export class CliLog implements Logger { - private indent = ''; - private readonly stepStack: Step[] = []; - - static parseLogLevel(level: LogLevel) { - if (!LOG_LEVELS.includes(level)) { - throw new Error('invalid log level'); - } - - const rank = LOG_LEVEL_RANKS[level]; - return Object.fromEntries( - LOG_LEVELS.map((l) => [l, LOG_LEVEL_RANKS[l] <= rank]) - ) as LogLevelMap; - } - - static pickLogLevelFromFlags( - flags: getopts.ParsedOptions, - defaultLogLevl: LogLevel = 'info' - ): LogLevel { - for (const level of LOG_LEVELS_DESC) { - if (Object.prototype.hasOwnProperty.call(flags, level) && flags[level] === true) { - return level; - } - } - - return defaultLogLevl; - } - - private readonly map: LogLevelMap; - constructor( - public readonly level: LogLevel, - private readonly writeTo: LogWriter, - private readonly writeTimes = true - ) { - this.map = CliLog.parseLogLevel(level); - } - - info(msg: string, ...args: any[]) { - if (this.map.info) { - this.writeTo.write(fmt(`${this.indent}${blueBright('info')}`, msg, ...args)); - } - } - - warn(msg: string, ...args: any[]) { - if (this.map.quiet) { - this.writeTo.write(fmt(`${this.indent}${yellowBright('warn')}`, msg, ...args)); - } - } - - error(msg: string, ...args: any[]) { - if (this.map.quiet) { - this.writeTo.write(fmt(`${this.indent}${bgRed.whiteBright('ERROR')}`, msg, ...args)); - } - } - - debug(msg: string, ...args: any[]) { - if (this.map.debug) { - this.writeTo.write(fmt(`${this.indent}${gray('debg')}`, msg, ...args)); - } - } - - verbose(msg: string, ...args: any[]) { - if (this.map.verbose) { - this.writeTo.write(fmt(`${this.indent}${dim('verb')}`, msg, ...args)); - } - } - - success(msg: string, ...args: any[]): void { - if (this.map.quiet) { - this.writeTo.write(fmt(`${this.indent}✅`, msg, ...args)); - } - } - - step(name: string, desc: ts.Symbol | ts.Node | string | null, block: () => T): T { - return this.stepImpl('debug', name, desc, block); - } - - verboseStep(name: string, desc: string | ts.Symbol | ts.Node | null, block: () => T): T { - if (!this.map.debug) { - return block(); - } - - if (!this.stepStack.length || this.map.verbose) { - return this.stepImpl('verbose', name, desc, block); - } - - const step = this.stepStack[0]; - const start = now(); - try { - return block(); - } finally { - const ms = now() - start; - const group = step.verboseSteps.get(name); - if (group) { - group.count += 1; - group.ms += ms; - } else { - step.verboseSteps.set(name, { - count: 1, - ms, - }); - } - } - } - - private stepImpl( - level: 'debug' | 'verbose', - name: string, - desc: string | ts.Symbol | ts.Node | null, - block: () => T - ): T { - if (!this.map[level]) { - return block(); - } - - if (desc !== null) { - this[level]('>', bold(name), dim(`-- ${fmtDesc(desc)}`)); - } else { - this[level]('>', bold(name)); - } - - const start = now(); - let success = true; - const prevIndent = this.indent; - this.indent = ' '.repeat(prevIndent.length + 4); - - const verboseSteps = new Map(); - this.stepStack.unshift({ verboseSteps }); - - try { - return block(); - } catch (error) { - success = false; - throw error; - } finally { - const ms = now() - start; - - this.stepStack.shift(); - if (verboseSteps.size) { - const summary = []; - for (const [step, { count, ms: m }] of verboseSteps) { - summary.push(`${step}x${count}${this.writeTimes ? `: ${fmtMs(m)}` : ''}`); - } - this[level](dim(`verbose steps:\n${summary.join('\n')}`)); - } - - if (this.writeTimes) { - this[level](success ? fmtMs(ms) : `‼️ ${fmtMs(ms)}`); - } - - this.indent = prevIndent; - } - } -} diff --git a/packages/kbn-type-summarizer-core/src/log/index.ts b/packages/kbn-type-summarizer-core/src/log/index.ts deleted file mode 100644 index fac2d627cc59..000000000000 --- a/packages/kbn-type-summarizer-core/src/log/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export type { Logger } from './logger'; -export type { LogWriter, LogLevel } from './cli_log'; -export { CliLog } from './cli_log'; -export { TestLog } from './test_log'; diff --git a/packages/kbn-type-summarizer-core/src/log/logger.ts b/packages/kbn-type-summarizer-core/src/log/logger.ts deleted file mode 100644 index 300b51c173c7..000000000000 --- a/packages/kbn-type-summarizer-core/src/log/logger.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -/** - * Logger interface used by @kbn/type-summarizer-* packages - */ -export interface Logger { - /** - * Write a message to the log with the level "info" - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - info(msg: string, ...args: any[]): void; - /** - * Write a message to the log with the level "warn" - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - warn(msg: string, ...args: any[]): void; - /** - * Write a message to the log with the level "error" - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - error(msg: string, ...args: any[]): void; - /** - * Write a message to the log with the level "debug" - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - debug(msg: string, ...args: any[]): void; - /** - * Write a message to the log with the level "verbose" - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - verbose(msg: string, ...args: any[]): void; - /** - * Write a message to the log, only excluded in silent mode - * @param msg any message - * @param args any serializeable values you would like to be appended to the log message - */ - success(msg: string, ...args: any[]): void; - /** - * Write a message to the log indicating the beginning of a step, then run the passed - * block, any log output produced inside that step will be indented and at the end the - * duration of the step will be written. If the log level is below verbose then any - * "verbose steps" executed inside this step will be summaried by this step at the end - * as well. - * @param name a common name for steps of a specific type - * @param desc a specific name to describe the unique information about this step - * @param block the function body which defines this step - */ - step(name: string, desc: ts.Symbol | ts.Node | string | null, block: () => T): T; - /** - * Just like step(), except that unless the logging level is set to verbose the steps with - * the same name will be summaried at the end of the containing step, rather than logged - * directly. - * @param name a common name for steps of a specific type - * @param desc a specific name to describe the unique information about this step - * @param block the function body which defines this step - */ - verboseStep(name: string, desc: ts.Symbol | ts.Node | string | null, block: () => T): T; -} diff --git a/packages/kbn-type-summarizer-core/src/path.ts b/packages/kbn-type-summarizer-core/src/path.ts deleted file mode 100644 index 117a6f62e78c..000000000000 --- a/packages/kbn-type-summarizer-core/src/path.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import normalizePath from 'normalize-path'; -const cwd = normalizePath(process.cwd()); - -/** - * Convert a path to a relative path based on the current working directory. - * All paths returned are normalized - */ -export function cwdRelative(path: string) { - return relative(cwd, path); -} - -/** - * Convert a path to a relative path. All paths returned are normalized - */ -export function relative(from: string, to: string) { - return toNormal(Path.relative(from, to)); -} - -/** - * Join segments into a single path. All paths returned are normalized - */ -export function join(...segments: string[]) { - return Path.join(...segments); -} - -/** - * Get all but the last segment of a path, often times the directory containing the path. All paths returned are normalized - */ -export function dirname(path: string) { - return Path.dirname(path); -} - -/** - * Convert a relative path to an absolute path based on the current working directory. All paths returned are normalized. - */ -export function resolve(path: string) { - return Path.isAbsolute(path) ? toNormal(path) : join(cwd, path); -} - -/** - * Returns true if the path is absolute, otherwise false - */ -export function isAbsolute(path: string) { - return Path.isAbsolute(path); -} - -/** - * Normalizes the passed path, ensuring that all path separators are unix-style `/` - */ -export function toNormal(path: string) { - return normalizePath(path); -} diff --git a/packages/kbn-type-summarizer-core/src/set_map.ts b/packages/kbn-type-summarizer-core/src/set_map.ts deleted file mode 100644 index 7ee4a2dd116a..000000000000 --- a/packages/kbn-type-summarizer-core/src/set_map.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * A class for collecting items (V) based on some key (K) - */ -export class SetMap { - private sets = new Map>(); - - /** - * Is there a group for the `key`? - */ - has(key: K) { - return this.sets.has(key); - } - - /** - * Add a value to the group with `key`, if the group doesn't exist - * yet it is created. - */ - add(key: K, value: V) { - const set = this.sets.get(key); - if (set) { - set.add(value); - } else { - this.sets.set(key, new Set([value])); - } - } - - /** - * Get the group for the `key`, if the group doesn't exist then - * `undefined` is returned. - */ - get(key: K): Set | undefined { - return this.sets.get(key); - } - - /** - * Returns an iterator for the [K, V] entries stored in the SetMap - */ - values() { - return this.sets.values(); - } -} diff --git a/packages/kbn-type-summarizer-core/src/ts_helpers.ts b/packages/kbn-type-summarizer-core/src/ts_helpers.ts deleted file mode 100644 index 1397b5acb622..000000000000 --- a/packages/kbn-type-summarizer-core/src/ts_helpers.ts +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; -import Path from 'path'; -import { SetMap } from './set_map'; - -/** - * Does this AST node have a name which is an identifier? - */ -export function hasIdentifierName(node: any): node is { name: ts.Identifier } { - return typeof node === 'object' && node !== null && node.name && ts.isIdentifier(node.name); -} - -/** - * Is this symbol pointing to another symbol? - */ -export function isAliasSymbol(symbol: ts.Symbol) { - // eslint-disable-next-line no-bitwise - return Boolean(symbol.flags & ts.SymbolFlags.Alias); -} - -/** - * Get a human readable string describing a symbol, requires that symbols have a declaration - * which will be passed to describeNode() - */ -export function describeSymbol(symbol: ts.Symbol, cwd?: string) { - if (!symbol.declarations) { - return 'undeclared symbol'; - } - - return `Symbol(${describeNode(symbol.declarations[0], cwd)})`; -} - -function describeNodeLocation(node: ts.Node, cwd = process.cwd()) { - const sourceFile = node.getSourceFile(); - const loc = sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile, false)); - return `${Path.relative(cwd, sourceFile.fileName)}:${loc.line + 1}:${loc.character + 1}`; -} - -let syntaxMap: SetMap | undefined; -function getSyntaxMap() { - if (syntaxMap) { - return syntaxMap; - } - - syntaxMap = new SetMap(); - for (const [key, value] of Object.entries(ts.SyntaxKind)) { - if (typeof value === 'number') { - syntaxMap.add(value, key); - } - } - - return syntaxMap; -} - -/** - * Get a human readable name of the syntax "kind". TS nodes use enums for their "kind" field - * which makes it tricky to know what you're looking at, and the `ts.SyntaxKind` map is lossy - * because many enum members have the same numeric value. To get around this we convert the - * ts.SyntaxKind map into a `SetMap` which puts all the syntax kind names for a given number - * into a set and allows us to report all possible type names from `getKindName()` - */ -export function getKindName(node: ts.Node) { - const names = [...(getSyntaxMap().get(node.kind) ?? [])]; - - if (names.length === 1) { - return names[0]; - } else if (names.length > 1) { - const ors = names.slice(-1); - const last = names.at(-1); - return `${ors.join(', ')} or ${last}`; - } - - return 'unknown'; -} - -/** - * Turn a Node instance into a string which describes the type, name, filename, and position of the node - */ -export function describeNode(node: ts.Node, cwd?: string) { - const name = hasIdentifierName(node) - ? ` (${node.name.text})` - : ts.isIdentifier(node) - ? ` (${node.text})` - : ''; - - return `ts.${getKindName(node)}${name} @ ${describeNodeLocation(node, cwd)}`; -} diff --git a/packages/kbn-type-summarizer-core/tsconfig.json b/packages/kbn-type-summarizer-core/tsconfig.json deleted file mode 100644 index 57c1dd1c94e0..000000000000 --- a/packages/kbn-type-summarizer-core/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.bazel.json", - "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/packages/kbn-type-summarizer/BUILD.bazel b/packages/kbn-type-summarizer/BUILD.bazel deleted file mode 100644 index b1f73bec487e..000000000000 --- a/packages/kbn-type-summarizer/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-type-summarizer" -PKG_REQUIRE_NAME = "@kbn/type-summarizer" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "src/tests/**/*", - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//is-path-inside", - "@npm//normalize-path", - "@npm//source-map", - "@npm//strip-ansi", - "@npm//tslib", - "//packages/kbn-type-summarizer-core", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "@npm//is-path-inside", - "@npm//@types/normalize-path", - "@npm//source-map", - "@npm//strip-ansi", - "@npm//tslib", - "//packages/kbn-type-summarizer-core:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-type-summarizer/README.mdx b/packages/kbn-type-summarizer/README.mdx deleted file mode 100644 index b9a2578eb675..000000000000 --- a/packages/kbn-type-summarizer/README.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: kibDevDocsOpsTypeSummarizer -slug: /kibana-dev-docs/ops/type-summarizer -title: "@kbn/type-summarizer" -description: A tool to summarize and produce a single .d.ts file from tsc output supporting sourcemaps -date: 2022-05-17 -tags: ['kibana', 'dev', 'contributor', 'operations', 'type', 'summarizer', 'typescript', 'bundler', 'sourcemap'] ---- - -Consumes the .d.ts files produced by `tsc` for a package and generates a single `.d.ts` file of the public types along with a source map that points back to the original source. - -## You mean like API Extractor? - -Yeah, except with source map support and without all the legacy features and other features we disable to generate our current type summaries. - -We first attempted to implement this in api-extractor but we hit a wall when dealing with the `Span` class. This class handles all the text output which ends up becoming source code, and I wasn't able to find a way to associate specific spans with source locations without getting 12 headaches. Instead I decided to try implementing this from scratch, reducing our reliance on the api-extractor project and putting us in control of how we generate type summaries. - -## Using the Type Summarizer - -The type-summarizer CLI from `@kbn/type-summarizer-cli` is automatically called by bazel via the `pkg_npm_types()` rule. If you want to run the CLI manually use `node scripts/type_summarizer ` and the type summary for your package will be written to `data/type_summarizer_output`. - -## How does it work? - -The type summarizer code is fairly well documented. The high level approach is to use two phases: - -### 1. Indexing -In this phase we traverse the symbol and AST graphs to determine the imports, local declarations, and ambient references needed to recreate the exported symbols of a package (along with all their references). This is done by the `AstIndexer` class and more information about the process is available there. - -### 2. Printing -After indexing is complete we use the created index to produce the necessary source code for the type summary file. This process is completed by the `printTypeSummary()` function in `src/lib/type_summary`, which uses the `SourceNode` class from the [source-map package](https://github.com/mozilla/source-map) to create the code and source maps of the type symmary file at the same time. - -The logic of this function is documented and should be relatively easy to follow once the structure of the `AstIndex` type is understood. \ No newline at end of file diff --git a/packages/kbn-type-summarizer/index.ts b/packages/kbn-type-summarizer/index.ts deleted file mode 100644 index a04a27ec1ece..000000000000 --- a/packages/kbn-type-summarizer/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export type { SummarizePacakgeOptions } from './src/summarize_package'; -export { summarizePackage } from './src/summarize_package'; diff --git a/packages/kbn-type-summarizer/kibana.jsonc b/packages/kbn-type-summarizer/kibana.jsonc deleted file mode 100644 index e4eb9dc7c603..000000000000 --- a/packages/kbn-type-summarizer/kibana.jsonc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/type-summarizer", - "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] -} diff --git a/packages/kbn-type-summarizer/package.json b/packages/kbn-type-summarizer/package.json deleted file mode 100644 index 4442ef893a93..000000000000 --- a/packages/kbn-type-summarizer/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/type-summarizer", - "private": true, - "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} diff --git a/packages/kbn-type-summarizer/src/lib/ast_index.ts b/packages/kbn-type-summarizer/src/lib/ast_index.ts deleted file mode 100644 index 27269a91b3fb..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ast_index.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { DecSymbol, ExportableDec } from './ts_nodes'; -import { ExportDetails } from './export_details'; -import { ImportDetails } from './import_details'; - -/** - * The AstIndex is produced by AstIndexer to represent all of the declarations/imports/refs that - * need to be used to produce the type summary. - */ -export interface AstIndex { - imports: ImportedDecs[]; - locals: LocalDecs[]; - ambientRefs: AmbientRef[]; -} - -/** - * ImportedDecs represent the declarations of a "root symbol" which is found in - * node_modules AND in imported in the source code. These will result in `import` - * and `export` statements in the type summary, based on if they are used locally - * or just re-exported. - */ -export interface ImportedDecs { - type: 'imported decs'; - - /** - * The root symbol which is imported from node_modules and used locally or exported - * by the indexed sourceFile - */ - readonly rootSymbol: DecSymbol; - - /** - * The ImportDetails describing if this is a named import, what name we are importing, - * etc. - */ - readonly details: ImportDetails; - - /** - * The count of local references to this rootSymbol, if this count is 0 and we are - * working with a default or named import, then we can simply re-export this imported - * symbol. - */ - readonly localUsageCount: number; - - /** - * An imported symbol can be exported more than once, so we support an array of export - * details here and ensure that each of these exports are recreated in the type summary - */ - exports: ExportDetails[]; -} - -/** - * AmbientRef objects describe references to root symbols which were never imported - * but are in the node_modules directory. These symbols might be placed there via - * `lib` or `types` configs in the ts project, but it doesn't really matter to us, - * we just need to know that this name is "reserved" and none of our declarations - * can re-use or override this name with different meaning. - */ -export interface AmbientRef { - type: 'ambient ref'; - - /** - * The root symbol which is referenced - */ - readonly rootSymbol: DecSymbol; - - /** - * The name that this root symbol is referenced by, which should be reserved - * for this ambient type in the type summary file. - */ - readonly name: string; -} - -/** - * LocalDecs represent the different rootSymbols which will be declared locally in - * the type summary. They are either declarations copied from the .d.ts files, or - * namespaces which are synthesized to represent imported namespaces. - */ -export type LocalDecs = CopiedDecs | NamespaceDec; - -/** - * A NamespaceDec represents a synthetic namepace which needs to be created in the - * type summary to power a namespace import in the source types. - */ -export interface NamespaceDec { - type: 'namespace dec'; - - /** - * The root symbol that points to the source file we will synthesize with this namespace - */ - readonly rootSymbol: DecSymbol; - - /** - * The sourceFile node which we will synthesize with this namespace, extracted - * from rootSymbol.declarations[0] for ease of access and so we can validate - * the shape of the symbol once. - */ - readonly sourceFile: ts.SourceFile; - - /** - * The members that the eventual namespace will need to have, and the rootSymbols that - * each member will reference/export from the namespace - */ - readonly members: Map; - - /** - * If this namespace is exported then this will be set to ExportDetails. We don't - * know if it is exported until all references to this specific rootSymbol are - * traversed, so `exported` can't be read only and is only defined at the end of indexing. - */ - exported: ExportDetails | undefined; -} - -/** - * CopiedDecs objects represent declarations for a "root symbol" which need to be - * copied into the resulting "type sumary" from the .d.ts files. - */ -export interface CopiedDecs { - type: 'copied decs'; - - /** - * The root symbol which is declared by the `decs` - */ - readonly rootSymbol: DecSymbol; - - /** - * The AST nodes which declare this root symbol - */ - readonly decs: ExportableDec[]; - - /** - * If these declarations are exported then this will be set to ExportDetails. We don't - * know if these decs are exported until all references to this specific rootSymbol are - * traversed, so `exported` can't be read only and is only defined at the end of indexing. - */ - exported: ExportDetails | undefined; -} diff --git a/packages/kbn-type-summarizer/src/lib/ast_indexer.ts b/packages/kbn-type-summarizer/src/lib/ast_indexer.ts deleted file mode 100644 index ed27381454d7..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ast_indexer.ts +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { Logger, isAliasSymbol, describeSymbol, SetMap } from '@kbn/type-summarizer-core'; - -import { - AstIndex, - AmbientRef, - CopiedDecs, - ImportedDecs, - LocalDecs, - NamespaceDec, -} from './ast_index'; - -import { - toExportableDec, - assertDecSymbol, - DecSymbol, - toDecSymbol, - getSymbolDeclarations, -} from './ts_nodes'; -import { CounterMap } from './counter_map'; -import { SourceFileMapper } from './source_file_mapper'; -import { SymbolResolver } from './symbol_resolver'; -import { AstTraverser } from './ast_traverser'; -import { ImportDetails, getImportDetails } from './import_details'; -import { ExportDetails, getExportDetails } from './export_details'; - -/** - * The `AstIndexer` is responsible for collecting all the relevant information about the exports of - * a sourceFile from it's AST representation. - * - * The #indexExports method is the primary/only interface to use the AstIndexer and where the - * most useful documentation can be found. - */ -export class AstIndexer { - constructor( - private readonly typeChecker: ts.TypeChecker, - private readonly sources: SourceFileMapper, - private readonly symbols: SymbolResolver, - private readonly traverse: AstTraverser, - private readonly log: Logger - ) {} - - private getCopiedDecs(rootSymbol: DecSymbol): CopiedDecs | null { - const decs = rootSymbol.declarations.flatMap((dec) => { - // filter out declarations which are of no interest, traversing back to a type parameter or a - // function parameter, for instance, means this a symbol which is not of interest for this - // project so we ignore them - if (ts.isTypeParameterDeclaration(dec) || ts.isParameter(dec)) { - return []; - } - - if (this.sources.isExternal(dec)) { - return []; - } - - return toExportableDec(dec); - }); - - if (decs.length) { - return { - type: 'copied decs', - decs, - rootSymbol, - exported: undefined, - }; - } - - return null; - } - - private resolveExternalRootSymbol( - externalRootSymbol: DecSymbol, - aliases: ts.Symbol[], - exports: ExportDetails[] | undefined, - localUsageCount: number - ): ImportedDecs[] | AmbientRef { - const imports = aliases.flatMap((alias) => { - // traverse from the use to the symbol, stopping at the first import statement that points into the node_modules directory - let cursor = toDecSymbol(alias); - while (isAliasSymbol(cursor)) { - const next = this.typeChecker.getImmediateAliasedSymbol(cursor); - if (!next) { - break; - } - - // if any of the declarations of the next node are external then we have reched the stepping point that - // takes us from our local code to the node_modules. We won't traverse any more after we collect the - // import details of the declarations of cursoor - const nextIsExternal = getSymbolDeclarations(next).some((d) => this.sources.isExternal(d)); - - if (nextIsExternal) { - return cursor.declarations.flatMap((d) => getImportDetails(d) ?? []); - } - - cursor = toDecSymbol(next); - } - - return []; - }); - - if (!imports.length) { - return { - type: 'ambient ref', - rootSymbol: externalRootSymbol, - name: aliases[0].getName(), - }; - } - - const mergedImports: ImportDetails[] = []; - for (const id of imports) { - const existing = mergedImports.find( - (d) => - d.req === id.req && - d.type === id.type && - (d.type === 'named' && id.type === 'named' ? d.sourceName === id.sourceName : true) - ); - - if (existing) { - existing.typesOnly = existing.typesOnly && id.typesOnly; - } else { - mergedImports.push(id); - } - } - - if (mergedImports.length === 0) { - return []; - } - - return mergedImports.map( - (id): ImportedDecs => ({ - type: 'imported decs', - rootSymbol: externalRootSymbol, - details: id, - exports: exports || [], - localUsageCount, - }) - ); - } - - private findReferencedSymbols(root: ts.Node): ts.Symbol[] { - return [...this.traverse.findReferencedIdentifiers(root)].map((id) => - this.symbols.getForIdentifier(id) - ); - } - - /** - * This method determines all the relevant metadata about the exports of - * a specific `sourceFile` AST node. It indexes all the local declarations, imported - * declarations, and ambient refs that should end up in the public type - * summary file. - * - * To do this we use "symbols" from the `TypeChecker` provided by TypeScript. - * - * > "symbols" in the `TypeChecker` are not related to `Symbol`s in JS. - * - * Symbols describe a specific sourceFile/Type/Value in the source code, and allow - * us to understand the types referenced by specific AST nodes. For instance, we - * can ask the `TypeChecker` for the symbol of an `Identifier` node in the AST (the - * node type representing most named "keywords"; `a` and `foo` in `a(foo)` are both - * `Identifiers`). Every identifier in the source code should map to a specific symbol - * in the type system, which would be returned by the `TypeChecker`. These symbols - * then list the "declarations" which define/declare them. This is often a `class {}` - * or `interface {}` declaration but there are many types of declarations that could - * have defined this symbol. Additionally, the symbol may have multiple declarations - * if function overloads or interface extensions are used. - * - * Symbols can be "alias" symbols, indicating that they are declared in the source code - * but actually point to another declaration, either by variable assignment or via - * imports. When a type/value is imported from another file, the references to that - * type/value use alias symbols, which are declared by the import itself but point - * elsewhere. Thankfully, the `TypeChecker` has an API to traverse up the alias chain - * to the "root symbol". While indexing exports we regularly use the `SymbolResolver` - * to convert a symbol to it's `rootSymbol`, so that we can compare two references and - * determine if they are pointing to the same underlying declarations/type/value. - * - * To determine the full index of exports for a source file we start by asking the - * TypeChecker for the list of exported symbols of some sourceFile, then we traverse - * from those symbols to their declarations. If the symbol has declarations that are - * in node_modules, then either an `ImportedDecs` or `AmbientRef` object is added to - * the index, depending on wether the symbol is ever found to be imported. - * - * `ImportedDecs` describe how to import the declarations for that exported - * symbol in the type summary file. - * `AmbientRef` objects describe names that are expected to be declared ambiently, - * and therefore should be considered reserved in the type summary file. - * - * If any declarations for an exported symbol are local to the source code then they will - * result in a `LocalDecs` object being added to the index. Before adding a `LocalDecs` - * object to the index the AST of each local declaration is traversed to find - * references to other symbols. These references cause additional `ImportedDecs`, - * `AmbientRef`, or `LocalDecs` objects to be added to the index before the exported - * `LocalDecs`, ensuring that referenced declarations come first in the resulting type - * summary file and that all code referenced by the decalarations is included in the type - * summary file. - * - * Once all referenced declarations are found and added to the index the exported - * `LocalDecs` object is added to the index and the process is repeated for the next exported - * symbol. - * - * To ensure that we don't end up with duplicate declarations all `LocalDecs`, `ImportedDecs` - * and `AmbientRef` objects track the "root symbol" that they represent. Any time we - * encounter a new symbol which might need to be added to the index it is first resolved - * to it's root symbol to ensure we haven't already handled it. - */ - indexExports(sourceFile: ts.SourceFile): AstIndex { - return this.log.step('indexExports()', sourceFile.fileName, () => { - const sourceFileSymbol = this.typeChecker.getSymbolAtLocation(sourceFile); - if (!sourceFileSymbol) { - throw new Error(`symbol for source file not found: ${sourceFile.fileName}`); - } - - /** - * all alias symbols which point to a root symbol, which allows - * us to find all the import statements which point to an external - * rootSymbol - */ - const symbolAliases = new SetMap(); - /** - * counts the number of times a rootSymbol is used, this allows us - * to determine if an external rootSymbol needs to be imported for - * local usage, or just exported directly - */ - const rootSymbolLocalUses = new CounterMap(); - /** - * Map of the LocalDecs we have already created, allowing us to make - * sure that we only have a single LocalDecs instance for each rootSymbol - */ - const localDecsBySymbol = new Map(); - /** - * Set of all symbols we've indexed already, allowing us to freely call - * indexSymbol() with each referenced symbol and avoid duplicating work - */ - const indexedSymbols = new Set(); - /** - * Set of DecSymbols which are identified to have some external declarations - * that need to be imported in the final TypeSummary. These will be turned - * into ImportedDecs at the end once we have all the aliases indexed and - * can use the aliases to determine the import statements used to get these - * external symbols into the code. - */ - const externalSymbols = new Set(); - /** - * When we find a rootSymbol which is external, but there aren't any imports - * which pull in that symbol, then we track it here as a ref to an "ambient" - * type, like `Promise<>` from the TS lib. These refs don't end up in the type - * summary, but they do populate the list of UsedNames to ensure that we don't - * clobber those names with local declarations - */ - const ambientRefsByRootSymbol = new SetMap(); - /** - * These are the symbols which are exported from the `sourceFile` being indexed - * grouped by their rootSymbol. This allows us to get the export details for - * external symbols when we are creating ImportedDecs. - */ - const exportSymbolsByRootSymbols = new SetMap(); - /** - * The ordered array of LocalDecs, in the order which these decs should appear - * in the resulting type summary file. - */ - const localDecs: LocalDecs[] = []; - - /** - * This function is called to update the above state with the relevant details - * for a symbol we find as relevant to the exports of `sourceFile`. Calls itself - * with all the internal symbols referenced by the declarations of `symbol`. - */ - const indexSymbol = (symbol: ts.Symbol) => { - return this.log.verboseStep('indexSymbol()', symbol, () => { - if (indexedSymbols.has(symbol)) { - return; - } - indexedSymbols.add(symbol); - - const rootSymbol = this.symbols.toRootSymbol(symbol); - symbolAliases.add(rootSymbol, symbol); - - const existingLocalDec = localDecsBySymbol.get(rootSymbol); - if (!existingLocalDec) { - const [firstDec] = rootSymbol.declarations; - // when using a namespace import for a local module, the symbol resolves to the entire - // sourceFile imported, so we will index the sourceFile's exports and then track the - // namespace we need to synthesize in the output and maybe export - if ( - rootSymbol.declarations.length === 1 && - ts.isSourceFile(firstDec) && - !this.sources.isExternal(firstDec) - ) { - const exports = this.typeChecker.getExportsOfModule(rootSymbol); - const ns: NamespaceDec = { - type: 'namespace dec', - rootSymbol, - exported: undefined, - members: new Map( - exports.map((s) => [s.name, this.symbols.toRootSymbol(s)]) - ), - sourceFile: firstDec, - }; - localDecsBySymbol.set(rootSymbol, ns); - - for (const s of exports) { - indexSymbol(s); - } - localDecs.push(ns); - return; - } - - const locals = this.getCopiedDecs(rootSymbol); - localDecsBySymbol.set(rootSymbol, locals); - - if (locals) { - for (const dec of locals.decs) { - for (const refSymbol of this.findReferencedSymbols(dec)) { - const refRoot = this.symbols.toRootSymbol(refSymbol); - rootSymbolLocalUses.incr(refRoot); - indexSymbol(refSymbol); - } - } - - localDecs.push(locals); - } - } - - if (rootSymbol.declarations.some((d) => this.sources.isExternal(d))) { - externalSymbols.add(rootSymbol); - } - }); - }; - - // iterate through the direct exports of `sourceFile` and index them - for (const exportSymbol of this.typeChecker.getExportsOfModule(sourceFileSymbol)) { - // convert `symbol` to a DecSymbol - assertDecSymbol(exportSymbol); - - // mutate the state to know about this symbol - indexSymbol(exportSymbol); - - // resolve to the rootSymbol that is being exported - const rootSymbol = this.symbols.toRootSymbol(exportSymbol); - - // list this as an exported symbol for when we're trying to define export info for imports - exportSymbolsByRootSymbols.add(rootSymbol, exportSymbol); - - // ensure that if LocalDecs are created for this symbol they have the necessary ExportDetails - const local = localDecsBySymbol.get(rootSymbol); - if (local) { - local.exported = getExportDetails(this.typeChecker, exportSymbol); - } - } - - // convert the externalSymbols to ImportDecs and AmbientRefs based on whether they are imported or not - const importedDecs = [...externalSymbols].flatMap((rootSymbol) => { - const aliases = symbolAliases.get(rootSymbol); - if (!aliases) { - throw new Error(`external symbol has no aliases somehow ${describeSymbol(rootSymbol)}`); - } - - const exportSymbols = exportSymbolsByRootSymbols.get(rootSymbol); - - const resolved = - this.resolveExternalRootSymbol( - rootSymbol, - [...aliases], - exportSymbols - ? [...exportSymbols].map((s) => getExportDetails(this.typeChecker, s)) - : undefined, - rootSymbolLocalUses.get(rootSymbol) - ) ?? []; - - if (Array.isArray(resolved)) { - return resolved; - } - - ambientRefsByRootSymbol.add(resolved.rootSymbol, resolved); - return []; - }); - - return { - imports: importedDecs, - locals: localDecs, - ambientRefs: [...ambientRefsByRootSymbol.values()].flatMap((group) => { - const names = new Set(); - return [...group].filter((g) => { - if (names.has(g.name)) { - return false; - } - - names.add(g.name); - return true; - }); - }), - }; - }); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/ast_traverser.ts b/packages/kbn-type-summarizer/src/lib/ast_traverser.ts deleted file mode 100644 index 64cb98db7eda..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ast_traverser.ts +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { hasIdentifierName, describeNode, Logger } from '@kbn/type-summarizer-core'; -import { isExportableDec } from './ts_nodes'; -import { SymbolResolver } from './symbol_resolver'; -import { SourceFileMapper } from './source_file_mapper'; - -/** - * This object is responsible for exposing utilities for traversing the AST nodes - * to find relevant identifiers within. - */ -export class AstTraverser { - constructor( - private readonly symbols: SymbolResolver, - private readonly sources: SourceFileMapper, - private readonly log: Logger - ) {} - - private doesIdentifierResolveToLocalDeclaration(id: ts.Identifier) { - const rootSymbol = this.symbols.toRootSymbol(this.symbols.getForIdentifier(id)); - for (const dec of rootSymbol.declarations) { - if (!this.sources.isExternal(dec)) { - return true; - } - } - - return false; - } - - /** - * Traverses through the children of `root` deeply to find all identifiers which are - * references. Ignores idenfiers which are names of structres (like names of properties, - * arguments, function declarations, etc) as well as a few other identifiers which we - * are pretty sure never could point to a reference outside of this node. - * - * The goal here is to find all identifiers which we can then convert into symbols to - * find all the types/values that are referenced by the passed `root` AST node. - */ - findReferencedIdentifiers(root: ts.Node): Set { - return this.log.verboseStep('traverse.findReferencedIdentifiers()', root, () => { - const queue = new Set([root]); - const identifiers = new Set(); - - for (const node of queue) { - // ImportTypeNode's are inline `import('...').Type` nodes which TS often injects for inferred return types - // often time these return types are for identifiers from node_modules which we will maintain, since the - // node modules will be available for the summary. If the imported symbol resolves to local code though - // we need to grab the referenced identifier and replace the whole ImportTypeNode with a local reference - // after the declarations for that symbol are included in the summary - if (ts.isImportTypeNode(node)) { - // iterate the type arguments of ImportTypeNode - if (node.typeArguments) { - for (const arg of node.typeArguments) { - queue.add(arg); - } - } - - if (node.qualifier) { - // if the qualifier resolves to a local declaration then count it as an identifier, later - // on we replace the parent node of identifiers inside or `ImportTypeNode`s - if (ts.isIdentifier(node.qualifier)) { - if (this.doesIdentifierResolveToLocalDeclaration(node.qualifier)) { - identifiers.add(node.qualifier); - } - continue; - } - - if (ts.isQualifiedName(node.qualifier) && ts.isIdentifier(node.qualifier.left)) { - if (this.doesIdentifierResolveToLocalDeclaration(node.qualifier.left)) { - identifiers.add(node.qualifier.left); - } - continue; - } - } - - throw new Error( - `unable to find relevant identifier in ImportTypeNode.qualifier ${describeNode(node)}` - ); - } - - const ignores: ts.Node[] = []; - - // ignore parameter/property names, names aren't ever references to other declarations AFAIK - if (hasIdentifierName(node)) { - ignores.push(node.name); - } - - // ignore the source name of destructured params ie. X in `function foo({ X: Foo }: Type)` - if (ts.isBindingElement(node) && node.propertyName) { - ignores.push(node.propertyName); - } - - // ignore parameter names in type predicates ie. X in `(foo: any): X is Bar` - if (ts.isTypePredicateNode(node)) { - ignores.push(node.parameterName); - } - - // ignore identifiers in "QualifiedName" nodes, which are found in TypeReferences like - // `semver.SemVer`, we don't need to treat `SemVer` as a ref because we're capturing `semver` - if (ts.isQualifiedName(node) && ts.isIdentifier(node.right)) { - ignores.push(node.right); - } - - node.forEachChild((child) => { - if (ignores.includes(child)) { - return; - } - - if (ts.isIdentifier(child)) { - identifiers.add(child); - } else { - queue.add(child); - } - }); - } - - return identifiers; - }); - } - - /** - * Returns "structural" identifiers for a `root` node, which includes the name of the `root` and - * the name of any "members", like the names of properties in an interface or class, the name of - * options in an enum, all so we can identify their posistions later on and make sure they reference - * their source location in the source maps. - */ - findStructuralIdentifiers(root: ts.Node): Set { - return this.log.verboseStep('traverse.findStructuralIdentifiers()', root, () => { - const queue = new Set([root]); - const identifiers = new Set(); - - for (const node of queue) { - if (isExportableDec(node)) { - identifiers.add(node.name); - } - - if ( - ts.isClassDeclaration(node) || - ts.isInterfaceDeclaration(node) || - ts.isTypeLiteralNode(node) || - ts.isEnumDeclaration(node) - ) { - for (const member of node.members) { - if (hasIdentifierName(member)) { - identifiers.add(member.name); - } - } - } - } - - return identifiers; - }); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/counter_map.ts b/packages/kbn-type-summarizer/src/lib/counter_map.ts deleted file mode 100644 index afb5c95723a1..000000000000 --- a/packages/kbn-type-summarizer/src/lib/counter_map.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -/** - * A simple Map wrapper which counts the number of times a value `K` is - * passed to `incr()`. - */ -export class CounterMap { - private counters = new Map(); - - incr(key: K, by: number = 1) { - this.counters.set(key, (this.counters.get(key) ?? 0) + by); - } - - get(key: K): number { - return this.counters.get(key) ?? 0; - } -} diff --git a/packages/kbn-type-summarizer/src/lib/dts_snipper.ts b/packages/kbn-type-summarizer/src/lib/dts_snipper.ts deleted file mode 100644 index 02f25095fcdf..000000000000 --- a/packages/kbn-type-summarizer/src/lib/dts_snipper.ts +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { describeNode, Logger } from '@kbn/type-summarizer-core'; -import { DecSymbol } from './ts_nodes'; -import { AstTraverser } from './ast_traverser'; -import { SymbolResolver } from './symbol_resolver'; - -const COMMENT_TRIM = /^(\s+)(\/\*|\*|\/\/)/; - -/** - * A Snippet which represents an arbitrary bit of source code. The `value` - * of these snippets will be included verbatim in the type summary output - */ -export interface SourceSnippet { - type: 'source'; - value: string; -} - -/** - * A Snippet which represents an existing `export` modifier, or the location where - * one should exist if it needs to exist. When printing the `Snippet`s to - * the type summary file we will determine if the structure bring printed - * should be inline-exported, and if so replace this snippet with the - * relevant export/export-type keyword(s). If the structure shouldn't be - * exported inline then we will simply ignore this snippet. - */ -export interface ExportSnippet { - type: 'export'; - noExportRequiresDeclare: boolean; -} - -/** - * A Snippet which represents an identifier in the source. These snippets will - * be replaced with `SourceNode` objects in the type summary output so that - * the `.map` file can be generated which maps the identifiers to their original - * source location. - */ -export interface IdentifierSnippet { - type: 'indentifier'; - rootSymbol: DecSymbol; - identifier: ts.Identifier; - text: string; - structural: boolean; -} - -export type Snippet = SourceSnippet | ExportSnippet | IdentifierSnippet; - -/** - * The DtsSnipper is responsible for taking the source text of an AST node - * and converting it into an array of `Snippet` objects, which allow us to - * reuse the code structure from `.d.ts` produced by TS but replace specific - * snippets of that text with different values or `SourceNode`s from the - * `source-map` library which allows is how we produce source-maps for our - * type summary. - */ -export class DtsSnipper { - constructor( - private readonly traverse: AstTraverser, - private readonly symbols: SymbolResolver, - private readonly log: Logger - ) {} - - private getVariableDeclarationList(node: ts.VariableDeclaration) { - const list = node.parent; - if (!ts.isVariableDeclarationList(list)) { - throw new Error( - `expected parent of variable declaration to be a VariableDeclarationList ${describeNode( - list - )}` - ); - } - return list; - } - - private getSourceWithLeadingComments(node: ts.Node) { - // variable declarations regularly have leading comments but they're two-parents up, so we have to handle them separately - if (!ts.isVariableDeclaration(node)) { - return node.getFullText(); - } - - const list = this.getVariableDeclarationList(node); - if (list.declarations.length > 1) { - return node.getFullText(); - } - - const statement = list.parent; - if (!ts.isVariableStatement(statement)) { - throw new Error('expected parent of VariableDeclarationList to be a VariableStatement'); - } - - return statement.getFullText(); - } - - private getLeadingComments(node: ts.Node): Snippet[] { - const fullText = this.getSourceWithLeadingComments(node); - const ranges = ts.getLeadingCommentRanges(fullText, 0); - if (!ranges) { - return []; - } - - return ranges.flatMap((range) => { - const comment = fullText - .slice(range.pos, range.end) - .split('\n') - .map((line) => { - const match = line.match(COMMENT_TRIM); - if (!match) { - return line; - } - - const [, spaces, type] = match; - return line.slice(type === '*' ? spaces.length - 1 : spaces.length); - }) - .map((line) => `${line}`) - .join('\n'); - - if (comment.startsWith('/// { - const snippets: Snippet[] = this.getLeadingComments(root); - - const getIdStart = (id: ts.Identifier) => - ts.isImportTypeNode(id.parent) - ? id.parent.getStart() - : ts.isQualifiedName(id.parent) && ts.isImportTypeNode(id.parent.parent) - ? id.parent.parent.getStart() - : id.getStart(); - const getIdEnd = (id: ts.Identifier) => - ts.isImportTypeNode(id.parent) - ? id.parent.getEnd() - : ts.isQualifiedName(id.parent) && ts.isImportTypeNode(id.parent.parent) - ? id.parent.parent.getEnd() - : id.getEnd(); - - const structural = this.traverse.findStructuralIdentifiers(root); - const identifiers = Array.from( - new Set([...structural, ...this.traverse.findReferencedIdentifiers(root)]) - ).sort((a, b) => getIdStart(a) - getIdStart(b)); - - const source = root.getText(); - const sourceStart = root.getStart(); - const sourceEnd = sourceStart + source.length; - let cursor = sourceStart; - - // if there is text from the source between our current position and some other position - // then copy it into the result and update our current position to that position - const maybeSlurpTo = (until: number) => { - if (cursor < until) { - snippets.push({ - type: 'source', - value: source.slice(cursor - sourceStart, until - sourceStart), - }); - cursor = until; - } - }; - - // Either replace the existing export with a placeholder, or inject an export placeholder before - // the root nodes own text so we know where to put the export if needed - const exportMod = root.modifiers?.find((m) => m.kind === ts.SyntaxKind.ExportKeyword); - // when TS prints a function declaration to the .d.ts file with an `export` keyword, it doesn't need to be - // `declare`d, so it sometimes skips it. If we end up striping the `export` keyword we need to put `declare` - // in it's place so that the `.d.ts` syntax is valid - const noExportRequiresDeclare = - (ts.isFunctionDeclaration(root) || ts.isClassDeclaration(root)) && - !root.modifiers?.some((m) => m.kind === ts.SyntaxKind.DeclareKeyword); - - if (exportMod) { - const modStart = exportMod.getStart(); - const modEnd = exportMod.getEnd(); - maybeSlurpTo(modStart); - - snippets.push({ - type: 'export', - noExportRequiresDeclare, - }); - - // export is always followed by a space, so skip the space too - cursor = modEnd + 1; - } else { - const rootStart = root.getStart(); - maybeSlurpTo(rootStart); - - snippets.push({ - type: 'export', - noExportRequiresDeclare, - }); - cursor = rootStart; - } - - // inject a `const`, `let`, or `var` before variable declarations - if (ts.isVariableDeclaration(root) && ts.isVariableDeclarationList(root.parent)) { - // eslint-disable-next-line no-bitwise - if (root.parent.flags & ts.NodeFlags.Const) { - snippets.push({ - type: 'source', - value: 'declare const ', - }); - // eslint-disable-next-line no-bitwise - } else if (root.parent.flags & ts.NodeFlags.Let) { - snippets.push({ - type: 'source', - value: 'declare let ', - }); - } else { - snippets.push({ - type: 'source', - value: 'declare var ', - }); - } - } - - for (const identifier of identifiers) { - const start = getIdStart(identifier); - const end = getIdEnd(identifier); - maybeSlurpTo(start); - - snippets.push({ - type: 'indentifier', - identifier, - text: identifier.getText(), - rootSymbol: this.symbols.toRootSymbol( - this.symbols.getForIdentifier(identifier), - identifier - ), - structural: structural.has(identifier), - }); - - cursor = end; - } - - maybeSlurpTo(sourceEnd); - - return snippets; - }); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/export_details.ts b/packages/kbn-type-summarizer/src/lib/export_details.ts deleted file mode 100644 index 6a805e5707fd..000000000000 --- a/packages/kbn-type-summarizer/src/lib/export_details.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; - -import { describeNode, isAliasSymbol } from '@kbn/type-summarizer-core'; -import { isExportableDec, getSymbolDeclarations } from './ts_nodes'; - -export type ExportDetails = NamedExportDetails | DefaultExportDetails; - -export interface DefaultExportDetails { - type: 'default'; -} - -export interface NamedExportDetails { - type: 'named'; - typeOnly: boolean; - name: string; -} - -/** - * Determine the export name of an export symbol - */ -function getExportName(node: ts.Node): string { - if (ts.isExportSpecifier(node) || isExportableDec(node)) { - return node.name.text; - } - - throw new Error(`unsure how to get export name from ${describeNode(node)}`); -} - -/** - * Determine if an export symbol was type-only exported. This would be true if the top-level export - * statement is type only, or if there are other export statements up the alias chain where the - * parent symbol was type-only exported. - */ -function isTypeOnlyExported(typeChecker: ts.TypeChecker, exportSymbol: ts.Symbol) { - if (getSymbolDeclarations(exportSymbol).some((e) => ts.isTypeOnlyImportOrExportDeclaration(e))) { - return true; - } - - if (isAliasSymbol(exportSymbol)) { - const next = typeChecker.getImmediateAliasedSymbol(exportSymbol); - if (next && isTypeOnlyExported(typeChecker, next)) { - return true; - } - } - return false; -} - -/** - * Given an exported symbol, determine details about the export from the symbols declarations - * including if it was a type-only export, a default export, or a named export and the name - * it was exported with - */ -export function getExportDetails( - typeChecker: ts.TypeChecker, - exportSymbol: ts.Symbol -): ExportDetails { - if (!exportSymbol.declarations?.length) { - throw new Error('unable to get export details for symbols without any declarations'); - } - - if ( - exportSymbol.declarations.length === 1 && - ts.isExportAssignment(exportSymbol.declarations[0]) - ) { - return { - type: 'default', - }; - } - - return { - type: 'named', - typeOnly: isTypeOnlyExported(typeChecker, exportSymbol), - name: getExportName(exportSymbol.declarations[0]), - }; -} diff --git a/packages/kbn-type-summarizer/src/lib/import_details.ts b/packages/kbn-type-summarizer/src/lib/import_details.ts deleted file mode 100644 index ca68c79fe6a5..000000000000 --- a/packages/kbn-type-summarizer/src/lib/import_details.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; - -import { describeNode } from '@kbn/type-summarizer-core'; - -interface BaseImportDetails { - typesOnly: boolean; - req: string; - node: T; -} - -/** - * Indicates that the import was using `import * as X from 'y'` syntax - */ -export interface NamespaceImportDetails - extends BaseImportDetails { - type: 'namespace'; -} - -/** - * Indicates that the import was using `import X from 'y'` syntax - */ -export interface DefaultImportDetails extends BaseImportDetails { - type: 'default'; -} - -/** - * Indicates that the import was using `import { X } from 'y'` syntax, along - * with the name of the imported value from the source module. - */ -export interface NamedImportDetails - extends BaseImportDetails { - type: 'named'; - sourceName: string; -} - -/** - * The different types of ImportDetails that can be returned from `getImportDetails()` - */ -export type ImportDetails = NamespaceImportDetails | DefaultImportDetails | NamedImportDetails; - -/** - * Type guard for nodes which have a module specifier - */ -function hasModuleSpecifier( - node: T -): node is T & { moduleSpecifier: ts.StringLiteral } { - return !!(node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)); -} - -/** - * Determine the module request from a node which might have one, otherwise throw - */ -function getReq(node: ts.ImportDeclaration | ts.ExportDeclaration) { - if (hasModuleSpecifier(node)) { - return node.moduleSpecifier.text; - } - - throw new Error( - `syntax error, module specifier should be a string literal ${describeNode(node)}` - ); -} - -/** - * Given any node, determine if it represents a node that is related to an import statement - * and determine the details about that import, including type, req, source name (for named imports) - * and if the import is type-only. - * - * This also works to get the "import" details from `export ... from '...'` statements. - */ -export function getImportDetails(node: ts.Node): ImportDetails | undefined { - // import { bar } from './bar' - if (ts.isImportSpecifier(node)) { - return { - type: 'named', - typesOnly: ts.isTypeOnlyImportOrExportDeclaration(node), - sourceName: node.propertyName?.text ?? node.name.text, - req: getReq(node.parent.parent.parent), - node, - }; - } - - // `export { bar } from './bar'` or `export { x }` - if (ts.isExportSpecifier(node)) { - // if there isn't a related module specifier then this export isn't a type of "import" - if (!node.parent.parent.moduleSpecifier) { - return; - } - - return { - type: 'named', - typesOnly: ts.isTypeOnlyImportOrExportDeclaration(node), - sourceName: node.propertyName?.text ?? node.name.text, - req: getReq(node.parent.parent), - node, - }; - } - - // import Foo from 'foo' - if (ts.isImportClause(node)) { - return { - type: 'default', - typesOnly: ts.isTypeOnlyImportOrExportDeclaration(node), - req: getReq(node.parent), - node, - }; - } - - // import * as Foo from 'foo' - if (ts.isNamespaceImport(node)) { - return { - type: 'namespace', - typesOnly: ts.isTypeOnlyImportOrExportDeclaration(node), - req: getReq(node.parent.parent), - node, - }; - } - - // export * as Foo from 'foo' - if (ts.isNamespaceExport(node)) { - return { - type: 'namespace', - typesOnly: ts.isTypeOnlyImportOrExportDeclaration(node), - req: getReq(node.parent), - node, - }; - } -} diff --git a/packages/kbn-type-summarizer/src/lib/source_file_mapper.ts b/packages/kbn-type-summarizer/src/lib/source_file_mapper.ts deleted file mode 100644 index 0622d31fed5b..000000000000 --- a/packages/kbn-type-summarizer/src/lib/source_file_mapper.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; -import { Path } from '@kbn/type-summarizer-core'; -import isPathInside from 'is-path-inside'; - -/** - * Wrapper class around helpers for determining information - * about source files. - */ -export class SourceFileMapper { - constructor(private readonly dtsDir: string) {} - - getAbsolute(node: ts.Node) { - return node.getSourceFile().fileName; - } - - isNodeModule(path: string) { - return ( - isPathInside(path, this.dtsDir) ? Path.relative(this.dtsDir, path) : Path.toNormal(path) - ) - .split('/') - .includes('node_modules'); - } - - isExternal(node: ts.Node) { - const path = this.getAbsolute(node); - return this.isNodeModule(path); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/source_mapper.ts b/packages/kbn-type-summarizer/src/lib/source_mapper.ts deleted file mode 100644 index 86f336a44f19..000000000000 --- a/packages/kbn-type-summarizer/src/lib/source_mapper.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; -import { SourceNode, SourceMapConsumer, BasicSourceMapConsumer } from 'source-map'; - -import { Logger, tryReadFile, parseJson, Path, describeNode } from '@kbn/type-summarizer-core'; - -import { SourceFileMapper } from './source_file_mapper'; - -type SourceMapConsumerEntry = [ts.SourceFile, BasicSourceMapConsumer | undefined]; - -/** - * Wrapper class for utilities that deal with reading the source maps produced by - * tsc along with the .d.ts, as well as creating the SourceNode instances we use to - * create our type summary along with source maps. - */ -export class SourceMapper { - static async forSourceFiles( - log: Logger, - sources: SourceFileMapper, - repoRelativePackageDir: string, - program: ts.Program - ) { - const entries = await Promise.all( - program - .getSourceFiles() - .filter((f) => !sources.isNodeModule(f.fileName)) - .sort((a, b) => a.fileName.localeCompare(b.fileName)) - .map(async (sourceFile): Promise => { - if (sources.isNodeModule(sourceFile.fileName)) { - return; - } - - const text = sourceFile.getText(); - const match = text.match(/^\/\/#\s*sourceMappingURL=(.*)/im); - if (!match) { - return [sourceFile, undefined]; - } - - const relSourceFile = Path.cwdRelative(sourceFile.fileName); - const sourceMapPath = Path.join(Path.dirname(sourceFile.fileName), match[1]); - const relSourceMapPath = Path.cwdRelative(sourceMapPath); - const sourceJson = await tryReadFile(sourceMapPath, 'utf8'); - if (!sourceJson) { - throw new Error( - `unable to find source map for [${relSourceFile}] expected at [${match[1]}]` - ); - } - - const json = parseJson(sourceJson, `source map at [${relSourceMapPath}]`); - return [sourceFile, await new SourceMapConsumer(json)]; - }) - ); - - const consumers = new Map(entries.filter((e): e is SourceMapConsumerEntry => !!e)); - log.debug( - 'loaded sourcemaps for', - Array.from(consumers.keys()).map((s) => Path.relative(process.cwd(), s.fileName)) - ); - - return new SourceMapper(consumers, repoRelativePackageDir); - } - - private readonly sourceFixDir: string; - constructor( - private readonly consumers: Map, - repoRelativePackageDir: string - ) { - this.sourceFixDir = Path.join('/', repoRelativePackageDir); - } - - /** - * We ensure that `sourceRoot` is not defined in the tsconfig files, and we assume that the `source` value - * for each file in the source map will be a relative path out of the bazel-out dir and to the `repoRelativePackageDir` - * or some path outside of the package in rare situations. Our goal is to convert each of these source paths - * to new path that is relative to the `repoRelativePackageDir` path. To do this we resolve the `repoRelativePackageDir` - * as if it was at the root of the filesystem, then do the same for the `source`, so both paths should be - * absolute, but only include the path segments from the root of the repo. We then get the relative path from - * the absolute version of the `repoRelativePackageDir` to the absolute version of the `source`, which should give - * us the path to the source, relative to the `repoRelativePackageDir`. - */ - private fixSourcePath(source: string) { - return Path.relative(this.sourceFixDir, Path.join('/', source)); - } - - private findOriginalPosition(node: ts.Node) { - const dtsSource = node.getSourceFile(); - - if (!this.consumers.has(dtsSource)) { - throw new Error(`sourceFile for [${dtsSource.fileName}] didn't have sourcemaps loaded`); - } - - const consumer = this.consumers.get(dtsSource); - if (!consumer) { - return; - } - - const posInDts = dtsSource.getLineAndCharacterOfPosition(node.getStart()); - const pos = consumer.originalPositionFor({ - /* ts line column numbers are 0 based, source map column numbers are also 0 based */ - column: posInDts.character, - /* ts line numbers are 0 based, source map line numbers are 1 based */ - line: posInDts.line + 1, - }); - - return { - ...pos, - source: pos.source ? this.fixSourcePath(pos.source) : null, - }; - } - - getOriginalSourcePath(sourceFile: ts.SourceFile) { - const consumer = this.consumers.get(sourceFile); - if (!consumer) { - throw new Error(`no source map defined for ${describeNode(sourceFile)}`); - } - - if (consumer.sources.length !== 1) { - throw new Error( - `tsc sourcemap produced ${ - consumer.sources.length - } source entries, expected 1: ${describeNode(sourceFile)}` - ); - } - - return this.fixSourcePath(consumer.sources[0]); - } - - getSourceNode(generatedNode: ts.Node, code: string) { - const pos = this.findOriginalPosition(generatedNode); - - if (pos && pos.line && pos.column && pos.source) { - return new SourceNode(pos.line, pos.column, pos.source, code, pos.name ?? undefined); - } - } - - close() { - for (const consumer of this.consumers.values()) { - consumer?.destroy(); - } - this.consumers.clear(); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/symbol_resolver.ts b/packages/kbn-type-summarizer/src/lib/symbol_resolver.ts deleted file mode 100644 index 299cc8d38943..000000000000 --- a/packages/kbn-type-summarizer/src/lib/symbol_resolver.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { Logger, isAliasSymbol, CliError, describeNode } from '@kbn/type-summarizer-core'; -import { DecSymbol, isDecSymbol } from './ts_nodes'; -import { getImportDetails } from './import_details'; - -/** - * Wrapper class around utilities for resolving symbols and producing meaningful errors when those - * symbols can't be resolved properly. - */ -export class SymbolResolver { - constructor(private readonly typeChecker: ts.TypeChecker, private readonly log: Logger) {} - - getForIdentifier(id: ts.Identifier) { - return this.log.verboseStep('symbols.getForIdentifier()', id, () => { - const symbol = this.typeChecker.getSymbolAtLocation(id); - if (!symbol) { - throw new Error(`unable to find symbol for ${describeNode(id)}`); - } - - return symbol; - }); - } - - toRootSymbol(alias: ts.Symbol, source?: ts.Node): DecSymbol { - return this.log.verboseStep('symbols.toRootSymbol()', alias, () => { - const root = isAliasSymbol(alias) ? this.typeChecker.getAliasedSymbol(alias) : alias; - - if (!isDecSymbol(root)) { - const importDetails = [...(alias.declarations ?? []), ...(source ? [source] : [])].flatMap( - (d) => getImportDetails(d) ?? [] - ); - - if (importDetails.length) { - throw new CliError( - `unable to find declarations for symbol imported from "${ - importDetails[0].req - }". If this is an external module, make sure is it listed in the type dependencies for this package. If it's internal then make sure that TypeScript understands the types of the imported value. Imported: ${describeNode( - importDetails[0].node - )}` - ); - } - - throw new Error('expected symbol to have declarations'); - } - - return root; - }); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/dec_symbol.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/dec_symbol.ts deleted file mode 100644 index c4443ed25de9..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/dec_symbol.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -export type DecSymbol = ts.Symbol & { - declarations: NonNullable; -}; - -export function isDecSymbol(symbol: ts.Symbol): symbol is DecSymbol { - return !!symbol.declarations && symbol.declarations.length > 0; -} - -export function assertDecSymbol(symbol: ts.Symbol): asserts symbol is DecSymbol { - if (!isDecSymbol(symbol)) { - throw new Error(`Expected symbol to have declarations.`); - } -} - -export function toDecSymbol(symbol: ts.Symbol): DecSymbol { - assertDecSymbol(symbol); - return symbol; -} - -export function getSymbolDeclarations(symbol: ts.Symbol) { - assertDecSymbol(symbol); - return symbol.declarations; -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/export_from.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/export_from.ts deleted file mode 100644 index bbedffd23275..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/export_from.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -export type ExportFromDeclaration = ts.ExportDeclaration & { - moduleSpecifier: NonNullable; -}; - -export function isExportFromDeclaration(node: ts.Node): node is ExportFromDeclaration { - return ts.isExportDeclaration(node) && !!node.moduleSpecifier; -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/exportable_node.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/exportable_node.ts deleted file mode 100644 index c9657523104b..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/exportable_node.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { describeNode, hasIdentifierName } from '@kbn/type-summarizer-core'; - -export type ExportableDec = ( - | ts.ClassDeclaration - | ts.FunctionDeclaration - | ts.TypeAliasDeclaration - | ts.VariableDeclaration - | ts.InterfaceDeclaration - | ts.EnumDeclaration - | ts.ModuleDeclaration -) & { name: ts.Identifier }; - -export function isExportableDec(node: ts.Node): node is ExportableDec { - return ( - (node.kind === ts.SyntaxKind.ClassDeclaration || - node.kind === ts.SyntaxKind.FunctionDeclaration || - node.kind === ts.SyntaxKind.TypeAliasDeclaration || - node.kind === ts.SyntaxKind.VariableDeclaration || - node.kind === ts.SyntaxKind.InterfaceDeclaration || - node.kind === ts.SyntaxKind.EnumDeclaration || - node.kind === ts.SyntaxKind.ModuleDeclaration) && - hasIdentifierName(node) - ); -} - -export function assertExportableDec(node: ts.Node): asserts node is ExportableDec { - if (!isExportableDec(node)) { - throw new Error(`not a valid ExportableDec ${describeNode(node)}`); - } -} - -export function toExportableDec(node: ts.Node): ExportableDec { - assertExportableDec(node); - return node; -} - -export function isTypeDeclaration(dec: ExportableDec) { - return ( - ts.isInterfaceDeclaration(dec) || - ts.isTypeAliasDeclaration(dec) || - ts.isEnumDeclaration(dec) || - ts.isModuleDeclaration(dec) - ); -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/imports.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/imports.ts deleted file mode 100644 index fefde651a0ae..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/imports.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { describeNode } from '@kbn/type-summarizer-core'; - -export interface ImportDescriptor { - declaration: ts.ImportDeclaration | ts.ExportDeclaration; - moduleSpecifier: string; -} - -export function getImportDescriptor( - specifier: ts.ImportSpecifier | ts.ExportSpecifier -): ImportDescriptor | undefined { - const declaration = ts.isImportSpecifier(specifier) - ? // import specifiers are always within NamedImports nodes - // which are always with ImportClause nodes - // which are always within ImportDeclaration nodes - specifier.parent.parent.parent - : // export specifiers are always within NamedExports nodes - // which are always within ExportDeclaration nodes - specifier.parent.parent; - - if (declaration.moduleSpecifier && ts.isStringLiteral(declaration.moduleSpecifier)) { - return { - declaration, - moduleSpecifier: declaration.moduleSpecifier.text, - }; - } - - if (ts.isImportDeclaration(declaration) && !ts.isStringLiteral(declaration.moduleSpecifier)) { - throw new Error( - `SyntaxError: ImportDeclaration.moduleSpecifier must be a string literal ${describeNode( - declaration - )}` - ); - } - - return undefined; -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/index.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/index.ts deleted file mode 100644 index 148c8d5a870e..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -export * from './dec_symbol'; -export * from './export_from'; -export * from './exportable_node'; -export * from './imports'; -export * from './syntax_kind'; diff --git a/packages/kbn-type-summarizer/src/lib/ts_nodes/syntax_kind.ts b/packages/kbn-type-summarizer/src/lib/ts_nodes/syntax_kind.ts deleted file mode 100644 index 7d4a4a80761c..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_nodes/syntax_kind.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -export function assertKind( - node: ts.Node, - test: (n: ts.Node) => n is T -): asserts node is T { - if (!test(node)) { - throw new Error( - `expected node to match [${test.name}], actual kind: ${ts.SyntaxKind[node.kind]}` - ); - } -} diff --git a/packages/kbn-type-summarizer/src/lib/ts_project.ts b/packages/kbn-type-summarizer/src/lib/ts_project.ts deleted file mode 100644 index 9d3a43ba1113..000000000000 --- a/packages/kbn-type-summarizer/src/lib/ts_project.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; - -/** - * Parse a tsconfig file and list of input files into a TypeScript Program object. - */ -export function createTsProject(tsConfig: ts.ParsedCommandLine, rootNames: string[]) { - return ts.createProgram({ - rootNames, - options: { - ...tsConfig.options, - skipLibCheck: false, - }, - projectReferences: tsConfig.projectReferences, - }); -} diff --git a/packages/kbn-type-summarizer/src/lib/tsconfig_file.ts b/packages/kbn-type-summarizer/src/lib/tsconfig_file.ts deleted file mode 100644 index d8ecd1b559a5..000000000000 --- a/packages/kbn-type-summarizer/src/lib/tsconfig_file.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as ts from 'typescript'; - -import { CliError, Path } from '@kbn/type-summarizer-core'; - -/** - * Read TS's special variable of JSON from a file into a plain object - */ -function readTsConfigFile(path: string) { - const json = ts.readConfigFile(path, ts.sys.readFile); - - if (json.error) { - throw new CliError(`Unable to load tsconfig file: ${json.error.messageText}`); - } - - return json.config; -} - -/** - * Read a tsconfig.json file from dist and parse it using utilities from the typscript package. - */ -export function loadTsConfigFile(path: string) { - return ts.parseJsonConfigFileContent(readTsConfigFile(path) ?? {}, ts.sys, Path.dirname(path)); -} diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/print_imports.ts b/packages/kbn-type-summarizer/src/lib/type_summary/print_imports.ts deleted file mode 100644 index 542b4bc3c3e2..000000000000 --- a/packages/kbn-type-summarizer/src/lib/type_summary/print_imports.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Logger } from '@kbn/type-summarizer-core'; -import { SourceNode } from 'source-map'; - -import { ImportedDecs } from '../ast_index'; - -import { TypeSummaryNamer } from './type_summary_namer'; -import { exportSomeName } from './export_some_name'; - -/** - * Convert an import request into a usable keyword, for when we don't have much information about a good name for an import - */ -const reqToKeyword = (req: string) => - req.split(/[A-Z\W]/).reduce((acc, chunk) => { - if (!chunk) { - return acc; - } - if (acc) { - return acc + chunk[0].toUpperCase() + chunk.slice(1).toLowerCase(); - } - return chunk.toLowerCase(); - }, ''); - -/** - * Reads the imports from the `index` and adds the necessary `SourceNode`s to the `source` for each. - */ -export function printImports( - imports: ImportedDecs[], - names: TypeSummaryNamer, - log: Logger, - source: SourceNode -) { - log.step('printImports()', `${imports.length} imports`, () => { - for (const i of imports) { - const name = names.get( - i.rootSymbol, - // if we don't use it locally, don't try to re-use its name - i.localUsageCount ? i.details.node.name?.getText() ?? reqToKeyword(i.details.req) : '_' - ); - - if (i.details.type === 'default') { - source.add(`import ${name} from '${i.details.req}'\n`); - for (const exported of i.exports) { - if (exported.type === 'default') { - source.add(`export default ${name}\n`); - } else { - source.add(exportSomeName(exported, name)); - } - } - } else if (i.details.type === 'namespace') { - source.add(`import * as ${name} from '${i.details.req}'\n`); - for (const exported of i.exports) { - if (exported.type === 'default') { - source.add(`export default ${name}\n`); - } else { - source.add(exportSomeName(exported, name)); - } - } - } else { - const { details, exports, localUsageCount } = i; - - let imported = false; - const ensureImported = () => { - if (!imported) { - imported = true; - source.add( - `import { ${ - details.sourceName !== name ? `${details.sourceName} as ${name}` : name - } } from '${details.req}'\n` - ); - } - }; - - if (localUsageCount) { - ensureImported(); - } - - for (const exported of exports) { - if (exported.type === 'default') { - ensureImported(); - source.add(`export default ${name}\n`); - } else { - source.add( - `export ${exported.typeOnly ? `type ` : ''}{ ${ - exported.name !== details.sourceName - ? `${details.sourceName} as ${exported.name}` - : details.sourceName - } } from '${details.req}'\n` - ); - } - } - } - } - - source.add('\n'); - }); -} diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/print_locals.ts b/packages/kbn-type-summarizer/src/lib/type_summary/print_locals.ts deleted file mode 100644 index 332b34b6d731..000000000000 --- a/packages/kbn-type-summarizer/src/lib/type_summary/print_locals.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Logger } from '@kbn/type-summarizer-core'; -import { SourceNode } from 'source-map'; - -import { isTypeDeclaration } from '../ts_nodes'; -import { LocalDecs } from '../ast_index'; -import { SourceMapper } from '../source_mapper'; -import { DtsSnipper } from '../dts_snipper'; - -import { TypeSummaryNamer } from './type_summary_namer'; -import { exportSomeName } from './export_some_name'; - -/** - * Reads `locals` and adds necessary `SourceNode`s to `source` to reproduce the declarations - * of each local. - * - * Local printing is primarily done using the `DtsSnipper` which reads the original definition - * of the given declaration from the .d.ts files produced by tsc, then breaks them up into - * "snippets" (more details in the DtsSnipper class). These snippets are then itterated to either - * produce SourceNodes or text for the resulting definition. - * - * The exception is NamespaceDec locals, which must synthesize an imported namespace either - * for local usage or for exporting. When a namespace import is used a structure similar to - * the following will be added to the type summary: - * - * declare namespace NamespaceName { - * export { - * foo, - * bar, - * baz, - * } - * } - * export { NamespaceName } - */ -export function printLocals( - locals: LocalDecs[], - names: TypeSummaryNamer, - sourceMaps: SourceMapper, - snipper: DtsSnipper, - log: Logger, - source: SourceNode -) { - const localDecCount = locals.reduce( - (acc, l) => acc + (l.type === 'namespace dec' ? 1 : l.decs.length), - 0 - ); - - log.step('printLocals()', `${localDecCount} decs`, () => { - for (const local of locals) { - if (local.type === 'namespace dec') { - const name = names.get( - local.rootSymbol, - local.exported?.type === 'named' ? local.exported.name : 'ns' - ); - - // synthesize the namespace that represents the namespace import - source.add([ - `declare namespace `, - new SourceNode(1, 0, sourceMaps.getOriginalSourcePath(local.sourceFile), name), - ` {\n`, - ]); - source.add(` export {\n`); - // members - for (const [memberName, symbol] of local.members) { - const refName = names.get(symbol, memberName); - source.add( - ` ${memberName === refName ? memberName : `${refName} as ${memberName}`},\n` - ); - } - source.add(` }\n`); - source.add(`}\n`); - - if (local.exported?.type === 'named') { - source.add(exportSomeName(local.exported, name)); - } - - if (local.exported?.type === 'default') { - source.add(`export default ${name}`); - } - - continue; - } - - const decName = names.get( - local.rootSymbol, - local.exported?.type === 'named' ? local.exported.name : local.decs[0].name.getText() - ); - const exportLocally = - local.exported?.type === 'named' && - (local.decs.every(isTypeDeclaration) || !local.exported.typeOnly) && - decName === local.exported.name; - - for (const dec of local.decs) { - for (const s of snipper.toSnippets(dec)) { - if (s.type === 'source') { - source.add(s.value); - continue; - } - - if (s.type === 'export') { - // only print the export if we are exporting locally, otherwise drop this snipped - if (exportLocally) { - if (local.exported?.type === 'default') { - source.add(`export default `); - } else { - source.add(`export `); - } - } else { - if (s.noExportRequiresDeclare) { - source.add(`declare `); - } - } - continue; - } - - const name = names.get(s.rootSymbol, s.text); - source.add(s.structural ? sourceMaps.getSourceNode(s.identifier, name) ?? name : name); - } - - source.add('\n'); - } - - if (!exportLocally) { - if (local.exported?.type === 'named') { - source.add(exportSomeName(local.exported, decName)); - } - if (local.exported?.type === 'default') { - source.add(`export default ${decName}\n`); - } - } - - source.add('\n'); - } - }); -} diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/print_type_summary.ts b/packages/kbn-type-summarizer/src/lib/type_summary/print_type_summary.ts deleted file mode 100644 index 0ac9430dcc86..000000000000 --- a/packages/kbn-type-summarizer/src/lib/type_summary/print_type_summary.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { SourceNode } from 'source-map'; - -import { Logger } from '@kbn/type-summarizer-core'; -import { AstIndex } from '../ast_index'; -import { DtsSnipper } from '../dts_snipper'; -import { SourceMapper } from '../source_mapper'; -import { TypeSummaryNamer } from './type_summary_namer'; - -import { printImports } from './print_imports'; -import { printLocals } from './print_locals'; - -/** - * Produces a `SourceNode` which includes the code and source maps for the type summary. To deal - * with naming conflicts a `TypeSummaryNamer` instance is created which will allow the printing - * functions to resolve a `rootSymbol` to a specific name. If a name is not already defines for - * this `rootSymbol` then one is generated for it (generated names are optionally influenced by - * a `hint`). - * - * The result of this function is a `SourceNode` which has functions necessary to produce the - * resulting source code (a .d.ts file) and source map which maps the structurs in the .d.ts file - * to their original source locations in the repository. - */ -export function printTypeSummary( - sourceMaps: SourceMapper, - snipper: DtsSnipper, - log: Logger, - index: AstIndex -) { - const names = new TypeSummaryNamer(index); - const source = new SourceNode(); - printImports(index.imports, names, log, source); - printLocals(index.locals, names, sourceMaps, snipper, log, source); - return source; -} diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/type_summary_namer.ts b/packages/kbn-type-summarizer/src/lib/type_summary/type_summary_namer.ts deleted file mode 100644 index 8862f9fc3f43..000000000000 --- a/packages/kbn-type-summarizer/src/lib/type_summary/type_summary_namer.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; - -import { AstIndex } from '../ast_index'; - -const INVALID_NAMES = ['default', 'import', 'export']; - -/** - * Class which is reponsible for managing the list of used names and assigning - * new names to "root symbols". - */ -export class TypeSummaryNamer { - public readonly rootDecsSymbols = new Set(); - private readonly usedNames = new Set(); - private readonly namesBySymbol = new Map(); - - constructor(index: AstIndex) { - for (const ref of index.ambientRefs) { - this.usedNames.add(ref.name); - this.namesBySymbol.set(ref.rootSymbol, ref.name); - } - - for (const l of index.locals) { - this.rootDecsSymbols.add(l.rootSymbol); - if (l.exported?.type === 'named') { - // assign export name to this root symbol, if possible - if (this.usedNames.has(l.exported.name)) { - throw new Error(`multiple exports using the name ${l.exported.name}`); - } - - this.usedNames.add(l.exported.name); - this.namesBySymbol.set(l.rootSymbol, l.exported.name); - } - } - for (const i of index.imports) { - this.rootDecsSymbols.add(i.rootSymbol); - } - } - - get(rootSymbol: ts.Symbol, nameFromSource: string) { - if (!this.rootDecsSymbols.has(rootSymbol)) { - return nameFromSource; - } - - const existing = this.namesBySymbol.get(rootSymbol); - if (existing !== undefined) { - return existing; - } - - let counter = 0; - let name = nameFromSource; - while (this.usedNames.has(name) || INVALID_NAMES.includes(name)) { - name = `${nameFromSource}_${++counter}`; - } - - this.usedNames.add(name); - this.namesBySymbol.set(rootSymbol, name); - return name; - } -} diff --git a/packages/kbn-type-summarizer/src/summarize_package.ts b/packages/kbn-type-summarizer/src/summarize_package.ts deleted file mode 100644 index 7ca85a273b43..000000000000 --- a/packages/kbn-type-summarizer/src/summarize_package.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { Logger } from '@kbn/type-summarizer-core'; - -import { createTsProject } from './lib/ts_project'; -import { loadTsConfigFile } from './lib/tsconfig_file'; -import { SourceMapper } from './lib/source_mapper'; -import { AstIndexer } from './lib/ast_indexer'; -import { SourceFileMapper } from './lib/source_file_mapper'; -import { SymbolResolver } from './lib/symbol_resolver'; -import { AstTraverser } from './lib/ast_traverser'; -import { printTypeSummary } from './lib/type_summary'; -import { DtsSnipper } from './lib/dts_snipper'; - -/** - * Options used to customize the summarizePackage function - */ -export interface SummarizePacakgeOptions { - /** - * Absolute path to the directory containing the .d.ts files produced by `tsc`. Maps to the - * `declarationDir` compiler option. - */ - dtsDir: string; - /** - * Absolute path to the tsconfig.json file for the project we are summarizing - */ - tsconfigPath: string; - /** - * Array of absolute paths to the .d.ts files which will be summarized. Each file in this - * array will cause an output .d.ts summary file to be created containing all the AST nodes - * which are exported or referenced by those exports. - */ - inputPath: string; - /** - * Repo-relative path to the package source, for example `packages/kbn-type-summarizer-core` for - * this package. This is used to provide the correct `sourceRoot` path in the resulting source - * map files. - */ - repoRelativePackageDir: string; -} - -/** - * Produce summary .d.ts files for a package - */ -export async function summarizePackage(log: Logger, options: SummarizePacakgeOptions) { - const tsConfig = log.step('load config', options.tsconfigPath, () => - loadTsConfigFile(options.tsconfigPath) - ); - - if (tsConfig.options.sourceRoot) { - throw new Error(`${options.tsconfigPath} must not define "compilerOptions.sourceRoot"`); - } - - const program = log.step('create project', options.inputPath, () => - createTsProject(tsConfig, [options.inputPath]) - ); - - const typeChecker = log.step('create type checker', null, () => program.getTypeChecker()); - - const sources = new SourceFileMapper(options.dtsDir); - const symbols = new SymbolResolver(typeChecker, log); - const traverse = new AstTraverser(symbols, sources, log); - const indexer = new AstIndexer(typeChecker, sources, symbols, traverse, log); - - const sourceFile = program.getSourceFile(options.inputPath); - if (!sourceFile) { - throw new Error(`input file wasn't included in the program`); - } - - const index = indexer.indexExports(sourceFile); - const sourceMaps = await SourceMapper.forSourceFiles( - log, - sources, - options.repoRelativePackageDir, - program - ); - - const snipper = new DtsSnipper(traverse, symbols, log); - const summary = printTypeSummary(sourceMaps, snipper, log, index); - - sourceMaps.close(); - - return summary; -} diff --git a/packages/kbn-type-summarizer/src/tests/integration_helpers.ts b/packages/kbn-type-summarizer/src/tests/integration_helpers.ts deleted file mode 100644 index ebf88faa7db4..000000000000 --- a/packages/kbn-type-summarizer/src/tests/integration_helpers.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fsp from 'fs/promises'; - -import * as ts from 'typescript'; -import stripAnsi from 'strip-ansi'; -import normalizePath from 'normalize-path'; -import { TestLog } from '@kbn/type-summarizer-core'; - -import { loadTsConfigFile } from '../lib/tsconfig_file'; -import { createTsProject } from '../lib/ts_project'; -import { summarizePackage } from '../summarize_package'; -import { SourceFileMapper } from '../lib/source_file_mapper'; -import { AstIndexer } from '../lib/ast_indexer'; -import { SymbolResolver } from '../lib/symbol_resolver'; -import { AstTraverser } from '../lib/ast_traverser'; -import { DtsSnipper } from '../lib/dts_snipper'; -import { SourceMapReader } from './source_map_reader'; - -type DiagFilter = (msg: string) => boolean; - -interface InitOptions { - ignoreDiags?: DiagFilter; -} - -export const TMP_DIR = Path.resolve(__dirname, '../../__tmp__'); - -const DIAGNOSTIC_HOST = { - getCanonicalFileName: (p: string) => p, - getCurrentDirectory: () => process.cwd(), - getNewLine: () => '\n', -}; - -function dedent(string: string) { - const lines = string.split('\n'); - while (lines.length && lines[0].trim() === '') { - lines.shift(); - } - if (lines.length === 0) { - return ''; - } - const indent = lines[0].split('').findIndex((c) => c !== ' '); - return lines.map((l) => l.slice(indent)).join('\n'); -} - -function ensureDts(path: string) { - if (path.endsWith('.d.ts')) { - throw new Error('path should end with .ts, not .d.ts'); - } - return `${path.slice(0, -3)}.d.ts`; -} - -export class TestProject { - /* directory where mockFiles pretend to be from */ - private readonly sourceDir = Path.resolve(TMP_DIR, 'src'); - /* directory where we will write .d.ts versions of mockFiles */ - private readonly dtsOutputDir = Path.resolve(TMP_DIR, 'dist_dts'); - /* path where the tsconfig.json file will be written */ - private readonly tsconfigPath = Path.resolve(this.sourceDir, 'tsconfig.json'); - - /* .d.ts file which we will read to discover the types we need to summarize */ - private readonly inputPath = ensureDts(Path.resolve(this.dtsOutputDir, 'index.ts')); - - private readonly log = new TestLog(); - - constructor( - /* file contents which will be fed into TypeScript for this test */ - private readonly _mockFiles: Record - ) {} - - private *mockFiles() { - for (const [key, value] of Object.entries(this._mockFiles)) { - yield [key, value] as [FileName, string]; - } - } - - private *fileRels() { - for (const key of Object.keys(this._mockFiles)) { - yield key as FileName; - } - } - - /** - * Initialize the TMP_DIR and write files to the sourceDir - */ - private async setupTempDir() { - // write mock files to the filesystem - await Promise.all( - Array.from(this.mockFiles()).map(async ([rel, content]) => { - const path = Path.resolve(this.sourceDir, rel); - await Fsp.mkdir(Path.dirname(path), { recursive: true }); - await Fsp.writeFile(path, dedent(content)); - }) - ); - - // write tsconfig.json to the filesystem - await Fsp.writeFile( - this.tsconfigPath, - JSON.stringify({ - include: [`**/*.ts`, `**/*.tsx`], - compilerOptions: { - moduleResolution: 'node', - target: 'es2021', - module: 'CommonJS', - strict: true, - esModuleInterop: true, - allowSyntheticDefaultImports: true, - declaration: true, - emitDeclarationOnly: true, - declarationDir: '../dist_dts', - declarationMap: true, - types: ['node'], - // prevent loading all @types packages - typeRoots: [], - }, - }) - ); - } - - /** - * convert the source files in the sourceDir to .d.ts files in the dtrOutputDir - */ - private async buildDtsOutput(ignoreDiags?: DiagFilter) { - const program = createTsProject( - loadTsConfigFile(this.tsconfigPath), - Array.from(this.fileRels()) - .map((n) => Path.resolve(this.sourceDir, n)) - .filter((p) => p.endsWith('.ts') || p.endsWith('.tsx')) - ); - - this.printDiagnostics( - [ - [`dts/config`, program.getConfigFileParsingDiagnostics()], - [`dts/global`, program.getGlobalDiagnostics()], - [`dts/options`, program.getOptionsDiagnostics()], - [`dts/semantic`, program.getSemanticDiagnostics()], - [`dts/syntactic`, program.getSyntacticDiagnostics()], - [`dts/declaration`, program.getDeclarationDiagnostics()], - ], - ignoreDiags - ); - - const result = program.emit(undefined, undefined, undefined, true); - - this.printDiagnostics([['dts/results', result.diagnostics]], ignoreDiags); - - // copy .d.ts files from source to dist - for (const [rel, content] of this.mockFiles()) { - if (rel.endsWith('.d.ts')) { - const path = Path.resolve(this.dtsOutputDir, rel); - await Fsp.mkdir(Path.dirname(path), { recursive: true }); - await Fsp.writeFile(path, dedent(content as string)); - } - } - } - - /** - * Print diagnostics from TS so we know when something is wrong in the tests - */ - private printDiagnostics( - types: Array<[type: string, diagnostics: readonly ts.Diagnostic[]]>, - ignoreDiags?: DiagFilter - ) { - const messages = []; - for (const [type, diagnostics] of types) { - const errors = diagnostics.filter((d) => d.category === ts.DiagnosticCategory.Error); - if (!errors.length) { - continue; - } - - const message = ts.formatDiagnosticsWithColorAndContext(errors, DIAGNOSTIC_HOST); - if (ignoreDiags && ignoreDiags(message)) { - continue; - } - messages.push( - ` type(${type}):\n${message - .split('\n') - .map((l) => ` ${l}`) - .join('\n')}` - ); - } - - if (messages.length) { - throw new Error(`TS produced error diagnostics:\n${messages}`); - } - } - - async runTypeSummarizer() { - await this.setupTempDir(); - await this.buildDtsOutput(); - - // summarize the .d.ts files into the output dir - const sourceNode = await summarizePackage(this.log, { - dtsDir: normalizePath(this.dtsOutputDir), - inputPath: normalizePath(this.inputPath), - repoRelativePackageDir: 'src', - tsconfigPath: normalizePath(this.tsconfigPath), - }); - - const { map, code } = sourceNode.toStringWithSourceMap(); - - // return the results - return { - code, - map: await SourceMapReader.snapshot(map, code, this.sourceDir), - logs: stripAnsi(this.log.messages.splice(0).join('')), - }; - } - - async initAstIndexer(options?: InitOptions) { - await this.setupTempDir(); - await this.buildDtsOutput(options?.ignoreDiags); - - const tsConfig = loadTsConfigFile(this.tsconfigPath); - const program = createTsProject(tsConfig, [this.inputPath]); - const typeChecker = program.getTypeChecker(); - const sources = new SourceFileMapper(this.dtsOutputDir); - const symbols = new SymbolResolver(typeChecker, this.log); - const traverse = new AstTraverser(symbols, sources, this.log); - const indexer = new AstIndexer(typeChecker, sources, symbols, traverse, this.log); - const snipper = new DtsSnipper(traverse, symbols, this.log); - - const sourceFiles = Object.fromEntries( - Array.from(this.fileRels()).map((rel) => [ - rel, - program.getSourceFile(Path.resolve(this.dtsOutputDir, this.getDtsRel(rel)))!, - ]) - ) as Record; - - return { program, typeChecker, indexer, sourceFiles, snipper }; - } - - private getDtsRel(rel: string) { - if (!rel.endsWith('.d.ts') && rel.endsWith('.ts')) { - return `${rel.slice(0, -3)}.d.ts`; - } - - return rel; - } - - async cleanup() { - // wipe out the tmp dir - await Fsp.rm(TMP_DIR, { recursive: true, force: true }); - } -} diff --git a/packages/kbn-type-summarizer/src/tests/integration_tests/ast_indexer.test.ts b/packages/kbn-type-summarizer/src/tests/integration_tests/ast_indexer.test.ts deleted file mode 100644 index c453dd2e90c0..000000000000 --- a/packages/kbn-type-summarizer/src/tests/integration_tests/ast_indexer.test.ts +++ /dev/null @@ -1,543 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import ts from 'typescript'; -import { createRecursiveSerializer } from '@kbn/jest-serializers'; -import { describeNode, describeSymbol } from '@kbn/type-summarizer-core'; -import { TestProject, TMP_DIR } from '../integration_helpers'; - -const isObj = (v: any): v is Record => typeof v === 'object' && v !== null; - -expect.addSnapshotSerializer( - createRecursiveSerializer( - (v) => isObj(v) && typeof v.kind === 'number' && ts.SyntaxKind[v.kind] !== undefined, - (v: ts.Node, printRaw) => printRaw(describeNode(v, TMP_DIR)) - ) -); -expect.addSnapshotSerializer( - createRecursiveSerializer( - (v) => isObj(v) && Array.isArray(v.declarations), - (v: ts.Symbol, printRaw) => printRaw(describeSymbol(v, TMP_DIR)) - ) -); - -describe('indexExports()', () => { - describe('simple', () => { - const project = new TestProject({ - 'index.ts': ` - import { Foo } from './foo'; - export { Foo } - export { Bar } from './bar'; - import { Bar } from './bar'; - import { libFn } from 'lib'; - export { libFn } from 'lib'; - import * as A from './a' - export { A } - export type B = Foo | Bar | typeof libFn; - `, - 'foo.ts': ` - export class Foo {} - `, - 'bar.ts': ` - import { Foo } from './foo' - export class Bar extends Foo {} - `, - 'a.ts': ` - export const a = 'a'; - `, - 'node_modules/lib/index.ts': ` - export function libFn() { - } - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('produces valid index', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [ - Object { - "details": Object { - "node": ts.ExportSpecifier (libFn) @ dist_dts/index.d.ts:6:10, - "req": "lib", - "sourceName": "libFn", - "type": "named", - "typesOnly": false, - }, - "exports": Array [ - Object { - "name": "libFn", - "type": "named", - "typeOnly": false, - }, - ], - "localUsageCount": 1, - "rootSymbol": Symbol(ts.FunctionDeclaration (libFn) @ dist_dts/node_modules/lib/index.d.ts:1:1), - "type": "imported decs", - }, - ], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (Foo) @ dist_dts/foo.d.ts:1:1, - ], - "exported": Object { - "name": "Foo", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.ClassDeclaration (Foo) @ dist_dts/foo.d.ts:1:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.ClassDeclaration (Bar) @ dist_dts/bar.d.ts:2:1, - ], - "exported": Object { - "name": "Bar", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.ClassDeclaration (Bar) @ dist_dts/bar.d.ts:2:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.VariableDeclaration (a) @ dist_dts/a.d.ts:1:22, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.VariableDeclaration (a) @ dist_dts/a.d.ts:1:22), - "type": "copied decs", - }, - Object { - "exported": Object { - "name": "A", - "type": "named", - "typeOnly": false, - }, - "members": Map { - "a" => Symbol(ts.VariableDeclaration (a) @ dist_dts/a.d.ts:1:22), - }, - "rootSymbol": Symbol(ts.SourceFile @ dist_dts/a.d.ts:1:1), - "sourceFile": ts.SourceFile @ dist_dts/a.d.ts:1:1, - "type": "namespace dec", - }, - Object { - "decs": Array [ - ts.TypeAliasDeclaration (B) @ dist_dts/index.d.ts:9:1, - ], - "exported": Object { - "name": "B", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.TypeAliasDeclaration (B) @ dist_dts/index.d.ts:9:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('export references', () => { - const project = new TestProject({ - 'index.ts': ` - import type {Class} from './foo' - export function name(i: Class) { - return 'string' - } - `, - 'foo.ts': ` - export class Class {} - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('includes referenced declarations in locals', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (Class) @ dist_dts/foo.d.ts:1:1, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.ClassDeclaration (Class) @ dist_dts/foo.d.ts:1:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:2:1, - ], - "exported": Object { - "name": "name", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:2:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('ambient types', () => { - const project = new TestProject({ - 'index.ts': ` - import './globals' - import './fakemodule' - import { FakeImport } from 'foo' - export async function x(a: SomeGlobal, b: FakeImport): Promise { - return 'foo' - } - `, - 'globals.d.ts': ` - interface SomeGlobal { - foo: true - } - `, - 'fakemodule.d.ts': ` - declare module "foo" { - export interface FakeImport { - bar: true - } - } - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('includes declarations for local ambient types, "ambientRefs" for globals', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [ - Object { - "name": "Promise", - "rootSymbol": Symbol(ts.InterfaceDeclaration (Promise) @ ../../../node_modules/typescript/lib/lib.es5.d.ts:1495:1), - "type": "ambient ref", - }, - ], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.InterfaceDeclaration (SomeGlobal) @ dist_dts/globals.d.ts:1:1, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.InterfaceDeclaration (SomeGlobal) @ dist_dts/globals.d.ts:1:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.InterfaceDeclaration (FakeImport) @ dist_dts/fakemodule.d.ts:2:3, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.InterfaceDeclaration (FakeImport) @ dist_dts/fakemodule.d.ts:2:3), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.FunctionDeclaration (x) @ dist_dts/index.d.ts:4:1, - ], - "exported": Object { - "name": "x", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.FunctionDeclaration (x) @ dist_dts/index.d.ts:4:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('type only exports', () => { - const project = new TestProject({ - 'index.ts': ` - export * from './foo' - `, - 'foo.ts': ` - class Class {} - export type { Class } - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('exports by value one value is exported twice and either is by value', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (Class) @ dist_dts/foo.d.ts:1:1, - ], - "exported": Object { - "name": "Class", - "type": "named", - "typeOnly": true, - }, - "rootSymbol": Symbol(ts.ClassDeclaration (Class) @ dist_dts/foo.d.ts:1:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('export by type combining', () => { - const project = new TestProject({ - 'index.ts': ` - export * from './foo' - export * from './bar' - `, - 'foo.ts': ` - export { Class } from './class' - `, - 'bar.ts': ` - export type { Class } from './class' - `, - 'class.ts': ` - export class Class {} - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('exports by value one value is exported twice and either is by value', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (Class) @ dist_dts/class.d.ts:1:1, - ], - "exported": Object { - "name": "Class", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.ClassDeclaration (Class) @ dist_dts/class.d.ts:1:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('ignores importTypes from node_modules but resolves local import types', () => { - const project = new TestProject({ - 'index.ts': ` - export function name(n: import('./foo').A): import('bar').Bar { - return 'B' - } - `, - 'foo.ts': ` - export class A {} - `, - 'node_modules/bar/index.ts': ` - export type Bar = string | symbol; - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('exports by value one value is exported twice and either is by value', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (A) @ dist_dts/foo.d.ts:1:1, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.ClassDeclaration (A) @ dist_dts/foo.d.ts:1:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:1:1, - ], - "exported": Object { - "name": "name", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:1:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('finds references in importType.typeArguments', () => { - const project = new TestProject({ - 'index.ts': ` - export function name(n: import('./foo').A>) { - return 'B' - } - `, - 'foo.ts': ` - export class A { - n(x: X) { - return x - } - } - export class B {} - `, - 'node_modules/bar/index.ts': ` - export type Bar = Readonly - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('exports by value one value is exported twice and either is by value', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - const index = indexer.indexExports(sourceFiles['index.ts']); - expect(index).toMatchInlineSnapshot(` - Object { - "ambientRefs": Array [], - "imports": Array [], - "locals": Array [ - Object { - "decs": Array [ - ts.ClassDeclaration (A) @ dist_dts/foo.d.ts:1:1, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.ClassDeclaration (A) @ dist_dts/foo.d.ts:1:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.ClassDeclaration (B) @ dist_dts/foo.d.ts:4:1, - ], - "exported": undefined, - "rootSymbol": Symbol(ts.ClassDeclaration (B) @ dist_dts/foo.d.ts:4:1), - "type": "copied decs", - }, - Object { - "decs": Array [ - ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:1:1, - ], - "exported": Object { - "name": "name", - "type": "named", - "typeOnly": false, - }, - "rootSymbol": Symbol(ts.FunctionDeclaration (name) @ dist_dts/index.d.ts:1:1), - "type": "copied decs", - }, - ], - } - `); - }); - }); - - describe('missing node modules', () => { - const project = new TestProject({ - 'index.ts': ` - export * from './foo' - `, - 'foo.ts': ` - import { BaseClass } from 'missing_node_module' - export class Class extends BaseClass { - foo: true - } - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('throws a helpful error when node_modules are missing', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer({ - ignoreDiags: (msg) => msg.includes(`Cannot find module 'missing_node_module'`), - }); - - expect(() => - indexer.indexExports(sourceFiles['index.ts']) - ).toThrowErrorMatchingInlineSnapshot( - `"unable to find declarations for symbol imported from \\"missing_node_module\\". If this is an external module, make sure is it listed in the type dependencies for this package. If it's internal then make sure that TypeScript understands the types of the imported value. Imported: ts.ImportSpecifier (BaseClass) @ packages/kbn-type-summarizer/__tmp__/dist_dts/foo.d.ts:1:10"` - ); - }); - }); - - describe('undeclared symbols', () => { - const project = new TestProject({ - 'index.ts': ` - // @ts-expect-error - export { a } from './foo' - `, - 'foo.js': ` - export function a() {} - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('throws a helpful error when exported symbols are not found', async () => { - const { indexer, sourceFiles } = await project.initAstIndexer(); - - expect(() => - indexer.indexExports(sourceFiles['index.ts']) - ).toThrowErrorMatchingInlineSnapshot( - `"unable to find declarations for symbol imported from \\"./foo\\". If this is an external module, make sure is it listed in the type dependencies for this package. If it's internal then make sure that TypeScript understands the types of the imported value. Imported: ts.ExportSpecifier (a) @ packages/kbn-type-summarizer/__tmp__/dist_dts/index.d.ts:1:10"` - ); - }); - }); -}); diff --git a/packages/kbn-type-summarizer/src/tests/integration_tests/dts_snipper.ts b/packages/kbn-type-summarizer/src/tests/integration_tests/dts_snipper.ts deleted file mode 100644 index 02c8b386cf15..000000000000 --- a/packages/kbn-type-summarizer/src/tests/integration_tests/dts_snipper.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { TestProject } from '../integration_helpers'; - -describe('toSnippets()', () => { - const project = new TestProject({ - 'index.ts': ` - // tsc drops single-line comments - interface Bar { - name: string - } - - /** - * Class Foo - */ - export class Foo { - /** - * Creates a bar - */ - bar(name: string): Bar { - return { name } - } - } - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('produces source, export, and id snippets', async () => { - const { indexer, snipper, sourceFiles } = await project.initAstIndexer(); - - const index = indexer.indexExports(sourceFiles['index.ts']); - const foo = index.locals.find((l) => !!l.exported); - const bar = index.locals.find((l) => !l.exported); - - expect(snipper.toSnippets(foo!.rootSymbol.declarations[0])).toMatchInlineSnapshot(` - Array [ - Object { - "type": "source", - "value": "/** - * Class Foo - */ - ", - }, - Object { - "noExportRequiresDeclare": false, - "type": "export", - }, - Object { - "type": "source", - "value": "declare class ", - }, - Object { - "identifier": ts.Identifier (Foo) @ dist_dts/index.d.ts:7:22, - "rootSymbol": Symbol(ts.ClassDeclaration (Foo) @ dist_dts/index.d.ts:7:1), - "structural": true, - "text": "Foo", - "type": "indentifier", - }, - Object { - "type": "source", - "value": " { - /** - * Creates a bar - */ - ", - }, - Object { - "identifier": ts.Identifier (bar) @ dist_dts/index.d.ts:11:5, - "rootSymbol": Symbol(ts.MethodDeclaration (bar) @ dist_dts/index.d.ts:11:5), - "structural": true, - "text": "bar", - "type": "indentifier", - }, - Object { - "type": "source", - "value": "(name: string): ", - }, - Object { - "identifier": ts.Identifier (Bar) @ dist_dts/index.d.ts:11:24, - "rootSymbol": Symbol(ts.InterfaceDeclaration (Bar) @ dist_dts/index.d.ts:1:1), - "structural": false, - "text": "Bar", - "type": "indentifier", - }, - Object { - "type": "source", - "value": "; - }", - }, - ] - `); - expect(snipper.toSnippets(bar!.rootSymbol.declarations[0])).toMatchInlineSnapshot(` - Array [ - Object { - "noExportRequiresDeclare": false, - "type": "export", - }, - Object { - "type": "source", - "value": "interface ", - }, - Object { - "identifier": ts.Identifier (Bar) @ dist_dts/index.d.ts:1:11, - "rootSymbol": Symbol(ts.InterfaceDeclaration (Bar) @ dist_dts/index.d.ts:1:1), - "structural": true, - "text": "Bar", - "type": "indentifier", - }, - Object { - "type": "source", - "value": " { - ", - }, - Object { - "identifier": ts.Identifier (name) @ dist_dts/index.d.ts:2:5, - "rootSymbol": Symbol(ts.PropertySignature (name) @ dist_dts/index.d.ts:2:5), - "structural": true, - "text": "name", - "type": "indentifier", - }, - Object { - "type": "source", - "value": ": string; - }", - }, - ] - `); - }); -}); diff --git a/packages/kbn-type-summarizer/src/tests/integration_tests/summarize_package.test.ts b/packages/kbn-type-summarizer/src/tests/integration_tests/summarize_package.test.ts deleted file mode 100644 index 7fd3f7ea83b8..000000000000 --- a/packages/kbn-type-summarizer/src/tests/integration_tests/summarize_package.test.ts +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { TestProject } from '../integration_helpers'; - -describe('summarizePackage()', () => { - describe('basic example', () => { - const project = new TestProject({ - 'index.ts': ` - export * from './foo' - export * from './bar' - export * from './baz' - import * as Helpers from './helpers' - export { Helpers } - `, - 'foo.ts': ` - export function foo(name: string) { - return \`hello $\{name}\` - } - `, - 'bar.ts': ` - interface Result { - type: 'success' - } - export class Bar { - doWork(): Result { - return { - type: 'success' - } - } - } - `, - 'baz.ts': ` - import { Bar } from './bar' - import { foo } from './foo' - - export class Baz extends Bar { - hello() { - return foo('baz') - } - } - `, - 'helpers.ts': ` - interface Result { - value: K - } - type A = 'a' - export const a = (): A => 'a' - export const b = (): Result => ({ value: a() }) - `, - }); - - afterEach(async () => { - await project.cleanup(); - }); - - it('produces expected type summary', async () => { - const { code, map, logs } = await project.runTypeSummarizer(); - - expect(code).toMatchInlineSnapshot(` - " - declare type A = 'a'; - - declare const a: () => A - - interface Result { - value: K; - } - - declare const b: () => Result - - declare namespace Helpers { - export { - a, - b, - } - } - export {Helpers} - export declare function foo(name: string): string; - - interface Result_1 { - type: 'success'; - } - - export declare class Bar { - doWork(): Result_1; - } - - export declare class Baz extends Bar { - hello(): string; - } - - " - `); - - expect(map.snapshot).toMatchInlineSnapshot(` - "from A @ 2:13 - to A @ helpers.ts:4:5 - - from a @ 4:14 - to a @ helpers.ts:5:13 - - from Result @ 6:10 - to Result @ helpers.ts:1:10 - - from value @ 7:4 - to value @ helpers.ts:2:2 - - from b @ 10:14 - to b @ helpers.ts:6:13 - - from Helpers @ 12:18 - to interface @ helpers.ts:1:0 - - from foo @ 19:24 - to foo @ foo.ts:1:16 - - from Result_1 @ 21:10 - to Result @ bar.ts:1:10 - - from type @ 22:4 - to type @ bar.ts:2:2 - - from Bar @ 25:21 - to Bar @ bar.ts:4:13 - - from doWork @ 26:4 - to doWork @ bar.ts:5:2 - - from Baz @ 29:21 - to Baz @ baz.ts:4:13 - - from hello @ 30:4 - to hello @ baz.ts:5:2" - `); - - expect(logs).toMatchInlineSnapshot(` - "debg > load config -- packages/kbn-type-summarizer/__tmp__/src/tsconfig.json - debg > create project -- packages/kbn-type-summarizer/__tmp__/dist_dts/index.d.ts - debg > create type checker - debg > indexExports() -- packages/kbn-type-summarizer/__tmp__/dist_dts/index.d.ts - debg verbose steps: - symbols.toRootSymbol()x23 - traverse.findReferencedIdentifiers()x8 - symbols.getForIdentifier()x6 - indexSymbol()x12 - debg loaded sourcemaps for [ - 'packages/kbn-type-summarizer/__tmp__/dist_dts/bar.d.ts', - 'packages/kbn-type-summarizer/__tmp__/dist_dts/baz.d.ts', - 'packages/kbn-type-summarizer/__tmp__/dist_dts/foo.d.ts', - 'packages/kbn-type-summarizer/__tmp__/dist_dts/helpers.d.ts', - 'packages/kbn-type-summarizer/__tmp__/dist_dts/index.d.ts' - ] - debg > printImports() -- 0 imports - debg > printLocals() -- 9 decs - debg verbose steps: - traverse.findStructuralIdentifiers()x8 - traverse.findReferencedIdentifiers()x8 - symbols.getForIdentifier()x18 - symbols.toRootSymbol()x18 - snipper.toSnippets()x8 - " - `); - }); - }); -}); diff --git a/packages/kbn-type-summarizer/src/tests/source_map_reader.ts b/packages/kbn-type-summarizer/src/tests/source_map_reader.ts deleted file mode 100644 index bad4fe492ad4..000000000000 --- a/packages/kbn-type-summarizer/src/tests/source_map_reader.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs'; -import Path from 'path'; - -import { SourceMapConsumer, SourceMapGenerator } from 'source-map'; - -const ID_RE = /[a-z0-9_]+/i; - -export class SourceMapReader { - static async snapshot(generator: SourceMapGenerator, code: string, sourceDir: string) { - const genLines = ['', ...code.split('\n')]; - const readSource = (p: string) => { - const source = Fs.readFileSync(Path.resolve(sourceDir, p), 'utf8'); - return ['', ...source.split('\n')]; - }; - const getId = (line: string, col: number) => { - return line.slice(col).match(ID_RE)?.[0] ?? line; - }; - - const mappings: string[][] = []; - - await SourceMapConsumer.with(generator.toJSON(), undefined, (map) => { - map.eachMapping((mapping) => { - if ( - (mapping.originalColumn as number | boolean | null) === false || - mapping.originalColumn === null - ) { - // these mappings are just to end the previous mapping, we can drop them - return; - } - - const generatedId = getId(genLines[mapping.generatedLine], mapping.generatedColumn); - const originalId = mapping.source - ? getId(readSource(mapping.source)[mapping.originalLine], mapping.originalColumn) - : null; - - mappings.push([ - `from ${generatedId} @ ${mapping.generatedLine}:${mapping.generatedColumn}`, - `to ${originalId} @ ${mapping.source}:${mapping.originalLine}:${mapping.originalColumn}`, - ]); - }); - }); - - return new SourceMapReader( - mappings.map((g) => g.join('\n')).join('\n\n'), - JSON.stringify(generator, null, 2) - ); - } - - constructor(public readonly snapshot: string, public readonly raw: string) {} -} diff --git a/packages/kbn-type-summarizer/tsconfig.json b/packages/kbn-type-summarizer/tsconfig.json deleted file mode 100644 index 57c1dd1c94e0..000000000000 --- a/packages/kbn-type-summarizer/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.bazel.json", - "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ] -} diff --git a/packages/kbn-typed-react-router-config/BUILD.bazel b/packages/kbn-typed-react-router-config/BUILD.bazel deleted file mode 100644 index 841e2b287d7a..000000000000 --- a/packages/kbn-typed-react-router-config/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-typed-react-router-config" -PKG_REQUIRE_NAME = "@kbn/typed-react-router-config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ] -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-io-ts-utils", - "@npm//fp-ts", - "@npm//history", - "@npm//io-ts", - "@npm//lodash", - "@npm//query-string", - "@npm//react", - "@npm//react-router-config", - "@npm//react-router-dom", - "@npm//tslib", - "@npm//utility-types", -] - -TYPES_DEPS = [ - "//packages/kbn-io-ts-utils:npm_module_types", - "@npm//fp-ts", - "@npm//io-ts", - "@npm//query-string", - "@npm//utility-types", - "@npm//@types/history", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react", - "@npm//@types/react-router-config", - "@npm//@types/react-router-dom", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-typed-react-router-config/kibana.jsonc b/packages/kbn-typed-react-router-config/kibana.jsonc index 51882f6266c3..f508346f8c26 100644 --- a/packages/kbn-typed-react-router-config/kibana.jsonc +++ b/packages/kbn-typed-react-router-config/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/typed-react-router-config", - "owner": "@elastic/apm-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/apm-ui" } diff --git a/packages/kbn-typed-react-router-config/package.json b/packages/kbn-typed-react-router-config/package.json index d200aeef5231..44337045ad85 100644 --- a/packages/kbn-typed-react-router-config/package.json +++ b/packages/kbn-typed-react-router-config/package.json @@ -1,9 +1,6 @@ { "name": "@kbn/typed-react-router-config", - "main": "target_node/index.js", - "browser": "target_web/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" -} + "private": true +} \ No newline at end of file diff --git a/packages/kbn-typed-react-router-config/tsconfig.json b/packages/kbn-typed-react-router-config/tsconfig.json index 4c1b75ae89f8..767ba55fb8e3 100644 --- a/packages/kbn-typed-react-router-config/tsconfig.json +++ b/packages/kbn-typed-react-router-config/tsconfig.json @@ -1,10 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, "isolatedModules": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "jest" @@ -13,5 +11,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/io-ts-utils" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-ui-framework/BUILD.bazel b/packages/kbn-ui-framework/BUILD.bazel deleted file mode 100644 index 2e801955a852..000000000000 --- a/packages/kbn-ui-framework/BUILD.bazel +++ /dev/null @@ -1,46 +0,0 @@ -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "pkg_npm") - -PKG_DIRNAME = "kbn-ui-framework" -PKG_REQUIRE_NAME = "@kbn/ui-framework" - -SOURCE_FILES = glob([ - "dist/**/*", -]) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md", -] - -RUNTIME_DEPS = [] - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES + [ - ":srcs", - ], - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-ui-framework/kibana.jsonc b/packages/kbn-ui-framework/kibana.jsonc index eaef655970e3..50a13c97e4fe 100644 --- a/packages/kbn-ui-framework/kibana.jsonc +++ b/packages/kbn-ui-framework/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ui-framework", - "owner": "@elastic/kibana-design", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-design" } diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 3bb1873156be..2b49f1e5a92f 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -1,16 +1,13 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") +load("@npm//webpack-cli:index.bzl", "webpack_cli") -PKG_DIRNAME = "kbn-ui-shared-deps-npm" -PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-npm" - -SOURCE_FILES = glob( +SRCS = glob( [ - "**/*.js", + "index.js", + "src/**/*", ], exclude = [ + "**/test_helpers.ts", "**/*.config.js", "**/*.mock.*", "**/*.test.*", @@ -25,18 +22,18 @@ SOURCE_FILES = glob( ], ) -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - +# deps needed when importing this module from another location RUNTIME_DEPS = [ + "@npm//loader-utils", + "@npm//val-loader", + "//packages/kbn-repo-info", + # deps in the dll need to be included in the sandbox for consumers + # of this DLL (ui-shared-deps-src) because webpack won't actually + # use the DLL version of a package until it has resolved to the same + # relative path as the module which is already included in the DLL manifest + "@npm//core-js", + "@npm//whatwg-fetch", + "@npm//symbol-observable", "@npm//@babel/runtime", "@npm//@elastic/charts", "@npm//@elastic/eui", @@ -45,101 +42,34 @@ RUNTIME_DEPS = [ "@npm//@emotion/react", "@npm//@tanstack/react-query", "@npm//@tanstack/react-query-devtools", - "@npm//babel-loader", - "@npm//core-js", - "@npm//css-loader", + "@npm//classnames", "@npm//fflate", + "@npm//history", "@npm//jquery", - "@npm//loader-utils", - "@npm//mini-css-extract-plugin", + "@npm//lodash", "@npm//moment-timezone", - "@npm//moment", - "@npm//raw-loader", "@npm//react-ace", + "@npm//react-beautiful-dnd", "@npm//react-dom", - "@npm//react-intl", - "@npm//react-is", "@npm//react-router-dom", "@npm//react-router", "@npm//react", "@npm//rxjs", "@npm//styled-components", - "@npm//symbol-observable", "@npm//tslib", - "@npm//url-loader", - "@npm//val-loader", - "@npm//whatwg-fetch", ] -WEBPACK_DEPS = [ - "@npm//clean-webpack-plugin", -] - -TYPES_DEPS = [ - "@npm//@elastic/charts", - "@npm//@elastic/eui", - "@npm//@elastic/numeral", - "@npm//@emotion/cache", - "@npm//@emotion/react", - "@npm//babel-loader", - "@npm//core-js", - "@npm//css-loader", - "@npm//fflate", - "@npm//jquery", - "@npm//loader-utils", - "@npm//mini-css-extract-plugin", - "@npm//moment", - "@npm//moment-timezone", - "@npm//raw-loader", - "@npm//react", - "@npm//react-dom", - "@npm//react-intl", - "@npm//react-is", - "@npm//react-router", - "@npm//react-router-dom", - "@npm//rxjs", - "@npm//styled-components", - "@npm//symbol-observable", - "@npm//url-loader", - "@npm//val-loader", - "@npm//whatwg-fetch", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - allow_js = True, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -webpack( +webpack_cli( name = "shared_built_assets", - data = RUNTIME_DEPS + WEBPACK_DEPS + [ - "//:package.json", - ":srcs", - ":tsconfig", + data = RUNTIME_DEPS + SRCS + [ + "//:.browserslistrc", ":webpack.config.js", + + "@npm//webpack", + "@npm//clean-webpack-plugin", + "@npm//mini-css-extract-plugin", + "@npm//moment", + "@npm//css-loader", ], output_dir = True, args = [ @@ -147,41 +77,23 @@ webpack( "$(location webpack.config.js)", "--output-path", "$(@D)", - "--no-stats" - ], -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", + "--stats=errors-only" ], visibility = ["//visibility:public"], + env = select({ + "//:dist": { + "NODE_ENV": "production", + }, + "//conditions:default": { + "NODE_ENV": "development", + }, + }) ) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], +# +js_library( + name = "kbn-ui-shared-deps-npm", + package_name = "@kbn/ui-shared-deps-npm", + srcs = SRCS + ["package.json"], + deps = RUNTIME_DEPS + [":shared_built_assets"], visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-npm/index.d.ts b/packages/kbn-ui-shared-deps-npm/index.d.ts deleted file mode 100644 index 0541240af8e0..000000000000 --- a/packages/kbn-ui-shared-deps-npm/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -// NOTE, this types for this package are actually based on the index.js -// file, but this file is here so that when loading the source you don't -// have to set `allowJs` for your project - -export type ThemeVersion = 'v8'; -export const distDir: string; -export const dllManifestPath: string; -export const dllFilename: string; -export const publicPathLoader: string; -export function lightCssDistFilename(themeVersion: ThemeVersion): string; -export function darkCssDistFilename(themeVersion: ThemeVersion): string; diff --git a/packages/kbn-ui-shared-deps-npm/index.js b/packages/kbn-ui-shared-deps-npm/index.js index ba82a46359d1..71127860ce5c 100644 --- a/packages/kbn-ui-shared-deps-npm/index.js +++ b/packages/kbn-ui-shared-deps-npm/index.js @@ -10,54 +10,61 @@ * @typedef {'v8'} ThemeVersion */ +const Fs = require('fs'); const Path = require('path'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +const localDist = Path.resolve(__dirname, './shared_built_assets'); +const bazelDist = Path.resolve(REPO_ROOT, 'bazel-bin', Path.relative(REPO_ROOT, localDist)); // extracted const vars -const distDir = Path.resolve(__dirname, '../shared_built_assets'); +const distDir = Fs.existsSync(localDist) ? localDist : bazelDist; const dllManifestPath = Path.resolve(distDir, 'kbn-ui-shared-deps-npm-manifest.json'); const dllFilename = 'kbn-ui-shared-deps-npm.dll.js'; const publicPathLoader = require.resolve('./src/public_path_loader'); -/** - * Absolute path to the distributable directory - */ -exports.distDir = distDir; +module.exports = { + /** + * Absolute path to the distributable directory + */ + distDir, -/** - * Path to dll manifest of modules included in this bundle - */ -exports.dllManifestPath = dllManifestPath; + /** + * Path to dll manifest of modules included in this bundle + */ + dllManifestPath, -/** - * Filename of the main bundle file in the distributable directory - */ -exports.dllFilename = dllFilename; + /** + * Filename of the main bundle file in the distributable directory + */ + dllFilename, -/** - * Filename of the light-theme css file in the distributable directory - * @param {ThemeVersion} themeVersion - */ -exports.lightCssDistFilename = (themeVersion) => { - if (themeVersion !== 'v8') { - throw new Error(`unsupported theme version [${themeVersion}]`); - } + /** + * Webpack loader for configuring the public path lookup from `window.__kbnPublicPath__`. + */ + publicPathLoader, - return 'kbn-ui-shared-deps-npm.v8.light.css'; + /** + * Filename of the light-theme css file in the distributable directory + * @param {ThemeVersion} themeVersion + */ + lightCssDistFilename(themeVersion) { + if (themeVersion !== 'v8') { + throw new Error(`unsupported theme version [${themeVersion}]`); + } + + return 'kbn-ui-shared-deps-npm.v8.light.css'; + }, + + /** + * Filename of the dark-theme css file in the distributable directory + * @param {ThemeVersion} themeVersion + */ + darkCssDistFilename(themeVersion) { + if (themeVersion !== 'v8') { + throw new Error(`unsupported theme version [${themeVersion}]`); + } + + return 'kbn-ui-shared-deps-npm.v8.dark.css'; + }, }; - -/** - * Filename of the dark-theme css file in the distributable directory - * @param {ThemeVersion} themeVersion - */ -exports.darkCssDistFilename = (themeVersion) => { - if (themeVersion !== 'v8') { - throw new Error(`unsupported theme version [${themeVersion}]`); - } - - return 'kbn-ui-shared-deps-npm.v8.dark.css'; -}; - -/** - * Webpack loader for configuring the public path lookup from `window.__kbnPublicPath__`. - */ -exports.publicPathLoader = publicPathLoader; diff --git a/packages/kbn-ui-shared-deps-npm/kibana.jsonc b/packages/kbn-ui-shared-deps-npm/kibana.jsonc index b7d47a5ccff4..91ab8cdfc2b1 100644 --- a/packages/kbn-ui-shared-deps-npm/kibana.jsonc +++ b/packages/kbn-ui-shared-deps-npm/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ui-shared-deps-npm", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ui-shared-deps-npm/package.json b/packages/kbn-ui-shared-deps-npm/package.json index aaefa7f714ce..81f231b467ec 100644 --- a/packages/kbn-ui-shared-deps-npm/package.json +++ b/packages/kbn-ui-shared-deps-npm/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ui-shared-deps-npm", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps-npm/src/public_path_loader.js b/packages/kbn-ui-shared-deps-npm/src/public_path_loader.js index 4f52032b316a..77057cd42686 100644 --- a/packages/kbn-ui-shared-deps-npm/src/public_path_loader.js +++ b/packages/kbn-ui-shared-deps-npm/src/public_path_loader.js @@ -6,16 +6,19 @@ * Side Public License, v 1. */ -const Qs = require('querystring'); // eslint-disable-next-line import/no-extraneous-dependencies const { stringifyRequest } = require('loader-utils'); const VAL_LOADER = require.resolve('val-loader'); const MODULE_CREATOR = require.resolve('./public_path_module_creator'); +/** + * @this {any} this + * @param {string} source + */ module.exports = function (source) { const options = this.query; - const valOpts = Qs.stringify({ key: options.key }); + const valOpts = new URLSearchParams({ key: options.key }).toString(); const req = `${VAL_LOADER}?${valOpts}!${MODULE_CREATOR}`; return `require(${stringifyRequest(this, req)});${source}`; }; diff --git a/packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js b/packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js index 854d0176b7ae..60dbde3cefaf 100644 --- a/packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js +++ b/packages/kbn-ui-shared-deps-npm/src/public_path_module_creator.js @@ -6,6 +6,9 @@ * Side Public License, v 1. */ +/** + * @param {{ key: string }} param0 + */ module.exports = function ({ key }) { return { code: `__webpack_public_path__ = window.__kbnPublicPath__['${key}']`, diff --git a/packages/kbn-ui-shared-deps-npm/tsconfig.json b/packages/kbn-ui-shared-deps-npm/tsconfig.json index e142364eaa18..3feba9269f39 100644 --- a/packages/kbn-ui-shared-deps-npm/tsconfig.json +++ b/packages/kbn-ui-shared-deps-npm/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", + "checkJs": true, "types": [ "node", ] @@ -14,5 +13,9 @@ ], "exclude": [ "**/*.config.js", + "target/**/*", + ], + "kbn_references": [ + "@kbn/repo-info" ] } diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index 791af0ebe188..680751927ad6 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -29,7 +29,7 @@ module.exports = (_, argv) => { externals: { module: 'module', }, - mode: 'production', + mode: process.env.NODE_ENV || 'development', entry: { 'kbn-ui-shared-deps-npm': [ // polyfill code @@ -81,6 +81,7 @@ module.exports = (_, argv) => { '@elastic/eui/dist/eui_theme_light.json', '@elastic/eui/dist/eui_theme_dark.json', '@elastic/numeral', + '@emotion/cache', '@emotion/react', '@tanstack/react-query', '@tanstack/react-query-devtools', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 4dc31e5a51a6..0b350c51331f 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -1,106 +1,38 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") +load("@npm//webpack-cli:index.bzl", "webpack_cli") -PKG_DIRNAME = "kbn-ui-shared-deps-src" -PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-src" +SRCS = glob([ + "index.js", + "webpack.config.js", + "src/**/*", +]) -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.js", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-safer-lodash-set", - "//packages/kbn-analytics", - "//packages/kbn-babel-preset", - "//packages/kbn-datemath", - "//packages/kbn-es-query", - "//packages/kbn-flot-charts", - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "//packages/kbn-monaco", - "//packages/kbn-std", - "//packages/kbn-ui-shared-deps-npm", - "//packages/kbn-ui-theme", - "//packages/kbn-peggy-loader", - "//packages/kbn-rison", -] - -TYPES_DEPS = [ - "//packages/kbn-safer-lodash-set:npm_module_types", - "//packages/kbn-analytics:npm_module_types", - "//packages/kbn-datemath:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-monaco:npm_module_types", - "//packages/kbn-std:npm_module_types", - "//packages/kbn-ui-shared-deps-npm:npm_module_types", - "//packages/kbn-ui-theme:npm_module_types", - "@npm//webpack", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - allow_js = True, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -webpack( +webpack_cli( name = "shared_built_assets", - data = RUNTIME_DEPS + [ - "//:package.json", - ":srcs", - ":tsconfig", - ":webpack.config.js", + data = SRCS + [ + "//:.browserslistrc", + "@npm//webpack", + "@npm//mini-css-extract-plugin", + "@npm//moment", + "@npm//babel-loader", + "@npm//css-loader", + "@npm//url-loader", + "//packages/kbn-ui-shared-deps-npm", + "//packages/kbn-babel-register", + "//packages/kbn-babel-preset", + # packages included in the shared deps src bundle + "//packages/kbn-flot-charts", + "//packages/kbn-ui-theme", + "//packages/kbn-i18n", + "//packages/kbn-i18n-react", + "//packages/kbn-monaco", + "//packages/kbn-datemath", + "//packages/kbn-analytics", + "//packages/kbn-es-query", + "//packages/kbn-std", + "//packages/kbn-safer-lodash-set", + "//packages/kbn-peggy", + "//packages/kbn-peggy-loader", + "//packages/kbn-rison", ], output_dir = True, args = [ @@ -110,39 +42,13 @@ webpack( "$(@D)", "--stats=errors-only" ], -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], + env = select({ + "//:dist": { + "NODE_ENV": "production", + }, + "//conditions:default": { + "NODE_ENV": "development", + }, + }), visibility = ["//visibility:public"], ) diff --git a/packages/kbn-ui-shared-deps-src/kibana.jsonc b/packages/kbn-ui-shared-deps-src/kibana.jsonc index 49da1e45e9d2..39b71b0bd00e 100644 --- a/packages/kbn-ui-shared-deps-src/kibana.jsonc +++ b/packages/kbn-ui-shared-deps-src/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ui-shared-deps-src", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ui-shared-deps-src/package.json b/packages/kbn-ui-shared-deps-src/package.json index 3290d7e60032..fee5d645dd52 100644 --- a/packages/kbn-ui-shared-deps-src/package.json +++ b/packages/kbn-ui-shared-deps-src/package.json @@ -2,7 +2,5 @@ "name": "@kbn/ui-shared-deps-src", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index d975a39e76a3..83a24b7c88d2 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -7,12 +7,18 @@ */ const Path = require('path'); +const Fs = require('fs'); + +const { REPO_ROOT } = require('@kbn/repo-info'); + +const localDist = Path.resolve(__dirname, '../shared_built_assets'); +const bazelDist = Path.resolve(REPO_ROOT, 'bazel-bin', Path.relative(REPO_ROOT, localDist)); // extracted const vars /** * Absolute path to the distributable directory */ -const distDir = Path.resolve(__dirname, '../../shared_built_assets'); +const distDir = Fs.existsSync(localDist) ? localDist : bazelDist; /** * Filename of the main bundle file in the distributable directory diff --git a/packages/kbn-ui-shared-deps-src/tsconfig.json b/packages/kbn-ui-shared-deps-src/tsconfig.json index e142364eaa18..54d86b5eeab7 100644 --- a/packages/kbn-ui-shared-deps-src/tsconfig.json +++ b/packages/kbn-ui-shared-deps-src/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", ] @@ -14,5 +12,20 @@ ], "exclude": [ "**/*.config.js", + "target/**/*", + ], + "kbn_references": [ + "@kbn/ui-theme", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/monaco", + "@kbn/datemath", + "@kbn/flot-charts", + "@kbn/analytics", + "@kbn/es-query", + "@kbn/rison", + "@kbn/std", + "@kbn/safer-lodash-set", + "@kbn/repo-info" ] } diff --git a/packages/kbn-ui-shared-deps-src/webpack.config.js b/packages/kbn-ui-shared-deps-src/webpack.config.js index bebe6eb424f0..e88d10872156 100644 --- a/packages/kbn-ui-shared-deps-src/webpack.config.js +++ b/packages/kbn-ui-shared-deps-src/webpack.config.js @@ -6,6 +6,9 @@ * Side Public License, v 1. */ +// setup ts/pkg support in this webpack process +require('@kbn/babel-register').install(); + const Path = require('path'); const webpack = require('webpack'); @@ -26,7 +29,7 @@ module.exports = { externals: { module: 'module', }, - mode: 'production', + mode: process.env.NODE_ENV || 'development', entry: { 'kbn-ui-shared-deps-src': './src/entry.js', }, @@ -58,7 +61,7 @@ module.exports = { }, { test: /\.peggy$/, - use: ['@kbn/peggy-loader'], + use: [require.resolve('@kbn/peggy-loader')], }, { test: /\.css$/, @@ -71,11 +74,21 @@ module.exports = { limit: 8192, }, }, + { + test: /\.(js|tsx?)$/, + exclude: /[\/\\]node_modules[\/\\](?!@kbn)([^\/\\]+)[\/\\]/, + loader: 'babel-loader', + options: { + babelrc: false, + envName: process.env.NODE_ENV || 'development', + presets: [require.resolve('@kbn/babel-preset/webpack_preset')], + }, + }, ], }, resolve: { - extensions: ['.js', '.ts'], + extensions: ['.js', '.ts', '.tsx'], symlinks: false, alias: { '@elastic/eui$': '@elastic/eui/optimize/es', diff --git a/packages/kbn-ui-theme/BUILD.bazel b/packages/kbn-ui-theme/BUILD.bazel index 4e17de1eb6ab..1bbc558641ab 100644 --- a/packages/kbn-ui-theme/BUILD.bazel +++ b/packages/kbn-ui-theme/BUILD.bazel @@ -1,6 +1,6 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config") load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") +load("//src/dev/bazel:index.bzl", "pkg_npm", "ts_project") PKG_DIRNAME = "kbn-ui-theme" PKG_REQUIRE_NAME = "@kbn/ui-theme" @@ -45,25 +45,11 @@ TYPES_DEPS = [ "@npm//tslib", ] -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ "//:tsconfig.base.json", - "//:tsconfig.bazel.json", ], ) @@ -80,8 +66,8 @@ ts_project( js_library( name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], + srcs = NPM_MODULE_EXTRA_FILES + SRCS, + deps = RUNTIME_DEPS, package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -89,24 +75,11 @@ js_library( js_library( name = "npm_module_types", srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + deps = RUNTIME_DEPS + [":tsc_types"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - pkg_npm( name = "build_types", deps = [":npm_module_types"], diff --git a/packages/kbn-ui-theme/kibana.jsonc b/packages/kbn-ui-theme/kibana.jsonc index 3f90299e8036..db8230d520c0 100644 --- a/packages/kbn-ui-theme/kibana.jsonc +++ b/packages/kbn-ui-theme/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ui-theme", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-ui-theme/package.json b/packages/kbn-ui-theme/package.json index 1577f211eae8..42718ab36b06 100644 --- a/packages/kbn-ui-theme/package.json +++ b/packages/kbn-ui-theme/package.json @@ -2,8 +2,5 @@ "name": "@kbn/ui-theme", "version": "1.0.0", "private": true, - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-ui-theme/tsconfig.json b/packages/kbn-ui-theme/tsconfig.json index 7eae44ef2324..74b96e65f9ec 100644 --- a/packages/kbn-ui-theme/tsconfig.json +++ b/packages/kbn-ui-theme/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["node"] }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-user-profile-components/BUILD.bazel b/packages/kbn-user-profile-components/BUILD.bazel deleted file mode 100644 index d8d88de063f0..000000000000 --- a/packages/kbn-user-profile-components/BUILD.bazel +++ /dev/null @@ -1,121 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-user-profile-components" -PKG_REQUIRE_NAME = "@kbn/user-profile-components" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "//packages/kbn-i18n", - "//packages/kbn-i18n-react", - "@npm//@elastic/eui", -] - -TYPES_DEPS = [ - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-i18n-react:npm_module_types", - "@npm//@elastic/eui", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/enzyme", - "@npm//tslib", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-user-profile-components/kibana.jsonc b/packages/kbn-user-profile-components/kibana.jsonc index d4c7f266fe60..ecd571c98781 100644 --- a/packages/kbn-user-profile-components/kibana.jsonc +++ b/packages/kbn-user-profile-components/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/user-profile-components", - "owner": "@elastic/kibana-security", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-security" } diff --git a/packages/kbn-user-profile-components/package.json b/packages/kbn-user-profile-components/package.json index 86d4c48e2e16..a4f8db277f5a 100644 --- a/packages/kbn-user-profile-components/package.json +++ b/packages/kbn-user-profile-components/package.json @@ -2,8 +2,5 @@ "name": "@kbn/user-profile-components", "version": "1.0.0", "private": true, - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/kbn-user-profile-components/tsconfig.json b/packages/kbn-user-profile-components/tsconfig.json index b9cc115dd126..6f64745691be 100644 --- a/packages/kbn-user-profile-components/tsconfig.json +++ b/packages/kbn-user-profile-components/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -12,5 +10,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-utility-types-jest/BUILD.bazel b/packages/kbn-utility-types-jest/BUILD.bazel deleted file mode 100644 index eaf186c40a3f..000000000000 --- a/packages/kbn-utility-types-jest/BUILD.bazel +++ /dev/null @@ -1,104 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-utility-types-jest" -PKG_REQUIRE_NAME = "@kbn/utility-types-jest" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [] - -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-utility-types-jest/kibana.jsonc b/packages/kbn-utility-types-jest/kibana.jsonc index 83eaa2ce42aa..1eea6e6c96a6 100644 --- a/packages/kbn-utility-types-jest/kibana.jsonc +++ b/packages/kbn-utility-types-jest/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/utility-types-jest", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-utility-types-jest/package.json b/packages/kbn-utility-types-jest/package.json index e057306d4bbd..03c8699b5cd8 100644 --- a/packages/kbn-utility-types-jest/package.json +++ b/packages/kbn-utility-types-jest/package.json @@ -2,7 +2,5 @@ "name": "@kbn/utility-types-jest", "version": "1.0.0", "private": true, - "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/kbn-utility-types-jest/tsconfig.json b/packages/kbn-utility-types-jest/tsconfig.json index 292157c18591..b72f7b0a15c5 100644 --- a/packages/kbn-utility-types-jest/tsconfig.json +++ b/packages/kbn-utility-types-jest/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,8 @@ }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-utility-types/BUILD.bazel b/packages/kbn-utility-types/BUILD.bazel deleted file mode 100644 index 87a665c2a6b4..000000000000 --- a/packages/kbn-utility-types/BUILD.bazel +++ /dev/null @@ -1,108 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-utility-types" -PKG_REQUIRE_NAME = "@kbn/utility-types" - -SOURCE_FILES = glob( - [ - "src/serializable/**", - "src/dot.ts", - "index.ts" - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -RUNTIME_DEPS = [ - "@npm//utility-types", -] - -TYPES_DEPS = [ - "@npm//utility-types", - "@npm//@types/node" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-utility-types/kibana.jsonc b/packages/kbn-utility-types/kibana.jsonc index c041668a7689..4a6528d2ac65 100644 --- a/packages/kbn-utility-types/kibana.jsonc +++ b/packages/kbn-utility-types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/utility-types", - "owner": "@elastic/kibana-core", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-core" } diff --git a/packages/kbn-utility-types/package.json b/packages/kbn-utility-types/package.json index fa0eb82dde2e..65983150712f 100644 --- a/packages/kbn-utility-types/package.json +++ b/packages/kbn-utility-types/package.json @@ -3,9 +3,7 @@ "version": "1.0.0", "private": true, "license": "SSPL-1.0 OR Elastic License 2.0", - "main": "target_node/index.js", "scripts": { "test": "../../node_modules/.bin/tsd src/tsd_tests" - }, - "types": "./target_types/index.d.ts" + } } \ No newline at end of file diff --git a/packages/kbn-utility-types/tsconfig.json b/packages/kbn-utility-types/tsconfig.json index 57347ee107af..7617ed166fe2 100644 --- a/packages/kbn-utility-types/tsconfig.json +++ b/packages/kbn-utility-types/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node" ] }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-utils/BUILD.bazel b/packages/kbn-utils/BUILD.bazel deleted file mode 100644 index b66307a04b53..000000000000 --- a/packages/kbn-utils/BUILD.bazel +++ /dev/null @@ -1,112 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-utils" -PKG_REQUIRE_NAME = "@kbn/utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", - "README.md" -] - -RUNTIME_DEPS = [ - "//packages/kbn-config-schema", - "@npm//load-json-file", - "@npm//tslib", -] - -TYPES_DEPS = [ - "//packages/kbn-config-schema:npm_module_types", - "@npm//load-json-file", - "@npm//tslib", - "@npm//@types/jest", - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [ - ":npm_module", - ], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-utils/index.ts b/packages/kbn-utils/index.ts index 374b9a0b6227..d23c71fad55b 100644 --- a/packages/kbn-utils/index.ts +++ b/packages/kbn-utils/index.ts @@ -6,7 +6,5 @@ * Side Public License, v 1. */ -export * from './src/package_json'; export * from './src/path'; -export * from './src/repo_root'; export * from './src/streams'; diff --git a/packages/kbn-utils/kibana.jsonc b/packages/kbn-utils/kibana.jsonc index 1e6935937f6e..2c4efc0a6765 100644 --- a/packages/kbn-utils/kibana.jsonc +++ b/packages/kbn-utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/utils", - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-utils/package.json b/packages/kbn-utils/package.json index 40a60b179667..3eff9aad7516 100644 --- a/packages/kbn-utils/package.json +++ b/packages/kbn-utils/package.json @@ -1,8 +1,6 @@ { "name": "@kbn/utils", - "main": "./target_node/index.js", "version": "1.0.0", "license": "SSPL-1.0 OR Elastic License 2.0", - "private": true, - "types": "./target_types/index.d.ts" + "private": true } \ No newline at end of file diff --git a/packages/kbn-utils/src/path/index.test.ts b/packages/kbn-utils/src/path/index.test.ts index 5c774d989737..608f3cb2cfeb 100644 --- a/packages/kbn-utils/src/path/index.test.ts +++ b/packages/kbn-utils/src/path/index.test.ts @@ -8,7 +8,7 @@ import { accessSync, constants } from 'fs'; import { getConfigPath, getDataPath, getLogsPath, getConfigDirectory } from '.'; -import { REPO_ROOT } from '../repo_root'; +import { REPO_ROOT } from '@kbn/repo-info'; expect.addSnapshotSerializer( ((rootPath: string = REPO_ROOT, replacement = '') => { diff --git a/packages/kbn-utils/src/path/index.ts b/packages/kbn-utils/src/path/index.ts index c839522441c7..63ca454dd04f 100644 --- a/packages/kbn-utils/src/path/index.ts +++ b/packages/kbn-utils/src/path/index.ts @@ -9,7 +9,7 @@ import { join } from 'path'; import { accessSync, constants } from 'fs'; import { TypeOf, schema } from '@kbn/config-schema'; -import { REPO_ROOT } from '../repo_root'; +import { REPO_ROOT } from '@kbn/repo-info'; const isString = (v: any): v is string => typeof v === 'string'; diff --git a/packages/kbn-utils/tsconfig.json b/packages/kbn-utils/tsconfig.json index 57c1dd1c94e0..6baa222ef8c3 100644 --- a/packages/kbn-utils/tsconfig.json +++ b/packages/kbn-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/kbn-web-worker-stub/README.md b/packages/kbn-web-worker-stub/README.md new file mode 100644 index 000000000000..3a57fb6a97db --- /dev/null +++ b/packages/kbn-web-worker-stub/README.md @@ -0,0 +1,3 @@ +# @kbn/web-worker-stub + +Empty package generated by @kbn/generate diff --git a/packages/kbn-web-worker-stub/index.ts b/packages/kbn-web-worker-stub/index.ts new file mode 100644 index 000000000000..18484468326c --- /dev/null +++ b/packages/kbn-web-worker-stub/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +if (!window.Worker) { + // @ts-expect-error we aren't honoring the real Worker spec here + window.Worker = function Worker() { + this.postMessage = jest.fn(); + + // @ts-expect-error TypeScript doesn't think this exists on the Worker interface + // https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate + this.terminate = jest.fn(); + }; +} + +export {}; diff --git a/packages/kbn-web-worker-stub/jest.config.js b/packages/kbn-web-worker-stub/jest.config.js new file mode 100644 index 000000000000..b643fe9f988f --- /dev/null +++ b/packages/kbn-web-worker-stub/jest.config.js @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-web-worker-stub'], +}; diff --git a/packages/kbn-web-worker-stub/kibana.jsonc b/packages/kbn-web-worker-stub/kibana.jsonc new file mode 100644 index 000000000000..39cf9a07982e --- /dev/null +++ b/packages/kbn-web-worker-stub/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "test-helper", + "id": "@kbn/web-worker-stub", + "owner": "@elastic/kibana-operations", + "devOnly": true +} diff --git a/packages/kbn-web-worker-stub/package.json b/packages/kbn-web-worker-stub/package.json new file mode 100644 index 000000000000..07f40f946f86 --- /dev/null +++ b/packages/kbn-web-worker-stub/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/web-worker-stub", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-web-worker-stub/tsconfig.json b/packages/kbn-web-worker-stub/tsconfig.json new file mode 100644 index 000000000000..b72f7b0a15c5 --- /dev/null +++ b/packages/kbn-web-worker-stub/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-yarn-lock-validator/BUILD.bazel b/packages/kbn-yarn-lock-validator/BUILD.bazel deleted file mode 100644 index 3fb3f4820375..000000000000 --- a/packages/kbn-yarn-lock-validator/BUILD.bazel +++ /dev/null @@ -1,127 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-yarn-lock-validator" -PKG_REQUIRE_NAME = "@kbn/yarn-lock-validator" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/dedent", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//tslib", - "//packages/kbn-utils:npm_module_types", - "//packages/kbn-bazel-packages:npm_module_types", - "//packages/kbn-some-dev-log:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/kbn-yarn-lock-validator/kibana.jsonc b/packages/kbn-yarn-lock-validator/kibana.jsonc index 9ff3e3397559..e4941edaef2f 100644 --- a/packages/kbn-yarn-lock-validator/kibana.jsonc +++ b/packages/kbn-yarn-lock-validator/kibana.jsonc @@ -2,7 +2,5 @@ "type": "shared-common", "id": "@kbn/yarn-lock-validator", "devOnly": true, - "owner": "@elastic/kibana-operations", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-operations" } diff --git a/packages/kbn-yarn-lock-validator/package.json b/packages/kbn-yarn-lock-validator/package.json index 01f9de41f960..87ccae8d9caf 100644 --- a/packages/kbn-yarn-lock-validator/package.json +++ b/packages/kbn-yarn-lock-validator/package.json @@ -2,7 +2,5 @@ "name": "@kbn/yarn-lock-validator", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts b/packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts index 59166bef39e7..c17f16ba0243 100644 --- a/packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts +++ b/packages/kbn-yarn-lock-validator/src/find_production_dependencies.ts @@ -7,7 +7,7 @@ */ import { SomeDevLog } from '@kbn/some-dev-log'; -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { YarnLock } from './yarn_lock'; diff --git a/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts b/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts index 668f2911556c..859a39855f46 100644 --- a/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts +++ b/packages/kbn-yarn-lock-validator/src/validate_yarn_lock.ts @@ -11,7 +11,7 @@ import Fsp from 'fs/promises'; import dedent from 'dedent'; -import { REPO_ROOT, kibanaPackageJson } from '@kbn/utils'; +import { REPO_ROOT, kibanaPackageJson } from '@kbn/repo-info'; import { SomeDevLog } from '@kbn/some-dev-log'; import { discoverBazelPackages } from '@kbn/bazel-packages'; diff --git a/packages/kbn-yarn-lock-validator/src/yarn_lock.ts b/packages/kbn-yarn-lock-validator/src/yarn_lock.ts index 383dcbe09cee..63c164311b23 100644 --- a/packages/kbn-yarn-lock-validator/src/yarn_lock.ts +++ b/packages/kbn-yarn-lock-validator/src/yarn_lock.ts @@ -9,7 +9,7 @@ import Fsp from 'fs/promises'; import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; // @ts-expect-error published types are worthless import * as YarnLockFile from '@yarnpkg/lockfile'; diff --git a/packages/kbn-yarn-lock-validator/tsconfig.json b/packages/kbn-yarn-lock-validator/tsconfig.json index 57c1dd1c94e0..1de53ab58d69 100644 --- a/packages/kbn-yarn-lock-validator/tsconfig.json +++ b/packages/kbn-yarn-lock-validator/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node" @@ -11,5 +9,13 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/bazel-packages", + "@kbn/some-dev-log", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/avatar/solution/BUILD.bazel b/packages/shared-ux/avatar/solution/BUILD.bazel deleted file mode 100644 index d8d9b159db6e..000000000000 --- a/packages/shared-ux/avatar/solution/BUILD.bazel +++ /dev/null @@ -1,153 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "solution" -PKG_REQUIRE_NAME = "@kbn/shared-ux-avatar-solution" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.mdx", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//classnames", - "@npm//enzyme", - "@npm//react", - "@npm//url-loader", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-utility", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/classnames", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/avatar/solution/kibana.jsonc b/packages/shared-ux/avatar/solution/kibana.jsonc index e44bc8bd68b4..6bb90e43260f 100644 --- a/packages/shared-ux/avatar/solution/kibana.jsonc +++ b/packages/shared-ux/avatar/solution/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-avatar-solution", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/avatar/solution/package.json b/packages/shared-ux/avatar/solution/package.json index ab91c7c42257..e72f90428279 100644 --- a/packages/shared-ux/avatar/solution/package.json +++ b/packages/shared-ux/avatar/solution/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-avatar-solution", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/avatar/solution/tsconfig.json b/packages/shared-ux/avatar/solution/tsconfig.json index 5cb7bca42f19..eecf3ed8f5af 100644 --- a/packages/shared-ux/avatar/solution/tsconfig.json +++ b/packages/shared-ux/avatar/solution/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,10 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel b/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel deleted file mode 100644 index 53beaf2faea9..000000000000 --- a/packages/shared-ux/avatar/user_profile/impl/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "avatar-user-profile" -PKG_REQUIRE_NAME = "@kbn/shared-ux-avatar-user-profile-components" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.test.*", - "**/*.stories.*", - ], -) - -SRCS = SOURCE_FILES - -# filegroup( -# name = "srcs", -# srcs = SRCS, -# ) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@elastic/eui", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-utility", - "//packages/kbn-ambient-ui-types", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "//packages/kbn-ambient-ui-types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/avatar/user_profile/impl/kibana.jsonc b/packages/shared-ux/avatar/user_profile/impl/kibana.jsonc index a9ee7697b2d1..0cebb8c02e96 100644 --- a/packages/shared-ux/avatar/user_profile/impl/kibana.jsonc +++ b/packages/shared-ux/avatar/user_profile/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-avatar-user-profile-components", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/avatar/user_profile/impl/package.json b/packages/shared-ux/avatar/user_profile/impl/package.json index 7169836ff187..6af2682d533b 100644 --- a/packages/shared-ux/avatar/user_profile/impl/package.json +++ b/packages/shared-ux/avatar/user_profile/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-avatar-user-profile-components", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/avatar/user_profile/impl/tsconfig.json b/packages/shared-ux/avatar/user_profile/impl/tsconfig.json index d68e5f7ddeff..833908e04503 100644 --- a/packages/shared-ux/avatar/user_profile/impl/tsconfig.json +++ b/packages/shared-ux/avatar/user_profile/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -16,5 +14,12 @@ "*.md*", "**/*.ts", "**/*.md*", + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel deleted file mode 100644 index b16786012c82..000000000000 --- a/packages/shared-ux/button/exit_full_screen/impl/BUILD.bazel +++ /dev/null @@ -1,160 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "kbn-shared-ux-button-exit-full-screen" -PKG_REQUIRE_NAME = "@kbn/shared-ux-button-exit-full-screen" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.mdx", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//classnames", - "@npm//enzyme", - "@npm//react-use", - "@npm//react", - "@npm//url-loader", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-utility", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@types/classnames", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "@npm//react-use", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "//packages/shared-ux/button/exit_full_screen/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/button/exit_full_screen/impl/kibana.jsonc b/packages/shared-ux/button/exit_full_screen/impl/kibana.jsonc index 7cee5d9ff370..c74b644894ae 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/kibana.jsonc +++ b/packages/shared-ux/button/exit_full_screen/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-button-exit-full-screen", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/button/exit_full_screen/impl/package.json b/packages/shared-ux/button/exit_full_screen/impl/package.json index bc56bbeebf40..d79fe2a74ec0 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/package.json +++ b/packages/shared-ux/button/exit_full_screen/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-button-exit-full-screen", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json b/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json index 10624c45bc7c..7dfac8574418 100644 --- a/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/shared-ux-button-exit-full-screen-types", + "@kbn/shared-ux-button-exit-full-screen-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel deleted file mode 100644 index 995904da1dee..000000000000 --- a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-button-exit-full-screen-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@storybook/addon-actions", - "@npm//react", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@storybook/addon-actions", - "//packages/shared-ux/button/exit_full_screen/types:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/button/exit_full_screen/mocks/kibana.jsonc b/packages/shared-ux/button/exit_full_screen/mocks/kibana.jsonc index d1599c1a48bc..27c601e53c53 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/kibana.jsonc +++ b/packages/shared-ux/button/exit_full_screen/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-button-exit-full-screen-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/button/exit_full_screen/mocks/package.json b/packages/shared-ux/button/exit_full_screen/mocks/package.json index ff766d8e9de1..bcda1669c6f1 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/package.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-button-exit-full-screen-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json index a00de7fc7322..fbc11adc9552 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/shared-ux-button-exit-full-screen-types", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/button/exit_full_screen/types/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/types/BUILD.bazel deleted file mode 100644 index 2620c5159380..000000000000 --- a/packages/shared-ux/button/exit_full_screen/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-button-exit-full-screen-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/button/exit_full_screen/types/kibana.jsonc b/packages/shared-ux/button/exit_full_screen/types/kibana.jsonc index 29b91b814208..932f0031e9b5 100644 --- a/packages/shared-ux/button/exit_full_screen/types/kibana.jsonc +++ b/packages/shared-ux/button/exit_full_screen/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-button-exit-full-screen-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/button/exit_full_screen/types/package.json b/packages/shared-ux/button/exit_full_screen/types/package.json index 3e97374b53ea..d5ff454e0a2c 100644 --- a/packages/shared-ux/button/exit_full_screen/types/package.json +++ b/packages/shared-ux/button/exit_full_screen/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-button-exit-full-screen-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/types/tsconfig.json b/packages/shared-ux/button/exit_full_screen/types/tsconfig.json index b863eab85b68..362cc9e727b9 100644 --- a/packages/shared-ux/button/exit_full_screen/types/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/types/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/button_toolbar/BUILD.bazel b/packages/shared-ux/button_toolbar/BUILD.bazel deleted file mode 100644 index e0fcde158bdf..000000000000 --- a/packages/shared-ux/button_toolbar/BUILD.bazel +++ /dev/null @@ -1,145 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "button_toolbar" -PKG_REQUIRE_NAME = "@kbn/shared-ux-button-toolbar" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//react", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/button_toolbar/kibana.jsonc b/packages/shared-ux/button_toolbar/kibana.jsonc index 4a019c677570..2d2b0c9ce82c 100644 --- a/packages/shared-ux/button_toolbar/kibana.jsonc +++ b/packages/shared-ux/button_toolbar/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-button-toolbar", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/button_toolbar/package.json b/packages/shared-ux/button_toolbar/package.json index d74cca7bf9be..9e9aa4ee50f0 100644 --- a/packages/shared-ux/button_toolbar/package.json +++ b/packages/shared-ux/button_toolbar/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-button-toolbar", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/button_toolbar/tsconfig.json b/packages/shared-ux/button_toolbar/tsconfig.json index 158e1387bb88..49ed962217ce 100644 --- a/packages/shared-ux/button_toolbar/tsconfig.json +++ b/packages/shared-ux/button_toolbar/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../tsconfig.bazel.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/card/no_data/impl/BUILD.bazel b/packages/shared-ux/card/no_data/impl/BUILD.bazel deleted file mode 100644 index 38d138d551c8..000000000000 --- a/packages/shared-ux/card/no_data/impl/BUILD.bazel +++ /dev/null @@ -1,150 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-card-no-data" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//enzyme", - "@npm//react", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/shared-ux/link/redirect_app/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/shared-ux/link/redirect_app/impl:npm_module_types", - "//packages/shared-ux/card/no_data/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/card/no_data/impl/kibana.jsonc b/packages/shared-ux/card/no_data/impl/kibana.jsonc index 111ee94f8608..172a06aec065 100644 --- a/packages/shared-ux/card/no_data/impl/kibana.jsonc +++ b/packages/shared-ux/card/no_data/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-card-no-data", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/card/no_data/impl/package.json b/packages/shared-ux/card/no_data/impl/package.json index 42a1bc7007e0..51b0955fbc2d 100644 --- a/packages/shared-ux/card/no_data/impl/package.json +++ b/packages/shared-ux/card/no_data/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-card-no-data", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/card/no_data/impl/tsconfig.json b/packages/shared-ux/card/no_data/impl/tsconfig.json index 5735aa5eceaa..cd9e401f45b0 100644 --- a/packages/shared-ux/card/no_data/impl/tsconfig.json +++ b/packages/shared-ux/card/no_data/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,14 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/shared-ux-link-redirect-app", + "@kbn/shared-ux-card-no-data-types", + "@kbn/shared-ux-card-no-data-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/card/no_data/mocks/BUILD.bazel b/packages/shared-ux/card/no_data/mocks/BUILD.bazel deleted file mode 100644 index 6f0880529243..000000000000 --- a/packages/shared-ux/card/no_data/mocks/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-card-no-data-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@storybook/addon-actions", - "@npm//deepmerge", - "@npm//lodash", - "@npm//react", - "//packages/shared-ux/link/redirect_app/mocks", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@storybook/addon-actions", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react", - "@npm//deepmerge", - "//packages/shared-ux/card/no_data/types:npm_module_types", - "//packages/shared-ux/link/redirect_app/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/card/no_data/mocks/kibana.jsonc b/packages/shared-ux/card/no_data/mocks/kibana.jsonc index 0fb2ac6bc8cd..74acf7936907 100644 --- a/packages/shared-ux/card/no_data/mocks/kibana.jsonc +++ b/packages/shared-ux/card/no_data/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-card-no-data-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/card/no_data/mocks/package.json b/packages/shared-ux/card/no_data/mocks/package.json index 06737fb83c6c..644c718838dd 100644 --- a/packages/shared-ux/card/no_data/mocks/package.json +++ b/packages/shared-ux/card/no_data/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-card-no-data-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/card/no_data/mocks/tsconfig.json b/packages/shared-ux/card/no_data/mocks/tsconfig.json index 8ed0253743ff..605636c685b2 100644 --- a/packages/shared-ux/card/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/card/no_data/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "react", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/shared-ux-card-no-data-types", + "@kbn/shared-ux-link-redirect-app-mocks", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/card/no_data/types/BUILD.bazel b/packages/shared-ux/card/no_data/types/BUILD.bazel deleted file mode 100644 index 1e7469ed02b4..000000000000 --- a/packages/shared-ux/card/no_data/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-card-no-data-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/card/no_data/types/kibana.jsonc b/packages/shared-ux/card/no_data/types/kibana.jsonc index b92d11dee07c..6b7c28376646 100644 --- a/packages/shared-ux/card/no_data/types/kibana.jsonc +++ b/packages/shared-ux/card/no_data/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-card-no-data-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/card/no_data/types/tsconfig.json b/packages/shared-ux/card/no_data/types/tsconfig.json index b863eab85b68..73edcc63080a 100644 --- a/packages/shared-ux/card/no_data/types/tsconfig.json +++ b/packages/shared-ux/card/no_data/types/tsconfig.json @@ -1,12 +1,16 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-link-redirect-app-types", ] } diff --git a/packages/shared-ux/file/context/BUILD.bazel b/packages/shared-ux/file/context/BUILD.bazel deleted file mode 100644 index 0ddce6bf0ca2..000000000000 --- a/packages/shared-ux/file/context/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "context" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-context" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/react", - "//packages/shared-ux/file/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/context/kibana.jsonc b/packages/shared-ux/file/context/kibana.jsonc index 55921ceec305..8d511e381a8d 100644 --- a/packages/shared-ux/file/context/kibana.jsonc +++ b/packages/shared-ux/file/context/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-context", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/context/package.json b/packages/shared-ux/file/context/package.json index 025c4b810137..ec54922394b4 100644 --- a/packages/shared-ux/file/context/package.json +++ b/packages/shared-ux/file/context/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-context", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/context/tsconfig.json b/packages/shared-ux/file/context/tsconfig.json index dc13d1aced52..3f5374f1300f 100644 --- a/packages/shared-ux/file/context/tsconfig.json +++ b/packages/shared-ux/file/context/tsconfig.json @@ -1,13 +1,17 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ ] }, "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-file-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/file_picker/impl/BUILD.bazel b/packages/shared-ux/file/file_picker/impl/BUILD.bazel deleted file mode 100644 index f8bb2f8804ca..000000000000 --- a/packages/shared-ux/file/file_picker/impl/BUILD.bazel +++ /dev/null @@ -1,158 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-picker" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//@elastic/numeral", - "@npm//react", - "@npm//@emotion/react", - "@npm//@emotion/css", - "@npm//rxjs", - "//packages/kbn-i18n", - "//packages/shared-ux/file/util", - "//packages/shared-ux/file/context", - "//packages/shared-ux/file/file_upload/impl", - "//packages/shared-ux/file/image/impl", - "//packages/kbn-shared-ux-utility", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@elastic/numeral", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ambient-ui-types", - "//packages/shared-ux/file/util:npm_module_types", - "//packages/shared-ux/file/context:npm_module_types", - "//packages/shared-ux/file/file_upload/impl:npm_module_types", - "//packages/shared-ux/file/image/impl:npm_module_types", - "//packages/shared-ux/file/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/file_picker/impl/kibana.jsonc b/packages/shared-ux/file/file_picker/impl/kibana.jsonc index 9188feb7ebc1..ab54fb4f2161 100644 --- a/packages/shared-ux/file/file_picker/impl/kibana.jsonc +++ b/packages/shared-ux/file/file_picker/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-picker", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/file_picker/impl/package.json b/packages/shared-ux/file/file_picker/impl/package.json index 80f28c0ccf7f..20a932ab2ef2 100644 --- a/packages/shared-ux/file/file_picker/impl/package.json +++ b/packages/shared-ux/file/file_picker/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-picker", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/file_picker/impl/tsconfig.json b/packages/shared-ux/file/file_picker/impl/tsconfig.json index 0b9ca147ee59..f9e92a6065f3 100644 --- a/packages/shared-ux/file/file_picker/impl/tsconfig.json +++ b/packages/shared-ux/file/file_picker/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "jest", @@ -14,5 +12,19 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/shared-ux-file-util", + "@kbn/shared-ux-file-context", + "@kbn/shared-ux-file-upload", + "@kbn/shared-ux-file-image", + "@kbn/shared-ux-file-types", + "@kbn/shared-ux-file-mocks", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-file-image-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/file_upload/impl/BUILD.bazel b/packages/shared-ux/file/file_upload/impl/BUILD.bazel deleted file mode 100644 index 6a16aeb63dbf..000000000000 --- a/packages/shared-ux/file/file_upload/impl/BUILD.bazel +++ /dev/null @@ -1,155 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-upload" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//react", - "@npm//lodash", - "@npm//@emotion/react", - "@npm//@emotion/css", - "@npm//rxjs", - "//packages/kbn-i18n", - "//packages/kbn-ui-theme", - "//packages/shared-ux/file/util", - "//packages/shared-ux/file/context", - "//packages/kbn-shared-ux-utility", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "@npm//@types/lodash", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-ui-theme:npm_module_types", - "//packages/kbn-ambient-ui-types", - "//packages/shared-ux/file/context:npm_module_types", - "//packages/shared-ux/file/util:npm_module_types", - "//packages/shared-ux/file/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/file_upload/impl/kibana.jsonc b/packages/shared-ux/file/file_upload/impl/kibana.jsonc index 11ad99c84ef5..a091e6e1ec04 100644 --- a/packages/shared-ux/file/file_upload/impl/kibana.jsonc +++ b/packages/shared-ux/file/file_upload/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-upload", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/file_upload/impl/package.json b/packages/shared-ux/file/file_upload/impl/package.json index 060044a0775a..008b307710ff 100644 --- a/packages/shared-ux/file/file_upload/impl/package.json +++ b/packages/shared-ux/file/file_upload/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-upload", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/file_upload/impl/tsconfig.json b/packages/shared-ux/file/file_upload/impl/tsconfig.json index 0b9ca147ee59..81d7704f03f7 100644 --- a/packages/shared-ux/file/file_upload/impl/tsconfig.json +++ b/packages/shared-ux/file/file_upload/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "jest", @@ -14,5 +12,18 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/ui-theme", + "@kbn/shared-ux-file-context", + "@kbn/shared-ux-file-util", + "@kbn/shared-ux-file-types", + "@kbn/utility-types-jest", + "@kbn/shared-ux-file-mocks", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/image/impl/BUILD.bazel b/packages/shared-ux/file/image/impl/BUILD.bazel deleted file mode 100644 index dde834269edd..000000000000 --- a/packages/shared-ux/file/image/impl/BUILD.bazel +++ /dev/null @@ -1,148 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-image" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//react", - "@npm//classnames", - "@npm//@emotion/react", - "@npm//@emotion/css", - "//packages/shared-ux/file/util", - "//packages/kbn-shared-ux-utility", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "@npm//@types/classnames", - "//packages/kbn-ambient-ui-types", - "//packages/shared-ux/file/util:npm_module_types", - "//packages/shared-ux/file/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/image/impl/kibana.jsonc b/packages/shared-ux/file/image/impl/kibana.jsonc index 93a4709c14bc..1f10c9524e6c 100644 --- a/packages/shared-ux/file/image/impl/kibana.jsonc +++ b/packages/shared-ux/file/image/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-image", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/image/impl/package.json b/packages/shared-ux/file/image/impl/package.json index 9b45e313c419..1438cca9f92b 100644 --- a/packages/shared-ux/file/image/impl/package.json +++ b/packages/shared-ux/file/image/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-image", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/image/impl/tsconfig.json b/packages/shared-ux/file/image/impl/tsconfig.json index dad7279f0e30..5404f62040f0 100644 --- a/packages/shared-ux/file/image/impl/tsconfig.json +++ b/packages/shared-ux/file/image/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "jest", @@ -13,5 +11,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-file-util", + "@kbn/shared-ux-file-types", + "@kbn/shared-ux-file-image-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/image/mocks/BUILD.bazel b/packages/shared-ux/file/image/mocks/BUILD.bazel deleted file mode 100644 index 0c25ef25839a..000000000000 --- a/packages/shared-ux/file/image/mocks/BUILD.bazel +++ /dev/null @@ -1,127 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-image-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ ] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/image/mocks/kibana.jsonc b/packages/shared-ux/file/image/mocks/kibana.jsonc index bb4d6a6acca4..79ddeb6e8d7a 100644 --- a/packages/shared-ux/file/image/mocks/kibana.jsonc +++ b/packages/shared-ux/file/image/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-image-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/image/mocks/package.json b/packages/shared-ux/file/image/mocks/package.json index 02f631e8257e..a4bf95cdbcd0 100644 --- a/packages/shared-ux/file/image/mocks/package.json +++ b/packages/shared-ux/file/image/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-image-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/file/image/mocks/tsconfig.json b/packages/shared-ux/file/image/mocks/tsconfig.json index 88aabf570de0..db7f0738c6cf 100644 --- a/packages/shared-ux/file/image/mocks/tsconfig.json +++ b/packages/shared-ux/file/image/mocks/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", ] }, "include": [ "**/*.ts", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/mocks/BUILD.bazel b/packages/shared-ux/file/mocks/BUILD.bazel deleted file mode 100644 index e0df2b7fb962..000000000000 --- a/packages/shared-ux/file/mocks/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//jest", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "//packages/kbn-utility-types-jest:npm_module_types", - "//packages/shared-ux/file/types:npm_module_types", - -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/mocks/kibana.jsonc b/packages/shared-ux/file/mocks/kibana.jsonc index 79247cea3183..587fc49d1a21 100644 --- a/packages/shared-ux/file/mocks/kibana.jsonc +++ b/packages/shared-ux/file/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/mocks/package.json b/packages/shared-ux/file/mocks/package.json index 6be31776d191..5491796cdb7f 100644 --- a/packages/shared-ux/file/mocks/package.json +++ b/packages/shared-ux/file/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/mocks/tsconfig.json b/packages/shared-ux/file/mocks/tsconfig.json index 6711daf2036c..677b4a7a9e2a 100644 --- a/packages/shared-ux/file/mocks/tsconfig.json +++ b/packages/shared-ux/file/mocks/tsconfig.json @@ -1,12 +1,17 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ ] }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/utility-types-jest", + "@kbn/shared-ux-file-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/types/BUILD.bazel b/packages/shared-ux/file/types/BUILD.bazel deleted file mode 100644 index 5ebe604a3fe9..000000000000 --- a/packages/shared-ux/file/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/types/kibana.jsonc b/packages/shared-ux/file/types/kibana.jsonc index f40bdacc6802..becf0ea53cc4 100644 --- a/packages/shared-ux/file/types/kibana.jsonc +++ b/packages/shared-ux/file/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/types/tsconfig.json b/packages/shared-ux/file/types/tsconfig.json index 7b2ef816db91..1e6c78a051db 100644 --- a/packages/shared-ux/file/types/tsconfig.json +++ b/packages/shared-ux/file/types/tsconfig.json @@ -1,14 +1,15 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node" ], }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/file/util/BUILD.bazel b/packages/shared-ux/file/util/BUILD.bazel deleted file mode 100644 index 1fdb6e0500ed..000000000000 --- a/packages/shared-ux/file/util/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "util" -PKG_REQUIRE_NAME = "@kbn/shared-ux-file-util" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//jest", - "@npm//blurhash", - "@npm//rxjs", - "@npm//react-use", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//blurhash", - "@npm//rxjs", - "@npm//react-use", - "//packages/shared-ux/file/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/file/util/kibana.jsonc b/packages/shared-ux/file/util/kibana.jsonc index ef30839a6364..5e63db9a0f1f 100644 --- a/packages/shared-ux/file/util/kibana.jsonc +++ b/packages/shared-ux/file/util/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-file-util", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/file/util/package.json b/packages/shared-ux/file/util/package.json index 91b5fbb76517..028f79ac52fa 100644 --- a/packages/shared-ux/file/util/package.json +++ b/packages/shared-ux/file/util/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-file-util", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/file/util/tsconfig.json b/packages/shared-ux/file/util/tsconfig.json index 47ad657279cb..dd3e7075a6a8 100644 --- a/packages/shared-ux/file/util/tsconfig.json +++ b/packages/shared-ux/file/util/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-file-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/link/redirect_app/impl/BUILD.bazel b/packages/shared-ux/link/redirect_app/impl/BUILD.bazel deleted file mode 100644 index 03946518a9d4..000000000000 --- a/packages/shared-ux/link/redirect_app/impl/BUILD.bazel +++ /dev/null @@ -1,151 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-link-redirect-app" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//react-use", - "@npm//react", - "@npm//rxjs", - "//packages/kbn-shared-ux-utility", - "@npm//@emotion/react", - "@npm//@emotion/css", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "@npm//rxjs", - "@npm//react-use", - "//packages/kbn-ambient-ui-types", - "//packages/shared-ux/link/redirect_app/types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "@npm//@emotion/css", - "@npm//@emotion/react", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/link/redirect_app/impl/kibana.jsonc b/packages/shared-ux/link/redirect_app/impl/kibana.jsonc index 0e18f1baa7d0..4ba057259182 100644 --- a/packages/shared-ux/link/redirect_app/impl/kibana.jsonc +++ b/packages/shared-ux/link/redirect_app/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-link-redirect-app", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/link/redirect_app/impl/package.json b/packages/shared-ux/link/redirect_app/impl/package.json index 5dae14bdd878..2e35d70c5b33 100644 --- a/packages/shared-ux/link/redirect_app/impl/package.json +++ b/packages/shared-ux/link/redirect_app/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-link-redirect-app", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/link/redirect_app/impl/tsconfig.json b/packages/shared-ux/link/redirect_app/impl/tsconfig.json index 361cf19dfaa4..0b564979c2b9 100644 --- a/packages/shared-ux/link/redirect_app/impl/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-utility", + "@kbn/shared-ux-link-redirect-app-types", + "@kbn/shared-ux-link-redirect-app-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel deleted file mode 100644 index 122d9927de5e..000000000000 --- a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-link-redirect-app-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@storybook/addon-actions", - "@npm//rxjs", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@storybook/addon-actions", - "@npm//rxjs", - "//packages/shared-ux/link/redirect_app/types:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/link/redirect_app/mocks/kibana.jsonc b/packages/shared-ux/link/redirect_app/mocks/kibana.jsonc index 4157e73efb5c..3282ed29cba7 100644 --- a/packages/shared-ux/link/redirect_app/mocks/kibana.jsonc +++ b/packages/shared-ux/link/redirect_app/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-link-redirect-app-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/link/redirect_app/mocks/package.json b/packages/shared-ux/link/redirect_app/mocks/package.json index 539bfd8f88c0..1f7ac27d7e11 100644 --- a/packages/shared-ux/link/redirect_app/mocks/package.json +++ b/packages/shared-ux/link/redirect_app/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-link-redirect-app-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json index a00de7fc7322..e1d633ba8896 100644 --- a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/shared-ux-link-redirect-app-types", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/link/redirect_app/types/BUILD.bazel b/packages/shared-ux/link/redirect_app/types/BUILD.bazel deleted file mode 100644 index cabeec3208b4..000000000000 --- a/packages/shared-ux/link/redirect_app/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-link-redirect-app-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/link/redirect_app/types/kibana.jsonc b/packages/shared-ux/link/redirect_app/types/kibana.jsonc index c337cfd46035..7c3f5a0d6d8f 100644 --- a/packages/shared-ux/link/redirect_app/types/kibana.jsonc +++ b/packages/shared-ux/link/redirect_app/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-link-redirect-app-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/link/redirect_app/types/tsconfig.json b/packages/shared-ux/link/redirect_app/types/tsconfig.json index f566d00dd270..fc981ba49dd7 100644 --- a/packages/shared-ux/link/redirect_app/types/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "rxjs", "@types/react", @@ -11,5 +9,8 @@ }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/markdown/impl/BUILD.bazel b/packages/shared-ux/markdown/impl/BUILD.bazel deleted file mode 100644 index bb19abe42c47..000000000000 --- a/packages/shared-ux/markdown/impl/BUILD.bazel +++ /dev/null @@ -1,145 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-markdown" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//enzyme", - "@npm//@elastic/eui", - "//packages/kbn-ambient-ui-types", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "//packages/shared-ux/markdown/mocks", - # "//packages/kbn-shared-ux-markdown-mocks:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/markdown/impl/kibana.jsonc b/packages/shared-ux/markdown/impl/kibana.jsonc index 8e5c57b8efdd..628695702492 100644 --- a/packages/shared-ux/markdown/impl/kibana.jsonc +++ b/packages/shared-ux/markdown/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-markdown", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/markdown/impl/package.json b/packages/shared-ux/markdown/impl/package.json index 55541e9fb54b..6cc6e1081268 100644 --- a/packages/shared-ux/markdown/impl/package.json +++ b/packages/shared-ux/markdown/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-markdown", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/markdown/impl/tsconfig.json b/packages/shared-ux/markdown/impl/tsconfig.json index 60680c404dcd..a17b7a69317e 100644 --- a/packages/shared-ux/markdown/impl/tsconfig.json +++ b/packages/shared-ux/markdown/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,11 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-markdown-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/markdown/mocks/BUILD.bazel b/packages/shared-ux/markdown/mocks/BUILD.bazel deleted file mode 100644 index c6ad9fd3c8e7..000000000000 --- a/packages/shared-ux/markdown/mocks/BUILD.bazel +++ /dev/null @@ -1,140 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-markdown-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@storybook/addon-actions", - "//packages/shared-ux/storybook/mock", - "//packages/shared-ux/markdown/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/react", - "@npm//@storybook/addon-actions", - "@npm//@types/jest", - "@npm//@types/node", - # "//packages/shared-ux/markdown/impl:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", - "//packages/shared-ux/markdown/types:npm_module_types", - -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/markdown/mocks/kibana.jsonc b/packages/shared-ux/markdown/mocks/kibana.jsonc index 12aea510169c..7f362da42b0d 100644 --- a/packages/shared-ux/markdown/mocks/kibana.jsonc +++ b/packages/shared-ux/markdown/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-markdown-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/markdown/mocks/package.json b/packages/shared-ux/markdown/mocks/package.json index 68a15def6151..75b77bb67374 100644 --- a/packages/shared-ux/markdown/mocks/package.json +++ b/packages/shared-ux/markdown/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-markdown-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/markdown/mocks/tsconfig.json b/packages/shared-ux/markdown/mocks/tsconfig.json index c8559330de31..2fe699abba9f 100644 --- a/packages/shared-ux/markdown/mocks/tsconfig.json +++ b/packages/shared-ux/markdown/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "node", "react" @@ -11,5 +9,12 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/shared-ux-storybook-mock", + "@kbn/shared-ux-markdown-types" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/markdown/types/BUILD.bazel b/packages/shared-ux/markdown/types/BUILD.bazel deleted file mode 100644 index 36528f243b5c..000000000000 --- a/packages/shared-ux/markdown/types/BUILD.bazel +++ /dev/null @@ -1,67 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-markdown-types" - -SOURCE_FILES = glob( - [ - "*.d.ts", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) \ No newline at end of file diff --git a/packages/shared-ux/markdown/types/kibana.jsonc b/packages/shared-ux/markdown/types/kibana.jsonc index fdc2a59e089a..7c4c3348bc08 100644 --- a/packages/shared-ux/markdown/types/kibana.jsonc +++ b/packages/shared-ux/markdown/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-markdown-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [], + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/markdown/types/package.json b/packages/shared-ux/markdown/types/package.json index a3b0f4553f0d..af94eddb92a2 100644 --- a/packages/shared-ux/markdown/types/package.json +++ b/packages/shared-ux/markdown/types/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-markdown-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/markdown/types/tsconfig.json b/packages/shared-ux/markdown/types/tsconfig.json index 3cffae3f7033..078865843e59 100644 --- a/packages/shared-ux/markdown/types/tsconfig.json +++ b/packages/shared-ux/markdown/types/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "rxjs", "@types/react", @@ -11,5 +9,8 @@ }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel deleted file mode 100644 index eba6e6ed2ed1..000000000000 --- a/packages/shared-ux/page/analytics_no_data/impl/BUILD.bazel +++ /dev/null @@ -1,144 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-analytics-no-data" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@testing-library", - "//packages/kbn-i18n", - "//packages/shared-ux/page/kibana_no_data/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/kbn-i18n:npm_module_types", - "//packages/shared-ux/page/kibana_no_data/impl:npm_module_types", - "//packages/shared-ux/page/analytics_no_data/types:npm_module_types", - "//packages/kbn-ambient-ui-types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/analytics_no_data/impl/kibana.jsonc b/packages/shared-ux/page/analytics_no_data/impl/kibana.jsonc index 1ef76a4f761f..a971be9527c9 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/kibana.jsonc +++ b/packages/shared-ux/page/analytics_no_data/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-analytics-no-data", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/analytics_no_data/impl/package.json b/packages/shared-ux/page/analytics_no_data/impl/package.json index af1f2d6860a6..21bffd125779 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/package.json +++ b/packages/shared-ux/page/analytics_no_data/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-analytics-no-data", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json b/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json index 7c5977f8a084..6a78f24dff0f 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,15 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/shared-ux-page-kibana-no-data", + "@kbn/shared-ux-page-analytics-no-data-types", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-page-analytics-no-data-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel deleted file mode 100644 index d5f264c1a3a8..000000000000 --- a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-analytics-no-data-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/shared-ux/page/kibana_no_data/mocks", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/shared-ux/page/analytics_no_data/types:npm_module_types", - "//packages/shared-ux/page/kibana_no_data/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/analytics_no_data/mocks/kibana.jsonc b/packages/shared-ux/page/analytics_no_data/mocks/kibana.jsonc index 45fc9923f182..ced2ab2b9a37 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/kibana.jsonc +++ b/packages/shared-ux/page/analytics_no_data/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-analytics-no-data-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/analytics_no_data/mocks/package.json b/packages/shared-ux/page/analytics_no_data/mocks/package.json index cc2fb0317a86..03ce055b2d1c 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/package.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-analytics-no-data-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json index 4703a8ebf5e3..7b0f91bbb706 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/shared-ux-page-analytics-no-data-types", + "@kbn/shared-ux-page-kibana-no-data-mocks", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/analytics_no_data/types/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/types/BUILD.bazel deleted file mode 100644 index ad51a3b2e4bb..000000000000 --- a/packages/shared-ux/page/analytics_no_data/types/BUILD.bazel +++ /dev/null @@ -1,60 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-analytics-no-data-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) - diff --git a/packages/shared-ux/page/analytics_no_data/types/kibana.jsonc b/packages/shared-ux/page/analytics_no_data/types/kibana.jsonc index 622d986a5eec..cc8fc3c87302 100644 --- a/packages/shared-ux/page/analytics_no_data/types/kibana.jsonc +++ b/packages/shared-ux/page/analytics_no_data/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-analytics-no-data-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/analytics_no_data/types/package.json b/packages/shared-ux/page/analytics_no_data/types/package.json index fc410b230bb5..24b27948c803 100644 --- a/packages/shared-ux/page/analytics_no_data/types/package.json +++ b/packages/shared-ux/page/analytics_no_data/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-page-analytics-no-data-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/types/tsconfig.json b/packages/shared-ux/page/analytics_no_data/types/tsconfig.json index b863eab85b68..e34fff5c01f9 100644 --- a/packages/shared-ux/page/analytics_no_data/types/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/types/tsconfig.json @@ -1,12 +1,16 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-page-kibana-no-data-types", ] } diff --git a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel deleted file mode 100644 index 31e391048381..000000000000 --- a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel +++ /dev/null @@ -1,152 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-no-data" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//react", - "//packages/kbn-i18n", - "//packages/shared-ux/prompt/no_data_views/impl", - "//packages/shared-ux/page/no_data_config/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n:npm_module_types", - "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", - "//packages/shared-ux/page/no_data_config/impl:npm_module_types", - "//packages/shared-ux/page/no_data_config/types", - "//packages/shared-ux/page/kibana_no_data/types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_no_data/impl/kibana.jsonc b/packages/shared-ux/page/kibana_no_data/impl/kibana.jsonc index 311fb97cadc1..07de27d7e9aa 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/kibana.jsonc +++ b/packages/shared-ux/page/kibana_no_data/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-no-data", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_no_data/impl/package.json b/packages/shared-ux/page/kibana_no_data/impl/package.json index d929610c0b7a..fe9622adf911 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/package.json +++ b/packages/shared-ux/page/kibana_no_data/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-no-data", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json b/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json index 1f377c27d0e2..8de16912b9e3 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,16 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-prompt-no-data-views", + "@kbn/shared-ux-page-no-data-config", + "@kbn/shared-ux-page-kibana-no-data-types", + "@kbn/shared-ux-page-kibana-no-data-mocks", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-card-no-data", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel deleted file mode 100644 index 4bc5c5b663b7..000000000000 --- a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel +++ /dev/null @@ -1,139 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-no-data-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/shared-ux/card/no_data/mocks", - "//packages/shared-ux/prompt/no_data_views/mocks", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/shared-ux/card/no_data/mocks:npm_module_types", - "//packages/shared-ux/page/kibana_no_data/types:npm_module_types", - "//packages/shared-ux/page/no_data/types", - "//packages/shared-ux/prompt/no_data_views/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_no_data/mocks/kibana.jsonc b/packages/shared-ux/page/kibana_no_data/mocks/kibana.jsonc index f505fe3e4b9f..4d9403bec399 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/kibana.jsonc +++ b/packages/shared-ux/page/kibana_no_data/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-no-data-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_no_data/mocks/package.json b/packages/shared-ux/page/kibana_no_data/mocks/package.json index b5aba9769ed9..1df39cec2aea 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/package.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-no-data-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json index a00de7fc7322..012849eca8ae 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,15 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/shared-ux-card-no-data-mocks", + "@kbn/shared-ux-page-kibana-no-data-types", + "@kbn/shared-ux-prompt-no-data-views-mocks", + "@kbn/shared-ux-storybook-mock", + "@kbn/shared-ux-page-no-data-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/kibana_no_data/types/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/types/BUILD.bazel deleted file mode 100644 index bac8d3711a04..000000000000 --- a/packages/shared-ux/page/kibana_no_data/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-no-data-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_no_data/types/kibana.jsonc b/packages/shared-ux/page/kibana_no_data/types/kibana.jsonc index 5fd40e9bde6a..6bfd4e44a05d 100644 --- a/packages/shared-ux/page/kibana_no_data/types/kibana.jsonc +++ b/packages/shared-ux/page/kibana_no_data/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-no-data-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_no_data/types/package.json b/packages/shared-ux/page/kibana_no_data/types/package.json index e02f5ce674b7..2990f4e6d865 100644 --- a/packages/shared-ux/page/kibana_no_data/types/package.json +++ b/packages/shared-ux/page/kibana_no_data/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-no-data-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/types/tsconfig.json b/packages/shared-ux/page/kibana_no_data/types/tsconfig.json index b863eab85b68..f51e9bf3496f 100644 --- a/packages/shared-ux/page/kibana_no_data/types/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/types/tsconfig.json @@ -1,12 +1,18 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-types", + "@kbn/shared-ux-prompt-no-data-views-types", + "@kbn/shared-ux-card-no-data-types", ] } diff --git a/packages/shared-ux/page/kibana_template/impl/BUILD.bazel b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel deleted file mode 100644 index e58fb156edc5..000000000000 --- a/packages/shared-ux/page/kibana_template/impl/BUILD.bazel +++ /dev/null @@ -1,140 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/shared-ux/page/no_data_config/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/shared-ux/page/no_data_config/impl:npm_module_types", - "//packages/shared-ux/page/kibana_template/types", - "//packages/kbn-ambient-ui-types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_template/impl/kibana.jsonc b/packages/shared-ux/page/kibana_template/impl/kibana.jsonc index cfcef7ec0a15..5b670f59b7d1 100644 --- a/packages/shared-ux/page/kibana_template/impl/kibana.jsonc +++ b/packages/shared-ux/page/kibana_template/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-template", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_template/impl/package.json b/packages/shared-ux/page/kibana_template/impl/package.json index 111538a3dd75..ef3e0dee17b3 100644 --- a/packages/shared-ux/page/kibana_template/impl/package.json +++ b/packages/shared-ux/page/kibana_template/impl/package.json @@ -2,7 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-template", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/impl/tsconfig.json b/packages/shared-ux/page/kibana_template/impl/tsconfig.json index cf7982b9ab1e..d4b2c3e87f59 100644 --- a/packages/shared-ux/page/kibana_template/impl/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,15 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-config", + "@kbn/shared-ux-page-kibana-template-mocks", + "@kbn/shared-ux-page-solution-nav", + "@kbn/shared-ux-page-no-data-types", + "@kbn/shared-ux-page-kibana-template-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel deleted file mode 100644 index c2ec3013e01a..000000000000 --- a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//lodash", - "@npm//react", - "//packages/shared-ux/page/no_data_config/mocks", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@types/node", - "@npm//@types/react", - "//packages/shared-ux/page/kibana_template/types", - "//packages/shared-ux/page/no_data_config/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_template/mocks/kibana.jsonc b/packages/shared-ux/page/kibana_template/mocks/kibana.jsonc index bb870c6ef0f4..29b752ee4a42 100644 --- a/packages/shared-ux/page/kibana_template/mocks/kibana.jsonc +++ b/packages/shared-ux/page/kibana_template/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-template-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_template/mocks/package.json b/packages/shared-ux/page/kibana_template/mocks/package.json index 4541001003f3..c4b77ca7800c 100644 --- a/packages/shared-ux/page/kibana_template/mocks/package.json +++ b/packages/shared-ux/page/kibana_template/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-template-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json index 4c2618f5b3a1..6a11b6ecad99 100644 --- a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,14 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-config-mocks", + "@kbn/shared-ux-storybook-mock", + "@kbn/shared-ux-card-no-data-mocks", + "@kbn/shared-ux-page-kibana-template-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/kibana_template/types/BUILD.bazel b/packages/shared-ux/page/kibana_template/types/BUILD.bazel deleted file mode 100644 index 45cbd0fd4cc4..000000000000 --- a/packages/shared-ux/page/kibana_template/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/kibana_template/types/kibana.jsonc b/packages/shared-ux/page/kibana_template/types/kibana.jsonc index 91518cf55298..eda1aee86b12 100644 --- a/packages/shared-ux/page/kibana_template/types/kibana.jsonc +++ b/packages/shared-ux/page/kibana_template/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-kibana-template-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/kibana_template/types/package.json b/packages/shared-ux/page/kibana_template/types/package.json index 4562e9a1becd..b25f452e8912 100644 --- a/packages/shared-ux/page/kibana_template/types/package.json +++ b/packages/shared-ux/page/kibana_template/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-page-kibana-template-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/types/tsconfig.json b/packages/shared-ux/page/kibana_template/types/tsconfig.json index b863eab85b68..8559d1570106 100644 --- a/packages/shared-ux/page/kibana_template/types/tsconfig.json +++ b/packages/shared-ux/page/kibana_template/types/tsconfig.json @@ -1,12 +1,17 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-page-solution-nav", + "@kbn/shared-ux-page-no-data-config-types", ] } diff --git a/packages/shared-ux/page/no_data/impl/BUILD.bazel b/packages/shared-ux/page/no_data/impl/BUILD.bazel deleted file mode 100644 index 040968fa5255..000000000000 --- a/packages/shared-ux/page/no_data/impl/BUILD.bazel +++ /dev/null @@ -1,148 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//classnames", - "@npm//react", - "//packages/shared-ux/avatar/solution", - "//packages/shared-ux/card/no_data/impl", - "//packages/shared-ux/prompt/no_data_views/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/classnames", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/shared-ux/avatar/solution:npm_module_types", - "//packages/shared-ux/card/no_data/impl:npm_module_types", - "//packages/shared-ux/page/no_data/types:npm_module_types", - "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data/impl/kibana.jsonc b/packages/shared-ux/page/no_data/impl/kibana.jsonc index e651af8c1de0..26e30ef8c15f 100644 --- a/packages/shared-ux/page/no_data/impl/kibana.jsonc +++ b/packages/shared-ux/page/no_data/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data/impl/package.json b/packages/shared-ux/page/no_data/impl/package.json index 61a823cc5e7a..7af98cdf3fa4 100644 --- a/packages/shared-ux/page/no_data/impl/package.json +++ b/packages/shared-ux/page/no_data/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-no-data", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/no_data/impl/tsconfig.json b/packages/shared-ux/page/no_data/impl/tsconfig.json index ce5320536e56..99daacfdb708 100644 --- a/packages/shared-ux/page/no_data/impl/tsconfig.json +++ b/packages/shared-ux/page/no_data/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,17 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/shared-ux-avatar-solution", + "@kbn/shared-ux-card-no-data", + "@kbn/shared-ux-page-no-data-types", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-page-no-data-mocks", + "@kbn/i18n", + "@kbn/i18n-react", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/no_data/mocks/BUILD.bazel b/packages/shared-ux/page/no_data/mocks/BUILD.bazel deleted file mode 100644 index 52b1806936a2..000000000000 --- a/packages/shared-ux/page/no_data/mocks/BUILD.bazel +++ /dev/null @@ -1,137 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@storybook/addon-actions", - "//packages/shared-ux/card/no_data/mocks", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/shared-ux/page/no_data/types:npm_module_types", - "//packages/shared-ux/card/no_data/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data/mocks/kibana.jsonc b/packages/shared-ux/page/no_data/mocks/kibana.jsonc index 0062ac6548d6..cbcf8d5376a6 100644 --- a/packages/shared-ux/page/no_data/mocks/kibana.jsonc +++ b/packages/shared-ux/page/no_data/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data/mocks/package.json b/packages/shared-ux/page/no_data/mocks/package.json index f3b8c22a03da..341a66ccbf3a 100644 --- a/packages/shared-ux/page/no_data/mocks/package.json +++ b/packages/shared-ux/page/no_data/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-no-data-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/no_data/mocks/tsconfig.json b/packages/shared-ux/page/no_data/mocks/tsconfig.json index 4703a8ebf5e3..a7ff059474ec 100644 --- a/packages/shared-ux/page/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/no_data/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-types", + "@kbn/shared-ux-card-no-data-mocks", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/no_data/types/BUILD.bazel b/packages/shared-ux/page/no_data/types/BUILD.bazel deleted file mode 100644 index 618a82a8f6a9..000000000000 --- a/packages/shared-ux/page/no_data/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data/types/kibana.jsonc b/packages/shared-ux/page/no_data/types/kibana.jsonc index 504a436c62f4..2e79352fbd5f 100644 --- a/packages/shared-ux/page/no_data/types/kibana.jsonc +++ b/packages/shared-ux/page/no_data/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data/types/package.json b/packages/shared-ux/page/no_data/types/package.json index 8e9dce1b11f4..c5c6423cdeda 100644 --- a/packages/shared-ux/page/no_data/types/package.json +++ b/packages/shared-ux/page/no_data/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-page-no-data-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/page/no_data/types/tsconfig.json b/packages/shared-ux/page/no_data/types/tsconfig.json index b863eab85b68..cb496086a1a0 100644 --- a/packages/shared-ux/page/no_data/types/tsconfig.json +++ b/packages/shared-ux/page/no_data/types/tsconfig.json @@ -1,12 +1,16 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-card-no-data-types", ] } diff --git a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel deleted file mode 100644 index 2aee71ee7367..000000000000 --- a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//classnames", - "@npm//@elastic/eui", - "//packages/shared-ux/page/solution_nav", - "//packages/shared-ux/page/no_data/impl", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//classnames", - "@npm//@elastic/eui", - "//packages/shared-ux/page/solution_nav:npm_module_types", - "//packages/shared-ux/page/no_data/impl:npm_module_types", - "//packages/shared-ux/page/no_data_config/types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data_config/impl/kibana.jsonc b/packages/shared-ux/page/no_data_config/impl/kibana.jsonc index bc2c3be18cb3..eac1472b6493 100644 --- a/packages/shared-ux/page/no_data_config/impl/kibana.jsonc +++ b/packages/shared-ux/page/no_data_config/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data-config", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data_config/impl/package.json b/packages/shared-ux/page/no_data_config/impl/package.json index a30692bf9870..5ade0b28dd2b 100644 --- a/packages/shared-ux/page/no_data_config/impl/package.json +++ b/packages/shared-ux/page/no_data_config/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-no-data-config", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/no_data_config/impl/tsconfig.json b/packages/shared-ux/page/no_data_config/impl/tsconfig.json index 7c5977f8a084..f30535d1df3e 100644 --- a/packages/shared-ux/page/no_data_config/impl/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,15 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/shared-ux-page-solution-nav", + "@kbn/shared-ux-page-no-data", + "@kbn/shared-ux-page-no-data-config-types", + "@kbn/shared-ux-page-no-data-config-mocks", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel deleted file mode 100644 index 3906ada90b43..000000000000 --- a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/shared-ux/page/no_data/mocks", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/shared-ux/page/no_data_config/types", - "//packages/shared-ux/page/no_data/mocks:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data_config/mocks/kibana.jsonc b/packages/shared-ux/page/no_data_config/mocks/kibana.jsonc index b1da5fdb4c0c..0faf3792e610 100644 --- a/packages/shared-ux/page/no_data_config/mocks/kibana.jsonc +++ b/packages/shared-ux/page/no_data_config/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data-config-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data_config/mocks/package.json b/packages/shared-ux/page/no_data_config/mocks/package.json index 4277f81e3dcf..df7b57c3a878 100644 --- a/packages/shared-ux/page/no_data_config/mocks/package.json +++ b/packages/shared-ux/page/no_data_config/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-no-data-config-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json index 4703a8ebf5e3..8512e6c9fe15 100644 --- a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,13 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-mocks", + "@kbn/shared-ux-storybook-mock", + "@kbn/shared-ux-page-no-data-config-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/page/no_data_config/types/BUILD.bazel b/packages/shared-ux/page/no_data_config/types/BUILD.bazel deleted file mode 100644 index 6fa1669fcc17..000000000000 --- a/packages/shared-ux/page/no_data_config/types/BUILD.bazel +++ /dev/null @@ -1,59 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/no_data_config/types/kibana.jsonc b/packages/shared-ux/page/no_data_config/types/kibana.jsonc index 968460e15142..2a3266cdadbb 100644 --- a/packages/shared-ux/page/no_data_config/types/kibana.jsonc +++ b/packages/shared-ux/page/no_data_config/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-no-data-config-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/no_data_config/types/package.json b/packages/shared-ux/page/no_data_config/types/package.json index 1af47fb4c502..bee372ead1ad 100644 --- a/packages/shared-ux/page/no_data_config/types/package.json +++ b/packages/shared-ux/page/no_data_config/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-page-no-data-config-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/page/no_data_config/types/tsconfig.json b/packages/shared-ux/page/no_data_config/types/tsconfig.json index b863eab85b68..0a4ee6d632cc 100644 --- a/packages/shared-ux/page/no_data_config/types/tsconfig.json +++ b/packages/shared-ux/page/no_data_config/types/tsconfig.json @@ -1,12 +1,16 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/shared-ux-page-no-data-types", ] } diff --git a/packages/shared-ux/page/solution_nav/BUILD.bazel b/packages/shared-ux/page/solution_nav/BUILD.bazel deleted file mode 100644 index 9dc4115016d6..000000000000 --- a/packages/shared-ux/page/solution_nav/BUILD.bazel +++ /dev/null @@ -1,152 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "solution_nav" -PKG_REQUIRE_NAME = "@kbn/shared-ux-page-solution-nav" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.scss", - "**/*.mdx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//classnames", - "@npm//enzyme", - "@npm//react",\ - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/shared-ux/avatar/solution", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@types/classnames", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/shared-ux/avatar/solution:npm_module_types", - "//packages/shared-ux/page/kibana_template/types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/page/solution_nav/kibana.jsonc b/packages/shared-ux/page/solution_nav/kibana.jsonc index 0b89ad3a44b0..8a565ba93472 100644 --- a/packages/shared-ux/page/solution_nav/kibana.jsonc +++ b/packages/shared-ux/page/solution_nav/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-page-solution-nav", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/page/solution_nav/package.json b/packages/shared-ux/page/solution_nav/package.json index 3f07febd136f..8b4b8f3165a6 100644 --- a/packages/shared-ux/page/solution_nav/package.json +++ b/packages/shared-ux/page/solution_nav/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-page-solution-nav", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/solution_nav/tsconfig.json b/packages/shared-ux/page/solution_nav/tsconfig.json index 5cb7bca42f19..dde4935440f7 100644 --- a/packages/shared-ux/page/solution_nav/tsconfig.json +++ b/packages/shared-ux/page/solution_nav/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -14,5 +12,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/shared-ux-avatar-solution", ] } diff --git a/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel deleted file mode 100644 index 8d0d5f073375..000000000000 --- a/packages/shared-ux/prompt/no_data_views/impl/BUILD.bazel +++ /dev/null @@ -1,156 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "impl" -PKG_REQUIRE_NAME = "@kbn/shared-ux-prompt-no-data-views" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx", - "**/*.svg", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//enzyme", - "@npm//react", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-utility", - "//packages/kbn-test-jest-helpers", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", - "@npm//@types/enzyme", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", - "//packages/kbn-test-jest-helpers:npm_module_types", - "//packages/shared-ux/prompt/no_data_views/types:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/prompt/no_data_views/impl/kibana.jsonc b/packages/shared-ux/prompt/no_data_views/impl/kibana.jsonc index 416e58e250d1..c5fb048c6809 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/kibana.jsonc +++ b/packages/shared-ux/prompt/no_data_views/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-prompt-no-data-views", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/prompt/no_data_views/impl/package.json b/packages/shared-ux/prompt/no_data_views/impl/package.json index 2be74fd5f567..b28e9c767bb9 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/package.json +++ b/packages/shared-ux/prompt/no_data_views/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-prompt-no-data-views", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json b/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json index 5893035fdd77..5da3eb228470 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -15,5 +13,16 @@ "include": [ "**/*.ts", "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/shared-ux-utility", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-prompt-no-data-views-types", + "@kbn/shared-ux-prompt-no-data-views-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel deleted file mode 100644 index c30e7a9c03cf..000000000000 --- a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel +++ /dev/null @@ -1,136 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-prompt-no-data-views-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@storybook/addon-actions", - "@npm//react", - "//packages/shared-ux/storybook/mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@storybook/addon-actions", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", - "//packages/shared-ux/prompt/no_data_views/types:npm_module_types", - "//packages/shared-ux/storybook/mock:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/prompt/no_data_views/mocks/kibana.jsonc b/packages/shared-ux/prompt/no_data_views/mocks/kibana.jsonc index 07cf434cde4a..29c18ad857af 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/kibana.jsonc +++ b/packages/shared-ux/prompt/no_data_views/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-prompt-no-data-views-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/prompt/no_data_views/mocks/package.json b/packages/shared-ux/prompt/no_data_views/mocks/package.json index 4485a0918cda..454408d9cee1 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/package.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-prompt-no-data-views-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json index a00de7fc7322..8445aacb692b 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,12 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/shared-ux-prompt-no-data-views-types", + "@kbn/shared-ux-storybook-mock" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/prompt/no_data_views/types/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/types/BUILD.bazel deleted file mode 100644 index bfaf94b0b721..000000000000 --- a/packages/shared-ux/prompt/no_data_views/types/BUILD.bazel +++ /dev/null @@ -1,60 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-prompt-no-data-views-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) - diff --git a/packages/shared-ux/prompt/no_data_views/types/kibana.jsonc b/packages/shared-ux/prompt/no_data_views/types/kibana.jsonc index 54785567d8b0..6aa07c20b34e 100644 --- a/packages/shared-ux/prompt/no_data_views/types/kibana.jsonc +++ b/packages/shared-ux/prompt/no_data_views/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-prompt-no-data-views-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/prompt/no_data_views/types/package.json b/packages/shared-ux/prompt/no_data_views/types/package.json index dce78ded678b..79b0186dbc63 100644 --- a/packages/shared-ux/prompt/no_data_views/types/package.json +++ b/packages/shared-ux/prompt/no_data_views/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-prompt-no-data-views-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/types/tsconfig.json b/packages/shared-ux/prompt/no_data_views/types/tsconfig.json index b863eab85b68..362cc9e727b9 100644 --- a/packages/shared-ux/prompt/no_data_views/types/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/types/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../../../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/prompt/not_found/BUILD.bazel b/packages/shared-ux/prompt/not_found/BUILD.bazel deleted file mode 100644 index 019224c4d037..000000000000 --- a/packages/shared-ux/prompt/not_found/BUILD.bazel +++ /dev/null @@ -1,142 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "errors" -PKG_REQUIRE_NAME = "@kbn/shared-ux-prompt-error" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.png", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//@elastic/eui", - "//packages/kbn-i18n" -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/eui", - "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ] -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "build_types", - srcs = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/prompt/not_found/kibana.jsonc b/packages/shared-ux/prompt/not_found/kibana.jsonc index dfcbc505ab65..70ecc1dbf1eb 100644 --- a/packages/shared-ux/prompt/not_found/kibana.jsonc +++ b/packages/shared-ux/prompt/not_found/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-prompt-not-found", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/prompt/not_found/package.json b/packages/shared-ux/prompt/not_found/package.json index e28ff82ce6c2..d79914ea7306 100644 --- a/packages/shared-ux/prompt/not_found/package.json +++ b/packages/shared-ux/prompt/not_found/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-prompt-not-found", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "types": "./target_types/index.d.ts", "license": "SSPL-1.0 OR Elastic License 2.0" } diff --git a/packages/shared-ux/prompt/not_found/tsconfig.json b/packages/shared-ux/prompt/not_found/tsconfig.json index 044531bb66de..6b098efdfa67 100644 --- a/packages/shared-ux/prompt/not_found/tsconfig.json +++ b/packages/shared-ux/prompt/not_found/tsconfig.json @@ -1,10 +1,14 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": ["jest", "node", "react", "@kbn/ambient-ui-types"] }, - "include": ["**/*.ts", "**/*.tsx"] + "include": ["**/*.ts", "**/*.tsx"], + "kbn_references": [ + "@kbn/i18n" + ], + "exclude": [ + "target/**/*", + ] } diff --git a/packages/shared-ux/router/impl/BUILD.bazel b/packages/shared-ux/router/impl/BUILD.bazel deleted file mode 100644 index a008a5d15df5..000000000000 --- a/packages/shared-ux/router/impl/BUILD.bazel +++ /dev/null @@ -1,138 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "shared-ux-router" -PKG_REQUIRE_NAME = "@kbn/shared-ux-router" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - "**/*.mdx" - ], - exclude = [ - "**/*.test.*", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "@npm//react-router-dom", - "@npm//react-use", - "@npm//rxjs", - "//packages/kbn-shared-ux-utility", - "//packages/kbn-test-jest-helpers", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@types/react-router-dom", - "@npm//react-use", - "@npm//rxjs", - "//packages/kbn-shared-ux-utility:npm_module_types", - "//packages/shared-ux/router/types:npm_module_types", - "//packages/kbn-ambient-ui-types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/router/impl/kibana.jsonc b/packages/shared-ux/router/impl/kibana.jsonc index e1e6e614e9d6..5ecf4e1e558d 100644 --- a/packages/shared-ux/router/impl/kibana.jsonc +++ b/packages/shared-ux/router/impl/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-router", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/router/impl/package.json b/packages/shared-ux/router/impl/package.json index 6c80fa334caa..78239954823b 100644 --- a/packages/shared-ux/router/impl/package.json +++ b/packages/shared-ux/router/impl/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-router", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/router/impl/tsconfig.json b/packages/shared-ux/router/impl/tsconfig.json index 475b363297f6..13e290e2dea0 100644 --- a/packages/shared-ux/router/impl/tsconfig.json +++ b/packages/shared-ux/router/impl/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,10 @@ }, "include": [ "**/*", + ], + "kbn_references": [ + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/router/mocks/BUILD.bazel b/packages/shared-ux/router/mocks/BUILD.bazel deleted file mode 100644 index 6a7e263075e8..000000000000 --- a/packages/shared-ux/router/mocks/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mocks" -PKG_REQUIRE_NAME = "@kbn/shared-ux-router-mocks" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__", - "**/integration_tests", - "**/mocks", - "**/scripts", - "**/storybook", - "**/test_fixtures", - "**/test_helpers", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react" -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - root_dir = ".", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/router/mocks/kibana.jsonc b/packages/shared-ux/router/mocks/kibana.jsonc index 858c88c76e20..73750134ebdf 100644 --- a/packages/shared-ux/router/mocks/kibana.jsonc +++ b/packages/shared-ux/router/mocks/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-router-mocks", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/router/mocks/package.json b/packages/shared-ux/router/mocks/package.json index a4dcbf97cb77..7ee5c2cc0799 100644 --- a/packages/shared-ux/router/mocks/package.json +++ b/packages/shared-ux/router/mocks/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-router-mocks", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/router/mocks/tsconfig.json b/packages/shared-ux/router/mocks/tsconfig.json index 37f8e83d0d7a..e71c7853b63f 100644 --- a/packages/shared-ux/router/mocks/tsconfig.json +++ b/packages/shared-ux/router/mocks/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -13,5 +11,8 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/router/types/BUILD.bazel b/packages/shared-ux/router/types/BUILD.bazel deleted file mode 100644 index b33071f126ef..000000000000 --- a/packages/shared-ux/router/types/BUILD.bazel +++ /dev/null @@ -1,60 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "types" -PKG_REQUIRE_NAME = "@kbn/shared-ux-router-types" - -SRCS = glob( - [ - "*.d.ts", - ] -) - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -js_library( - name = PKG_DIRNAME, - srcs = SRCS + NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS, - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -alias( - name = "npm_module_types", - actual = ":" + PKG_DIRNAME, - visibility = ["//visibility:public"], -) - diff --git a/packages/shared-ux/router/types/kibana.jsonc b/packages/shared-ux/router/types/kibana.jsonc index 2a8021f3a203..11df98571de3 100644 --- a/packages/shared-ux/router/types/kibana.jsonc +++ b/packages/shared-ux/router/types/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-router-types", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/router/types/package.json b/packages/shared-ux/router/types/package.json index 323e9848a50a..506ca06280ac 100644 --- a/packages/shared-ux/router/types/package.json +++ b/packages/shared-ux/router/types/package.json @@ -2,6 +2,5 @@ "name": "@kbn/shared-ux-router-types", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/router/types/tsconfig.json b/packages/shared-ux/router/types/tsconfig.json index 9b572c50a398..cf858a91253d 100644 --- a/packages/shared-ux/router/types/tsconfig.json +++ b/packages/shared-ux/router/types/tsconfig.json @@ -1,12 +1,13 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [] }, "include": [ "*.d.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/storybook/config/BUILD.bazel b/packages/shared-ux/storybook/config/BUILD.bazel deleted file mode 100644 index 9451199caf5c..000000000000 --- a/packages/shared-ux/storybook/config/BUILD.bazel +++ /dev/null @@ -1,139 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "config" -PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook-config" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "//packages/kbn-storybook", - "@npm//@storybook/react", - "@npm//@storybook/addon-actions", - "@npm//jest-mock", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "//packages/kbn-storybook:npm_module_types", - "//packages/kbn-ambient-ui-types:npm_module_types", - "//packages/kbn-ambient-storybook-types:npm_module_types", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//jest-mock", - "@npm//@storybook/react", - "@npm//@storybook/addon-actions", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/storybook/config/kibana.jsonc b/packages/shared-ux/storybook/config/kibana.jsonc index 943577a87ff9..46f41bb01eb8 100644 --- a/packages/shared-ux/storybook/config/kibana.jsonc +++ b/packages/shared-ux/storybook/config/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-storybook-config", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/storybook/config/package.json b/packages/shared-ux/storybook/config/package.json index bcf7b626d7a2..641267908edf 100644 --- a/packages/shared-ux/storybook/config/package.json +++ b/packages/shared-ux/storybook/config/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-storybook-config", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/config/tsconfig.json b/packages/shared-ux/storybook/config/tsconfig.json index 8beb0a5da38a..7b41c512d4ef 100644 --- a/packages/shared-ux/storybook/config/tsconfig.json +++ b/packages/shared-ux/storybook/config/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,11 @@ }, "include": [ "**/*.ts" + ], + "kbn_references": [ + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/packages/shared-ux/storybook/mock/BUILD.bazel b/packages/shared-ux/storybook/mock/BUILD.bazel deleted file mode 100644 index 2b5961793820..000000000000 --- a/packages/shared-ux/storybook/mock/BUILD.bazel +++ /dev/null @@ -1,133 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "mock" -PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook-mock" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@storybook/react", - "@npm//react", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@storybook/react", - "@npm//@types/jest", - "@npm//@types/node", - "@npm//@types/react", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/packages/shared-ux/storybook/mock/kibana.jsonc b/packages/shared-ux/storybook/mock/kibana.jsonc index 50fc306e62ef..143be36c8f40 100644 --- a/packages/shared-ux/storybook/mock/kibana.jsonc +++ b/packages/shared-ux/storybook/mock/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/shared-ux-storybook-mock", - "owner": "@elastic/kibana-global-experience", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/kibana-global-experience" } diff --git a/packages/shared-ux/storybook/mock/package.json b/packages/shared-ux/storybook/mock/package.json index 83429ee8a324..935d67052cc0 100644 --- a/packages/shared-ux/storybook/mock/package.json +++ b/packages/shared-ux/storybook/mock/package.json @@ -2,8 +2,5 @@ "name": "@kbn/shared-ux-storybook-mock", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" + "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/mock/tsconfig.json b/packages/shared-ux/storybook/mock/tsconfig.json index 3cdea36de9ea..0f16c2b9311d 100644 --- a/packages/shared-ux/storybook/mock/tsconfig.json +++ b/packages/shared-ux/storybook/mock/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "types": [ "jest", "node", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/scripts/build_kibana_platform_plugins.js b/scripts/build_kibana_platform_plugins.js index 1c1b17feae17..59bf23ffb243 100644 --- a/scripts/build_kibana_platform_plugins.js +++ b/scripts/build_kibana_platform_plugins.js @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); -require('source-map-support/register'); +require('../src/setup_node_env'); var Path = require('path'); -var REPO_ROOT = require('@kbn/utils').REPO_ROOT; require('@kbn/optimizer').runKbnOptimizerCli({ - defaultLimitsPath: Path.resolve(REPO_ROOT, 'packages/kbn-optimizer/limits.yml'), + defaultLimitsPath: Path.resolve( + require('@kbn/repo-info').REPO_ROOT, + 'packages/kbn-optimizer/limits.yml' + ), }); diff --git a/scripts/build_plugin_list_docs.js b/scripts/build_plugin_list_docs.js index 1e05f60fd8b4..5f89f1f0e2c0 100644 --- a/scripts/build_plugin_list_docs.js +++ b/scripts/build_plugin_list_docs.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/dev-utils').runPluginListCli(); diff --git a/scripts/check_ts_projects.js b/scripts/check_ts_projects.js deleted file mode 100644 index e2179b7c507b..000000000000 --- a/scripts/check_ts_projects.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('../src/setup_node_env'); -require('../src/dev/typescript/run_check_ts_projects_cli').runCheckTsProjectsCli(); diff --git a/scripts/classify_source.js b/scripts/classify_source.js index c73f339a1786..461ebcaf3dca 100644 --- a/scripts/classify_source.js +++ b/scripts/classify_source.js @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); -require('source-map-support/register'); +require('../src/setup_node_env'); require('@kbn/repo-source-classifier-cli'); diff --git a/scripts/es.js b/scripts/es.js index 8538b5661ea4..1fcd221c9790 100644 --- a/scripts/es.js +++ b/scripts/es.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); var resolve = require('path').resolve; var pkg = require('../package.json'); diff --git a/scripts/find_babel_runtime_helpers_in_use.js b/scripts/find_babel_runtime_helpers_in_use.js index a229c8e11a2c..769caeab3db6 100644 --- a/scripts/find_babel_runtime_helpers_in_use.js +++ b/scripts/find_babel_runtime_helpers_in_use.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/optimizer').runFindBabelHelpersInEntryBundlesCli(); diff --git a/scripts/find_node_libs_browser_polyfills_in_use.js b/scripts/find_node_libs_browser_polyfills_in_use.js index 4e53e5e55107..8c96555d2b98 100644 --- a/scripts/find_node_libs_browser_polyfills_in_use.js +++ b/scripts/find_node_libs_browser_polyfills_in_use.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/optimizer').runFindNodeLibsBrowserPolyfillsInEntryBundlesCli(); diff --git a/scripts/find_target_node_imports_in_bundles.js b/scripts/find_target_node_imports_in_bundles.js deleted file mode 100644 index eae3b94efeab..000000000000 --- a/scripts/find_target_node_imports_in_bundles.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('../src/setup_node_env/no_transpilation'); -require('@kbn/optimizer').runFindTargetNodeImportsCli(); diff --git a/scripts/generate.js b/scripts/generate.js index 29774e8088d6..327689c41a32 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); -require('source-map-support/register'); +require('../src/setup_node_env'); require('@kbn/generate').runGenerateCli(); diff --git a/scripts/generate_plugin.js b/scripts/generate_plugin.js index 4e589343cea7..c77a0aaaddbb 100644 --- a/scripts/generate_plugin.js +++ b/scripts/generate_plugin.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/plugin-generator').runCli(); diff --git a/scripts/jest.js b/scripts/jest.js index 0ff6a0dcf537..edf1eb0a71ed 100755 --- a/scripts/jest.js +++ b/scripts/jest.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); +require('../src/setup_node_env'); require('@kbn/test').runJest(); diff --git a/scripts/jest_integration.js b/scripts/jest_integration.js index 9b4157eddaaf..0c2ebeaed154 100755 --- a/scripts/jest_integration.js +++ b/scripts/jest_integration.js @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); +require('../src/setup_node_env'); process.argv.push('--runInBand'); - require('@kbn/test').runJest('jest.integration.config.js'); diff --git a/scripts/kbn.js b/scripts/kbn.js index 4ae35a0689e9..64bf0beca998 100644 --- a/scripts/kbn.js +++ b/scripts/kbn.js @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); require('../src/setup_node_env/root'); require('../src/setup_node_env/node_version_validator'); import('../kbn_pm/src/cli.mjs').catch(function (error) { diff --git a/scripts/plugin_helpers.js b/scripts/plugin_helpers.js index 02c8bb17fc07..0f5b93f49321 100644 --- a/scripts/plugin_helpers.js +++ b/scripts/plugin_helpers.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/plugin-helpers').runCli(); diff --git a/scripts/precommit_hook.js b/scripts/precommit_hook.js index 1a4176bf142a..a040fcd2765e 100644 --- a/scripts/precommit_hook.js +++ b/scripts/precommit_hook.js @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); -require('@kbn/optimizer').registerNodeAutoTranspilation(); +require('../src/setup_node_env'); require('../src/dev/run_precommit_hook'); diff --git a/scripts/read_jest_help.mjs b/scripts/read_jest_help.mjs index 0a3ce69c02c9..e8c16540b0d7 100644 --- a/scripts/read_jest_help.mjs +++ b/scripts/read_jest_help.mjs @@ -11,7 +11,7 @@ import Path from 'path'; import { createFailError } from '@kbn/dev-cli-errors'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const FLAGS_FILE = 'packages/kbn-test/src/jest/jest_flags.json'; diff --git a/scripts/register_git_hook.js b/scripts/register_git_hook.js index e3db1af6f34d..67de489c973b 100644 --- a/scripts/register_git_hook.js +++ b/scripts/register_git_hook.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); -require('@kbn/dev-utils/target_node/src/precommit_hook/cli'); +require('../src/setup_node_env'); +require('@kbn/dev-utils/src/precommit_hook/cli'); diff --git a/scripts/ship_ci_stats.js b/scripts/ship_ci_stats.js index 5aed9fc44624..a45ab8472956 100644 --- a/scripts/ship_ci_stats.js +++ b/scripts/ship_ci_stats.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/dev-utils').shipCiStatsCli(); diff --git a/scripts/telemetry_check.js b/scripts/telemetry_check.js index e4fcefc60b8d..2079489e2345 100644 --- a/scripts/telemetry_check.js +++ b/scripts/telemetry_check.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/telemetry-tools').runTelemetryCheck(); diff --git a/scripts/telemetry_extract.js b/scripts/telemetry_extract.js index c662755767b2..5d907fa5cd5a 100644 --- a/scripts/telemetry_extract.js +++ b/scripts/telemetry_extract.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/telemetry-tools').runTelemetryExtract(); diff --git a/scripts/test_hardening.js b/scripts/test_hardening.js index a719d77c517e..cc058d742751 100644 --- a/scripts/test_hardening.js +++ b/scripts/test_hardening.js @@ -6,8 +6,6 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/ensure_node_preserve_symlinks'); - var execFileSync = require('child_process').execFileSync; var path = require('path'); var syncGlob = require('glob').sync; diff --git a/packages/kbn-type-summarizer/src/lib/type_summary/index.ts b/scripts/ts_project_linter.js similarity index 82% rename from packages/kbn-type-summarizer/src/lib/type_summary/index.ts rename to scripts/ts_project_linter.js index b12e1d0c2209..75cbbf7de7c1 100644 --- a/packages/kbn-type-summarizer/src/lib/type_summary/index.ts +++ b/scripts/ts_project_linter.js @@ -6,4 +6,5 @@ * Side Public License, v 1. */ -export { printTypeSummary } from './print_type_summary'; +require('../src/setup_node_env'); +require('@kbn/ts-project-linter-cli'); diff --git a/scripts/type_check.js b/scripts/type_check.js index db3f7adc2691..a9969acc70ac 100644 --- a/scripts/type_check.js +++ b/scripts/type_check.js @@ -7,4 +7,4 @@ */ require('../src/setup_node_env'); -require('../src/dev/typescript').runTypeCheckCli(); +require('@kbn/ts-type-check-cli'); diff --git a/scripts/type_summarizer.js b/scripts/type_summarizer.js deleted file mode 100644 index 8cad17c6443c..000000000000 --- a/scripts/type_summarizer.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('../src/setup_node_env/no_transpilation'); -require('source-map-support/register'); -require('@kbn/type-summarizer-cli'); diff --git a/scripts/update_vscode_config.js b/scripts/update_vscode_config.js index 2b23d8004f79..8a450655ec29 100644 --- a/scripts/update_vscode_config.js +++ b/scripts/update_vscode_config.js @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -require('../src/setup_node_env/no_transpilation'); +require('../src/setup_node_env'); require('@kbn/managed-vscode-config-cli'); diff --git a/src/cli/cli.js b/src/cli/cli.js index d3bff4f492a8..f6bce6a8aefa 100644 --- a/src/cli/cli.js +++ b/src/cli/cli.js @@ -7,7 +7,7 @@ */ import _ from 'lodash'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import Command from './command'; import serveCommand from './serve/serve'; diff --git a/src/cli/dev.js b/src/cli/dev.js index 42263986f98f..fb61b53b6f21 100644 --- a/src/cli/dev.js +++ b/src/cli/dev.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ +require('@kbn/babel-register').install(); require('./apm')(process.env.ELASTIC_APM_SERVICE_NAME || 'kibana-proxy'); require('../setup_node_env'); -require('../setup_node_env/root'); require('./cli'); diff --git a/src/cli/serve/integration_tests/invalid_config.test.ts b/src/cli/serve/integration_tests/invalid_config.test.ts index ca051f37a816..32414fe7f89f 100644 --- a/src/cli/serve/integration_tests/invalid_config.test.ts +++ b/src/cli/serve/integration_tests/invalid_config.test.ts @@ -8,7 +8,7 @@ import { spawnSync } from 'child_process'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const INVALID_CONFIG_PATH = require.resolve('./__fixtures__/invalid_config.yml'); diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index d5c1f844c4d1..61e482e5d6d0 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -12,7 +12,8 @@ import { statSync } from 'fs'; import { resolve } from 'path'; import url from 'url'; -import { getConfigPath, fromRoot, isKibanaDistributable } from '@kbn/utils'; +import { getConfigPath } from '@kbn/utils'; +import { fromRoot, isKibanaDistributable } from '@kbn/repo-info'; import { readKeystore } from '../keystore/read_keystore'; function canRequire(path) { diff --git a/src/cli/tsconfig.json b/src/cli/tsconfig.json index b3a8ab5220b9..5ee6fa361661 100644 --- a/src/cli/tsconfig.json +++ b/src/cli/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true + "outDir": "target/types", }, "include": [ "keystore/**/*", @@ -11,7 +9,17 @@ "*.js", ], "kbn_references": [ - { "path": "../core/tsconfig.json" }, + "@kbn/core", { "path": "../setup_node_env/tsconfig.json" }, + "@kbn/utils", + "@kbn/repo-info", + "@kbn/safer-lodash-set", + "@kbn/config", + "@kbn/dev-utils", + "@kbn/apm-config-loader", + "@kbn/babel-register", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_encryption_keys/cli_encryption_keys.js b/src/cli_encryption_keys/cli_encryption_keys.js index acee81aabb70..d1e9363e50f3 100644 --- a/src/cli_encryption_keys/cli_encryption_keys.js +++ b/src/cli_encryption_keys/cli_encryption_keys.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import Command from '../cli/command'; import { EncryptionConfig } from './encryption_config'; diff --git a/src/cli_encryption_keys/tsconfig.json b/src/cli_encryption_keys/tsconfig.json index 6b6661d24f9c..40ea4d7d7cbc 100644 --- a/src/cli_encryption_keys/tsconfig.json +++ b/src/cli_encryption_keys/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "*.js", @@ -11,5 +9,10 @@ "kbn_references": [ { "path": "../cli/tsconfig.json" }, { "path": "../cli_keystore/tsconfig.json" }, + "@kbn/repo-info", + "@kbn/utils", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_health_gateway/cli_health_gateway.ts b/src/cli_health_gateway/cli_health_gateway.ts index 018a47aed2a3..22e1ffa969c6 100644 --- a/src/cli_health_gateway/cli_health_gateway.ts +++ b/src/cli_health_gateway/cli_health_gateway.ts @@ -7,7 +7,7 @@ */ import { Command } from 'commander'; -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { bootstrap } from '@kbn/health-gateway-server'; const program = new Command('bin/kibana-health-gateway'); diff --git a/src/cli_health_gateway/tsconfig.json b/src/cli_health_gateway/tsconfig.json index c8ad5deb6f6d..8422077737c5 100644 --- a/src/cli_health_gateway/tsconfig.json +++ b/src/cli_health_gateway/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "*.js", @@ -11,5 +9,10 @@ ], "kbn_references": [ { "path": "../cli/tsconfig.json" }, + "@kbn/repo-info", + "@kbn/health-gateway-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_keystore/add.js b/src/cli_keystore/add.js index 96778665ac91..2d5e8485df6e 100644 --- a/src/cli_keystore/add.js +++ b/src/cli_keystore/add.js @@ -9,7 +9,7 @@ import { Logger } from '../cli/logger'; import { confirm, question } from './utils'; // import from path since add.test.js mocks 'fs' required for @kbn/utils -import { createPromiseFromStreams, createConcatStream } from '@kbn/utils/target_node/src/streams'; +import { createPromiseFromStreams, createConcatStream } from '@kbn/utils/src/streams'; /** * @param {Keystore} keystore diff --git a/src/cli_keystore/cli_keystore.js b/src/cli_keystore/cli_keystore.js index 0db5d0f33337..fdf0260fb7da 100644 --- a/src/cli_keystore/cli_keystore.js +++ b/src/cli_keystore/cli_keystore.js @@ -7,7 +7,7 @@ */ import _ from 'lodash'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import Command from '../cli/command'; import { getKeystore } from '../cli/keystore/get_keystore'; diff --git a/src/cli_keystore/tsconfig.json b/src/cli_keystore/tsconfig.json index 8cd8e6f3f232..a52277bb8a4e 100644 --- a/src/cli_keystore/tsconfig.json +++ b/src/cli_keystore/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "keystore/**/*", @@ -14,5 +12,10 @@ { "path": "../setup_node_env/tsconfig.json" }, { "path": "../cli/tsconfig.json" }, { "path": "../cli_plugin/tsconfig.json" }, + "@kbn/utils", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_plugin/cli.js b/src/cli_plugin/cli.js index 5ef142192c50..b1d0550cf8be 100644 --- a/src/cli_plugin/cli.js +++ b/src/cli_plugin/cli.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import Command from '../cli/command'; import { listCommand } from './list'; import { installCommand } from './install'; diff --git a/src/cli_plugin/install/index.js b/src/cli_plugin/install/index.js index cdf0218de3c9..76ab7966ee99 100644 --- a/src/cli_plugin/install/index.js +++ b/src/cli_plugin/install/index.js @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { getConfigPath, kibanaPackageJson as pkg } from '@kbn/utils'; +import { getConfigPath } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { install } from './install'; import { Logger } from '../../cli/logger'; import { parse, parseMilliseconds } from './settings'; diff --git a/src/cli_plugin/install/settings.js b/src/cli_plugin/install/settings.js index e1536d66e052..b3c3741fb2fa 100644 --- a/src/cli_plugin/install/settings.js +++ b/src/cli_plugin/install/settings.js @@ -8,7 +8,7 @@ import { resolve } from 'path'; import expiry from 'expiry-js'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; function generateUrls({ version, plugin }) { return [ diff --git a/src/cli_plugin/install/settings.test.js b/src/cli_plugin/install/settings.test.js index b0accc83971e..7c59d3e06698 100644 --- a/src/cli_plugin/install/settings.test.js +++ b/src/cli_plugin/install/settings.test.js @@ -7,7 +7,7 @@ */ import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { parseMilliseconds, parse } from './settings'; diff --git a/src/cli_plugin/list/index.js b/src/cli_plugin/list/index.js index 131582598c3e..5b66208452a2 100644 --- a/src/cli_plugin/list/index.js +++ b/src/cli_plugin/list/index.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; import { list } from './list'; import { Logger } from '../../cli/logger'; import { logWarnings } from '../lib/log_warnings'; diff --git a/src/cli_plugin/remove/settings.js b/src/cli_plugin/remove/settings.js index 2381770ee0a6..482d26881fd6 100644 --- a/src/cli_plugin/remove/settings.js +++ b/src/cli_plugin/remove/settings.js @@ -7,7 +7,7 @@ */ import { resolve } from 'path'; -import { fromRoot } from '@kbn/utils'; +import { fromRoot } from '@kbn/repo-info'; export function parse(command, options) { const settings = { diff --git a/src/cli_plugin/tsconfig.json b/src/cli_plugin/tsconfig.json index 611a8c05d8a4..9f9749b89a9b 100644 --- a/src/cli_plugin/tsconfig.json +++ b/src/cli_plugin/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "install/**/*", @@ -14,5 +12,11 @@ ], "kbn_references": [ { "path": "../cli/tsconfig.json" }, + "@kbn/utils", + "@kbn/repo-info", + "@kbn/jest-serializers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_setup/cli_setup.ts b/src/cli_setup/cli_setup.ts index b13e94551db5..4a283df2e849 100644 --- a/src/cli_setup/cli_setup.ts +++ b/src/cli_setup/cli_setup.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import chalk from 'chalk'; import ora from 'ora'; import { Command } from 'commander'; diff --git a/src/cli_setup/tsconfig.json b/src/cli_setup/tsconfig.json index c59d1c32ee82..268df5caa595 100644 --- a/src/cli_setup/tsconfig.json +++ b/src/cli_setup/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "*.js", @@ -11,6 +9,14 @@ ], "kbn_references": [ { "path": "../cli/tsconfig.json" }, - { "path": "../plugins/interactive_setup/tsconfig.json" }, + "@kbn/interactive-setup-plugin", + "@kbn/repo-info", + "@kbn/utils", + "@kbn/core", + "@kbn/core-elasticsearch-client-server-internal", + "@kbn/core-elasticsearch-server-internal", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/cli_setup/utils.ts b/src/cli_setup/utils.ts index 33efb2ff802b..36c08de4d422 100644 --- a/src/cli_setup/utils.ts +++ b/src/cli_setup/utils.ts @@ -10,7 +10,7 @@ import { getConfigPath, getDataPath } from '@kbn/utils'; import inquirer from 'inquirer'; import { duration } from 'moment'; import { merge } from 'lodash'; -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { Logger } from '@kbn/core/server'; import { AgentManager, ClusterClient } from '@kbn/core-elasticsearch-client-server-internal'; diff --git a/src/cli_verification_code/cli_verification_code.js b/src/cli_verification_code/cli_verification_code.js index 7ed83e8211c3..45c55d0111a5 100644 --- a/src/cli_verification_code/cli_verification_code.js +++ b/src/cli_verification_code/cli_verification_code.js @@ -6,7 +6,8 @@ * Side Public License, v 1. */ -import { kibanaPackageJson, getDataPath } from '@kbn/utils'; +import { getDataPath } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import path from 'path'; import fs from 'fs'; import chalk from 'chalk'; diff --git a/src/cli_verification_code/tsconfig.json b/src/cli_verification_code/tsconfig.json index ba74b96a36b6..15d1c74d0ec6 100644 --- a/src/cli_verification_code/tsconfig.json +++ b/src/cli_verification_code/tsconfig.json @@ -1,14 +1,17 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "*.js", ], "kbn_references": [ { "path": "../cli/tsconfig.json" }, + "@kbn/utils", + "@kbn/repo-info", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/core/server/integration_tests/capabilities/capabilities_service.test.ts b/src/core/server/integration_tests/capabilities/capabilities_service.test.ts index b1db93d6bdf9..23a8905bcb56 100644 --- a/src/core/server/integration_tests/capabilities/capabilities_service.test.ts +++ b/src/core/server/integration_tests/capabilities/capabilities_service.test.ts @@ -7,7 +7,7 @@ */ import supertest from 'supertest'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; diff --git a/src/core/server/integration_tests/http/cookie_session_storage.test.ts b/src/core/server/integration_tests/http/cookie_session_storage.test.ts index 1041ed66872d..2142a0aacf9a 100644 --- a/src/core/server/integration_tests/http/cookie_session_storage.test.ts +++ b/src/core/server/integration_tests/http/cookie_session_storage.test.ts @@ -10,7 +10,7 @@ import { parse as parseCookie } from 'tough-cookie'; import supertest from 'supertest'; import { BehaviorSubject } from 'rxjs'; import { duration as momentDuration } from 'moment'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ByteSizeValue } from '@kbn/config-schema'; import { Env } from '@kbn/config'; import { getEnvOptions, configServiceMock } from '@kbn/config-mocks'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts index 93f6af33c57d..a90291d1614a 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7.7.2_xpack_100k.test.ts @@ -8,7 +8,7 @@ import path from 'path'; import { unlink } from 'fs/promises'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts index 85f116e600d0..3419739408d1 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_transform_failures.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Root } from '@kbn/core-root-server-internal'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts index 3bef046666a4..2e19a1bf401c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/7_13_0_unknown_types.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import fs from 'fs/promises'; import type { IndicesIndexSettings } from '@elastic/elasticsearch/lib/api/types'; import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Root } from '@kbn/core-root-server-internal'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts index 818eeac9daef..e3e3b1dfe363 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/batch_size_bytes.test.ts @@ -17,7 +17,7 @@ import { import { Root } from '@kbn/core-root-server-internal'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import { LogRecord } from '@kbn/logging'; import { retryAsync } from '@kbn/core-saved-objects-migration-server-mocks'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/check_target_mappings.test.ts b/src/core/server/integration_tests/saved_objects/migrations/check_target_mappings.test.ts index b0385efbc71a..5dd147de85b5 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/check_target_mappings.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/check_target_mappings.test.ts @@ -11,7 +11,7 @@ import fs from 'fs/promises'; import { SemVer } from 'semver'; import JSON5 from 'json5'; import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import { Root } from '@kbn/core-root-server-internal'; import { LogRecord } from '@kbn/logging'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts index cfaae4fb3870..eae0fdc658a7 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/migration_from_older_v1.test.ts @@ -10,7 +10,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; import Semver from 'semver'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { Env } from '@kbn/config'; import { getEnvOptions } from '@kbn/config-mocks'; import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts index c6615b2218e9..12035a0e5ead 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/multiple_es_nodes.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import del from 'del'; import { kibanaServerTestUser } from '@kbn/test'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { createTestServers, createRoot as createkbnTestServerRoot, diff --git a/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts index 80559226c763..a947854e9249 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/multiple_kibana_nodes.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import del from 'del'; import { esTestConfig, kibanaServerTestUser } from '@kbn/test'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import type { SavedObjectsType } from '@kbn/core-saved-objects-server'; import { createTestServers, diff --git a/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts b/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts index 7da6a16514b2..ca5e21abe8dc 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/outdated_docs.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { createRootWithCorePlugins, createTestServers, diff --git a/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts b/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts index 1fed5980b66f..66fd7bd5a6db 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/rewriting_id.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fs from 'fs'; import Util from 'util'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { createRootWithCorePlugins, createTestServers, diff --git a/src/core/server/integration_tests/saved_objects/migrations/test_utils.ts b/src/core/server/integration_tests/saved_objects/migrations/test_utils.ts index 8f2373c3ed40..5e519890e5ad 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/test_utils.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/test_utils.ts @@ -8,7 +8,7 @@ import { Env } from '@kbn/config'; import { getDocLinksMeta, getDocLinks } from '@kbn/doc-links'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; export const getDocVersion = () => { diff --git a/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts b/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts index 5593afb43e02..7d2a2bf8145c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/wait_for_migration_completion.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import fs from 'fs/promises'; import JSON5 from 'json5'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { retryAsync } from '@kbn/core-saved-objects-migration-server-mocks'; import { createRootWithCorePlugins, diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts index 251c7608b629..499d0d01d9de 100644 --- a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts +++ b/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts @@ -7,7 +7,7 @@ */ import Hapi from '@hapi/hapi'; import { IncomingMessage } from 'http'; -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; // proxy setup const defaultProxyOptions = (hostname: string, port: string) => ({ diff --git a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts index 125f3141d193..eb3462d5b63e 100644 --- a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts +++ b/src/core/server/integration_tests/saved_objects/validation/validator.test.ts @@ -11,7 +11,7 @@ import Fs from 'fs'; import Util from 'util'; import { Env } from '@kbn/config'; import { schema } from '@kbn/config-schema'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; import type { SavedObjectsType } from '@kbn/core-saved-objects-server'; import { getEnvOptions } from '@kbn/config-mocks'; diff --git a/src/core/server/integration_tests/ui_settings/index.test.ts b/src/core/server/integration_tests/ui_settings/index.test.ts index 6ca80d3a3ba1..fc61f2cd5a33 100644 --- a/src/core/server/integration_tests/ui_settings/index.test.ts +++ b/src/core/server/integration_tests/ui_settings/index.test.ts @@ -7,7 +7,7 @@ */ import { Env } from '@kbn/config'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getEnvOptions } from '@kbn/config-mocks'; import { startServers, stopServers } from './lib'; import { docExistsSuite } from './doc_exists'; diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 9c042577cfe2..5ce6fba92e13 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -1,10 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, + "outDir": "target/types", "isolatedModules": true, }, "include": [ @@ -14,5 +11,143 @@ "test_helpers/**/*", "utils/**/*", "index.ts" - ] + ], + "kbn_references": [ + "@kbn/core-base-common", + "@kbn/config", + "@kbn/core-application-common", + "@kbn/core-application-browser", + "@kbn/core-application-browser-internal", + "@kbn/core-saved-objects-common", + "@kbn/core-apps-browser-internal", + "@kbn/core-root-browser-internal", + "@kbn/core-theme-browser-mocks", + "@kbn/core-base-browser-mocks", + "@kbn/core-plugins-browser-mocks", + "@kbn/core-lifecycle-browser-mocks", + "@kbn/core-injected-metadata-browser-mocks", + "@kbn/core-doc-links-browser-mocks", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-chrome-browser-mocks", + "@kbn/core-execution-context-browser-mocks", + "@kbn/core-fatal-errors-browser-mocks", + "@kbn/core-http-browser-mocks", + "@kbn/core-i18n-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-saved-objects-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/core-deprecations-browser-mocks", + "@kbn/core-logging-browser-mocks", + "@kbn/core-saved-objects-api-server", + "@kbn/core-http-server-internal", + "@kbn/core-saved-objects-server", + "@kbn/config-schema", + "@kbn/std", + "@kbn/core-logging-server-mocks", + "@kbn/core-node-server-mocks", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/core-saved-objects-base-server-mocks", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-deprecations-server-mocks", + "@kbn/core-ui-settings-server-mocks", + "@kbn/core-lifecycle-server-mocks", + "@kbn/core-plugins-server", + "@kbn/config-mocks", + "@kbn/core-http-server-mocks", + "@kbn/core-http-resources-server-mocks", + "@kbn/core-saved-objects-migration-server-mocks", + "@kbn/core-metrics-server-mocks", + "@kbn/core-rendering-server-mocks", + "@kbn/core-status-server-mocks", + "@kbn/core-http-context-server-mocks", + "@kbn/core-capabilities-server-mocks", + "@kbn/core-usage-data-server-mocks", + "@kbn/core-i18n-server-mocks", + "@kbn/core-execution-context-server-mocks", + "@kbn/core-doc-links-server-mocks", + "@kbn/core-analytics-server-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-logging-server", + "@kbn/core-logging-server-internal", + "@kbn/core-execution-context-server", + "@kbn/core-http-server", + "@kbn/core-elasticsearch-server-internal", + "@kbn/core-capabilities-server", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-http-resources-server", + "@kbn/core-plugins-server-internal", + "@kbn/core-root-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/core-http-router-server-internal", + "@kbn/logging", + "@kbn/core-saved-objects-utils-server", + "@kbn/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-api-server-internal", + "@kbn/core-saved-objects-import-export-server-internal", + "@kbn/core-metrics-server", + "@kbn/core-metrics-collectors-server-internal", + "@kbn/core-status-common", + "@kbn/repo-info", + "@kbn/core-capabilities-server-internal", + "@kbn/core-test-helpers-kbn-server", + "@kbn/core-apps-server-internal", + "@kbn/core-execution-context-browser-internal", + "@kbn/test", + "@kbn/core-base-server-internal", + "@kbn/logging-mocks", + "@kbn/core-lifecycle-server-internal", + "@kbn/core-ui-settings-server-internal", + "@kbn/core-usage-data-base-server-internal", + "@kbn/core-saved-objects-server-internal", + "@kbn/core-test-helpers-test-utils", + "@kbn/utils", + "@kbn/core-saved-objects-import-export-server-mocks", + "@kbn/core-http-context-server-internal", + "@kbn/core-test-helpers-so-type-serializer", + "@kbn/core-saved-objects-migration-server-internal", + "@kbn/doc-links", + "@kbn/core-status-server-internal", + "@kbn/core-usage-data-server", + "@kbn/core-execution-context-common", + "@kbn/core-capabilities-common", + "@kbn/core-base-common-internal", + "@kbn/core-http-common", + "@kbn/ecs", + "@kbn/core-node-server", + "@kbn/core-saved-objects-browser", + "@kbn/core-ui-settings-common", + "@kbn/core-ui-settings-server", + "@kbn/core-i18n-server", + "@kbn/core-deprecations-server", + "@kbn/core-deprecations-common", + "@kbn/core-status-server", + "@kbn/core-doc-links-server", + "@kbn/analytics-client", + "@kbn/core-analytics-server", + "@kbn/core-lifecycle-server", + "@kbn/core-doc-links-browser", + "@kbn/core-http-browser", + "@kbn/core-i18n-browser", + "@kbn/core-fatal-errors-browser", + "@kbn/core-ui-settings-browser", + "@kbn/core-notifications-browser", + "@kbn/core-chrome-browser", + "@kbn/core-plugins-browser", + "@kbn/core-base-browser-internal", + "@kbn/core-analytics-browser", + "@kbn/core-saved-objects-api-browser", + "@kbn/core-overlays-browser", + "@kbn/core-notifications-browser-internal", + "@kbn/core-theme-browser", + "@kbn/core-deprecations-browser", + "@kbn/core-mount-utils-browser", + "@kbn/core-execution-context-browser", + "@kbn/core-lifecycle-browser", + ], + "exclude": [ + "target/**/*", + ], } diff --git a/src/dev/bazel/index.bzl b/src/dev/bazel/index.bzl index cca81dfcbcd5..d5469af808bc 100644 --- a/src/dev/bazel/index.bzl +++ b/src/dev/bazel/index.bzl @@ -10,12 +10,8 @@ Please do not import from any other files when looking to use a custom rule """ -load("//src/dev/bazel:jsts_transpiler.bzl", _jsts_transpiler = "jsts_transpiler") load("//src/dev/bazel:pkg_npm.bzl", _pkg_npm = "pkg_npm") -load("//src/dev/bazel:pkg_npm_types.bzl", _pkg_npm_types = "pkg_npm_types") load("//src/dev/bazel:ts_project.bzl", _ts_project = "ts_project") -jsts_transpiler = _jsts_transpiler pkg_npm = _pkg_npm -pkg_npm_types = _pkg_npm_types ts_project = _ts_project diff --git a/src/dev/bazel/jsts_transpiler.bzl b/src/dev/bazel/jsts_transpiler.bzl deleted file mode 100644 index 1ce12118ac55..000000000000 --- a/src/dev/bazel/jsts_transpiler.bzl +++ /dev/null @@ -1,49 +0,0 @@ -"Simple wrapper over @babel/cli so we can quickly re-use the same configurations over packages" - -load("@npm//@babel/cli:index.bzl", _babel = "babel") - -def jsts_transpiler(name, srcs, build_pkg_name, web = False, additional_args = ["--quiet"], **kwargs): - """A macro around the autogenerated babel rule. - - Args: - name: target name - srcs: list of sources - build_pkg_name: package name into the build folder - web: setup the correct presets to consume the outputs in the browser, defaults to "False" and optimizes for node - additional_args: Any additional extra arguments, defaults to --quiet - **kwargs: the rest - """ - - inline_presets = [ - "--presets", - ] - - if web: - inline_presets += [ - "@kbn/babel-preset/webpack_preset", - ] - else: - inline_presets += [ - "@kbn/babel-preset/node_preset", - ] - - args = [ - "./%s" % (build_pkg_name), - "--out-dir", - "$(@D)", - "--no-babelrc", - "--extensions", - ".ts,.tsx,.js", - ] + inline_presets + additional_args - - data = srcs + [ - "//packages/kbn-babel-preset", - ] - - _babel( - name = name, - data = data, - output_dir = True, - args = args, - **kwargs - ) diff --git a/src/dev/bazel/pkg_npm_types.bzl b/src/dev/bazel/pkg_npm_types.bzl deleted file mode 100644 index 8b8de4a68912..000000000000 --- a/src/dev/bazel/pkg_npm_types.bzl +++ /dev/null @@ -1,159 +0,0 @@ -# -# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one -# or more contributor license agreements. Licensed under the Elastic License -# 2.0 and the Server Side Public License, v 1; you may not use this file except -# in compliance with, at your election, the Elastic License 2.0 or the Server -# Side Public License, v 1. -# - -load("@npm//@bazel/typescript/internal:ts_config.bzl", "TsConfigInfo") -load("@build_bazel_rules_nodejs//:providers.bzl", "run_node", "LinkablePackageInfo", "DeclarationInfo", "declaration_info") -load("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl", "module_mappings_aspect") - - -#### TODO -# Implement a way to produce source maps for api extractor -# summarised types as referenced at (https://github.com/microsoft/rushstack/issues/1886#issuecomment-933997910) - -def _collect_inputs_deps_and_transitive_types_deps(ctx): - """Returns an array with all transitively referenced files on deps in the pos 0 and all types deps in pos 1""" - deps_files_depsets = [] - transitive_types_deps = [] - - for dep in ctx.attr.deps: - # Collect whatever is in the "data" - deps_files_depsets.append(dep.data_runfiles.files) - - # Only collect DefaultInfo files (not transitive) - deps_files_depsets.append(dep.files) - - # Collect transitive type deps to propagate in the provider - if DeclarationInfo in dep: - transitive_types_deps.append(dep) - deps_files_depsets.append(dep[DeclarationInfo].transitive_declarations) - - deps_files = depset(transitive = deps_files_depsets).to_list() - return [deps_files, transitive_types_deps] - -def _get_type_package_name(actualName): - return "@types/" + actualName.replace("@", "").replace("/", "__") - -def _calculate_entrypoint_path(ctx): - return _join(ctx.bin_dir.path, ctx.label.package, _get_types_outdir_name(ctx), ctx.attr.entrypoint_name) - -def _get_types_outdir_name(ctx): - base_out_folder = _join(ctx.bin_dir.path, ctx.label.package) - type_dep_path = ctx.files.deps[0].path - type_dep_path_without_base_out = type_dep_path.replace(base_out_folder + "/", "", 1) - types_outdir_name = type_dep_path_without_base_out.split("/")[0] - return types_outdir_name - -def _join(*elements): - segments = [f for f in elements if f] - if len(segments): - return "/".join(segments) - return "." - -def _tsconfig_inputs(ctx): - """Returns all transitively referenced tsconfig files from "tsconfig" """ - all_inputs = [] - if TsConfigInfo in ctx.attr.tsconfig: - all_inputs.extend(ctx.attr.tsconfig[TsConfigInfo].deps) - else: - all_inputs.append(ctx.file.tsconfig) - return all_inputs - -def _pkg_npm_types_impl(ctx): - # collect input deps and transitive type deps - inputs_deps_and_transitive_types_deps = _collect_inputs_deps_and_transitive_types_deps(ctx) - transitive_types_deps = inputs_deps_and_transitive_types_deps[1] - - # input declarations - deps_inputs = inputs_deps_and_transitive_types_deps[0] - tsconfig_inputs = _tsconfig_inputs(ctx) - inputs = ctx.files.srcs[:] - inputs.extend(tsconfig_inputs) - inputs.extend(deps_inputs) - - # output dir declaration - package_path = ctx.label.package - package_dir = ctx.actions.declare_directory(ctx.label.name) - outputs = [package_dir] - - # layout api extractor arguments - extractor_args = ctx.actions.args() - - extractor_args.add(struct( - packageName = ctx.attr.package_name, - outputDir = package_dir.path, - buildFilePath = ctx.build_file_path, - tsconfigPath = tsconfig_inputs[0].path, - inputPath = _calculate_entrypoint_path(ctx), - ).to_json()) - - run_node( - ctx, - inputs = inputs, - arguments = [extractor_args], - outputs = outputs, - mnemonic = "AssembleNpmTypesPackage", - progress_message = "Assembling npm types package %s" % package_dir.short_path, - executable = "_packager", - env = { - "FORCE_COLOR": "1" - } - ) - - # this is a tree artifact, so correctly build the return - package_dir_depset = depset([package_dir]) - - return [ - DefaultInfo( - files = package_dir_depset, - runfiles = ctx.runfiles([package_dir]), - ), - declaration_info( - declarations = depset([package_dir]), - # this includes all the dependencies and transitive dependnecies of the ts_project, but the - # actual dependencies of the type summarizer output are just a subset of these. We don't currently - # know any way to pass the list of dependecies from the type summarizer back to bazel, so we use - # this larger-than-necessary list for accuracy, but we will likely need to figure this out once - # we have a much larger dependency graph. - deps = transitive_types_deps, - ), - LinkablePackageInfo( - package_name = _get_type_package_name(ctx.attr.package_name), - package_path = "", - path = package_dir.path, - files = package_dir_depset, - ) - ] - -pkg_npm_types = rule( - implementation = _pkg_npm_types_impl, - attrs = { - "deps": attr.label_list( - doc = """Other targets which are the base types to summarise from""", - allow_files = True, - aspects = [module_mappings_aspect], - ), - "entrypoint_name": attr.string( - doc = """Entrypoint name of the types files group to summarise""", - default = "index.d.ts", - ), - "package_name": attr.string( - mandatory = True - ), - "srcs": attr.label_list( - doc = """Files inside this directory which are inputs for the types to summarise.""", - allow_files = True, - ), - "tsconfig": attr.label(mandatory = True, allow_single_file = [".json"]), - "_packager": attr.label( - doc = "Target that executes the npm types package assembler binary", - executable = True, - cfg = "target", - default = Label("//packages/kbn-type-summarizer-cli:bazel-cli"), - ), - }, -) diff --git a/src/dev/build/lib/build.test.ts b/src/dev/build/lib/build.test.ts index e8d533143991..69a615948016 100644 --- a/src/dev/build/lib/build.test.ts +++ b/src/dev/build/lib/build.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; import { Config } from './config'; diff --git a/src/dev/build/lib/config.test.ts b/src/dev/build/lib/config.test.ts index eb4fad08b198..f46b5588a192 100644 --- a/src/dev/build/lib/config.test.ts +++ b/src/dev/build/lib/config.test.ts @@ -8,7 +8,7 @@ import { resolve } from 'path'; -import { REPO_ROOT, kibanaPackageJson } from '@kbn/utils'; +import { REPO_ROOT, kibanaPackageJson } from '@kbn/repo-info'; import { createAbsolutePathSerializer } from '@kbn/jest-serializers'; import { Config } from './config'; diff --git a/src/dev/build/lib/config.ts b/src/dev/build/lib/config.ts index a9e7f4393740..037150f8756c 100644 --- a/src/dev/build/lib/config.ts +++ b/src/dev/build/lib/config.ts @@ -8,7 +8,10 @@ import { dirname, resolve, relative } from 'path'; import os from 'os'; + import loadJsonFile from 'load-json-file'; +import { discoverBazelPackages, type BazelPackage } from '@kbn/bazel-packages'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getVersionInfo, VersionInfo } from './version_info'; import { PlatformName, PlatformArchitecture, ALL_PLATFORMS } from './platform'; @@ -207,4 +210,19 @@ export class Config { resolveFromTarget(...subPaths: string[]) { return resolve(this.repoRoot, 'target', ...subPaths); } + + private _prodPackages: BazelPackage[] | undefined; + async getProductionPackages() { + if (!this._prodPackages) { + this._prodPackages = (await discoverBazelPackages(REPO_ROOT)).filter( + (pkg) => !pkg.isDevOnly() + ); + } + + return this._prodPackages; + } + + async getPkgIdsInNodeModules() { + return (await this.getProductionPackages()).map((p) => p.manifest.id); + } } diff --git a/src/dev/build/lib/fs_records.ts b/src/dev/build/lib/fs_records.ts new file mode 100644 index 000000000000..f2e2ff9c7929 --- /dev/null +++ b/src/dev/build/lib/fs_records.ts @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; + +export class SomePath { + static fromAbs(path: string) { + return new SomePath(Path.dirname(path), Path.basename(path)); + } + + constructor( + /** The directory of the item at this path */ + public readonly dir: string, + /** The name of the item at this path */ + public readonly name: string + ) {} + + private _abs: string | null = null; + /** The absolute path of the file */ + public get abs() { + if (this._abs === null) { + this._abs = Path.resolve(this.dir, this.name); + } + + return this._abs; + } + + private _ext: string | null = null; + /** The extension of the filename, starts with a . like the Path.extname API */ + public get ext() { + if (this._ext === null) { + this._ext = Path.extname(this.name); + } + + return this._ext; + } + + /** return a file path with the file name changed to `name` */ + withName(name: string) { + return new SomePath(this.dir, name); + } + + /** return a file path with the file extension changed to `extension` */ + withExt(extension: string) { + return new SomePath(this.dir, Path.basename(this.name, this.ext) + extension); + } + + child(childName: string) { + return new SomePath(this.abs, childName); + } +} + +export interface DirRecord { + type: 'dir'; + source: SomePath; + dest: SomePath; +} + +export interface FileRecord { + type: 'file'; + source: SomePath; + dest: SomePath; + content?: string; +} + +export type Record = FileRecord | DirRecord; diff --git a/src/dev/build/lib/integration_tests/version_info.test.ts b/src/dev/build/lib/integration_tests/version_info.test.ts index 9385de6e00a4..1dc76261864e 100644 --- a/src/dev/build/lib/integration_tests/version_info.test.ts +++ b/src/dev/build/lib/integration_tests/version_info.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson as pkg } from '@kbn/utils'; +import { kibanaPackageJson as pkg } from '@kbn/repo-info'; import { getVersionInfo } from '../version_info'; diff --git a/src/dev/build/lib/scan_copy.ts b/src/dev/build/lib/scan_copy.ts index 1c5e29f42058..28ab1649ad2f 100644 --- a/src/dev/build/lib/scan_copy.ts +++ b/src/dev/build/lib/scan_copy.ts @@ -8,10 +8,10 @@ import Fs from 'fs'; import Fsp from 'fs/promises'; -import Path from 'path'; import * as Rx from 'rxjs'; import { assertAbsolute, mkdirp } from './fs'; +import { type DirRecord, type FileRecord, type Record, SomePath } from './fs_records'; const fsReadDir$ = Rx.bindNodeCallback( (path: string, cb: (err: Error | null, ents: Fs.Dirent[]) => void) => { @@ -46,68 +46,6 @@ interface Options { map?: (record: Readonly) => Promise; } -export class SomePath { - static fromAbs(path: string) { - return new SomePath(Path.dirname(path), Path.basename(path)); - } - - constructor( - /** The directory of the item at this path */ - public readonly dir: string, - /** The name of the item at this path */ - public readonly name: string - ) {} - - private _abs: string | null = null; - /** The absolute path of the file */ - public get abs() { - if (this._abs === null) { - this._abs = Path.resolve(this.dir, this.name); - } - - return this._abs; - } - - private _ext: string | null = null; - /** The extension of the filename, starts with a . like the Path.extname API */ - public get ext() { - if (this._ext === null) { - this._ext = Path.extname(this.name); - } - - return this._ext; - } - - /** return a file path with the file name changed to `name` */ - withName(name: string) { - return new SomePath(this.dir, name); - } - - /** return a file path with the file extension changed to `extension` */ - withExt(extension: string) { - return new SomePath(this.dir, Path.basename(this.name, this.ext) + extension); - } - - child(childName: string) { - return new SomePath(this.abs, childName); - } -} - -interface DirRecord { - type: 'dir'; - source: SomePath; - dest: SomePath; -} - -interface FileRecord { - type: 'file'; - source: SomePath; - dest: SomePath; - content?: string; -} - -type Record = FileRecord | DirRecord; - /** * Copy all of the files from one directory to another, optionally filtered with a * function or modifying mtime/atime for each file. diff --git a/src/dev/build/lib/version_info.ts b/src/dev/build/lib/version_info.ts index 9ad20b4a6935..f0e4a77e55bb 100644 --- a/src/dev/build/lib/version_info.ts +++ b/src/dev/build/lib/version_info.ts @@ -9,7 +9,7 @@ import execa from 'execa'; import fs from 'fs'; import { join } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getBuildNumber } from './get_build_number'; interface Options { diff --git a/src/dev/build/tasks/assert_path_length.ts b/src/dev/build/tasks/assert_path_length.ts index 0dd7db50dd57..10be4503bf79 100644 --- a/src/dev/build/tasks/assert_path_length.ts +++ b/src/dev/build/tasks/assert_path_length.ts @@ -16,7 +16,18 @@ export const AssertPathLength: Task = { description: 'Checking Windows for paths > 200 characters', async run(config, log, build) { - const buildRoot = build.resolvePath(); + const win = config.getTargetPlatforms().find((p) => p.isWindows()); + + const buildRoot = process.env.CI + ? build.resolvePath() + : win + ? build.resolvePathForPlatform(win) + : undefined; + + if (!buildRoot) { + return; + } + await scan$(buildRoot) .pipe( map((path) => relative(buildRoot, path)), diff --git a/src/dev/build/tasks/build_kibana_example_plugins.ts b/src/dev/build/tasks/build_kibana_example_plugins.ts index 6fc53e10390c..0f00acbb58ba 100644 --- a/src/dev/build/tasks/build_kibana_example_plugins.ts +++ b/src/dev/build/tasks/build_kibana_example_plugins.ts @@ -8,7 +8,7 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { exec, Task } from '../lib'; export const BuildKibanaExamplePlugins: Task = { diff --git a/src/dev/build/tasks/build_kibana_platform_plugins.ts b/src/dev/build/tasks/build_kibana_platform_plugins.ts index 9beb296b7c38..44fb14800a05 100644 --- a/src/dev/build/tasks/build_kibana_platform_plugins.ts +++ b/src/dev/build/tasks/build_kibana_platform_plugins.ts @@ -8,7 +8,7 @@ import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { lastValueFrom } from 'rxjs'; import { CiStatsMetric } from '@kbn/ci-stats-reporter'; import { diff --git a/src/dev/build/tasks/build_packages_task.ts b/src/dev/build/tasks/build_packages_task.ts index 2cb0bb585b56..ba1965cf36c3 100644 --- a/src/dev/build/tasks/build_packages_task.ts +++ b/src/dev/build/tasks/build_packages_task.ts @@ -7,91 +7,148 @@ */ import Path from 'path'; +import * as Fsp from 'fs/promises'; -import { REPO_ROOT } from '@kbn/utils'; -import { discoverBazelPackages } from '@kbn/bazel-packages'; import { runBazel } from '@kbn/bazel-runner'; import * as Peggy from '@kbn/peggy'; +import { asyncForEach } from '@kbn/std'; +import { withFastAsyncTransform, TransformConfig } from '@kbn/babel-transform'; import { Task, scanCopy, write, deleteAll } from '../lib'; +import type { Record } from '../lib/fs_records'; + +const distPerms = (rec: Record) => (rec.type === 'file' ? 0o644 : 0o755); export const BuildBazelPackages: Task = { description: 'Building distributable versions of Bazel packages', async run(config, log, build) { - const packages = (await discoverBazelPackages(REPO_ROOT)).filter((pkg) => !pkg.isDevOnly()); + const packages = await config.getProductionPackages(); + const pkgIdsInNodeModules = await config.getPkgIdsInNodeModules(); - log.info(`Preparing Bazel projects production build non-devOnly packages`); - await runBazel(['build', '//packages:build']); + log.info(`Building Bazel artifacts which are necessary for the build`); + await runBazel([ + 'build', + '//packages/kbn-ui-shared-deps-npm:shared_built_assets', + '//packages/kbn-ui-shared-deps-src:shared_built_assets', + '//packages/kbn-monaco:target_workers', + '--show_result=1', + '--define=dist=true', + ]); - for (const pkg of packages) { - log.info(`Copying build of`, pkg.manifest.id, 'into build'); + const transformConfig: TransformConfig = { + disableSourceMaps: true, + ignoredPkgIds: pkgIdsInNodeModules, + }; - const pkgDirInBuild = build.resolvePath(pkg.normalizedRepoRelativeDir); - const peggyConfigOutputPaths = new Set(); - const pkgBuildDir = config.resolveFromRepo( - 'bazel-bin', - pkg.normalizedRepoRelativeDir, - 'npm_module' - ); + await withFastAsyncTransform(transformConfig, async (transform) => { + await asyncForEach(packages, async (pkg) => { + const pkgDistPath = build.resolvePath(pkg.normalizedRepoRelativeDir); + const peggyConfigOutputPaths = new Set(); + const pkgSrcPath = config.resolveFromRepo(pkg.normalizedRepoRelativeDir); - // copy the built npm_module target dir into the build, package.json is updated to copy - // the sources we actually end up using into the node_modules directory when we run - // yarn install - await scanCopy({ - source: pkgBuildDir, - destination: pkgDirInBuild, - permissions: (rec) => (rec.type === 'file' ? 0o644 : 0o755), - filter: (rec) => !(rec.type === 'dir' && rec.source.name === 'target_web'), - async map(rec) { - const extname = Path.extname(rec.source.name); - if (extname !== '.peggy') { - return undefined; - } + // copy the built npm_module target dir into the build, package.json is updated to copy + // the sources we actually end up using into the node_modules directory when we run + // yarn install + await scanCopy({ + source: pkgSrcPath, + destination: pkgDistPath, + permissions: distPerms, + filter: (rec) => !rec.source.name.endsWith('.d.ts'), + async map(rec) { + switch (Path.extname(rec.source.name)) { + case '.peggy': { + const result = await Peggy.getJsSource({ + path: rec.source.abs, + format: 'commonjs', + optimize: 'speed', + }); - const result = await Peggy.getJsSource({ - path: rec.source.abs, - format: 'commonjs', - optimize: 'speed', - }); + if (result.config) { + // if there was a config file for this peggy grammar, capture its output path and + // delete it after the copy is complete + peggyConfigOutputPaths.add( + Path.resolve(pkgDistPath, Path.relative(pkgSrcPath, result.config.path)) + ); + } - if (result.config) { - // if there was a config file for this peggy grammar, capture its output path and - // delete it after the copy is complete - peggyConfigOutputPaths.add( - Path.resolve(pkgDirInBuild, Path.relative(pkgBuildDir, result.config.path)) - ); - } + return { + ...rec, + dest: rec.dest.withName(rec.dest.name + '.js'), + content: result.source, + }; + } - return { - ...rec, - dest: rec.dest.withName(rec.dest.name + '.js'), - content: result.source, - }; - }, - }); - - // cleanup any peggy config files - if (peggyConfigOutputPaths.size) { - await deleteAll(Array.from(peggyConfigOutputPaths), log); - } - - await write( - Path.resolve(pkgDirInBuild, 'kibana.jsonc'), - JSON.stringify(pkg.manifest, null, 2) - ); - await write( - Path.resolve(pkgDirInBuild, 'package.json'), - JSON.stringify( - { - ...pkg.pkg, - name: pkg.manifest.id, - version: config.getBuildVersion(), - private: undefined, + case '.ts': + case '.tsx': + case '.js': + case '.mjs': + case '.jsx': { + const source = await Fsp.readFile(rec.source.abs, 'utf8'); + const result = await transform(rec.source.abs, source); + return { + ...rec, + dest: rec.dest.withExt('.js'), + content: result.code, + }; + } + } }, - null, - 2 - ) - ); - } + }); + + if ( + pkg.manifest.id === '@kbn/ui-shared-deps-src' || + pkg.manifest.id === '@kbn/ui-shared-deps-npm' + ) { + await scanCopy({ + source: config.resolveFromRepo( + 'bazel-bin', + pkg.normalizedRepoRelativeDir, + 'shared_built_assets' + ), + destination: build.resolvePath(pkg.normalizedRepoRelativeDir, 'shared_built_assets'), + permissions: distPerms, + filter: (rec) => rec.source.ext !== '.map', + }); + } + + if (pkg.manifest.id === '@kbn/monaco') { + await scanCopy({ + source: config.resolveFromRepo( + 'bazel-bin', + pkg.normalizedRepoRelativeDir, + 'target_workers' + ), + destination: build.resolvePath(pkg.normalizedRepoRelativeDir, 'target_workers'), + permissions: distPerms, + filter: (rec) => rec.source.ext !== '.map', + }); + } + + // cleanup any peggy config files + if (peggyConfigOutputPaths.size) { + await deleteAll(Array.from(peggyConfigOutputPaths), log); + } + + await write( + Path.resolve(pkgDistPath, 'kibana.jsonc'), + JSON.stringify(pkg.manifest, null, 2) + ); + await write( + Path.resolve(pkgDistPath, 'package.json'), + JSON.stringify( + { + ...pkg.pkg, + name: pkg.manifest.id, + version: config.getBuildVersion(), + private: undefined, + }, + null, + 2 + ) + ); + + log.info(`Copied`, pkg.manifest.id, 'into build'); + }); + }); }, }; diff --git a/src/dev/build/tasks/clean_tasks.ts b/src/dev/build/tasks/clean_tasks.ts index bc4e5bca0567..18313dc3edbc 100644 --- a/src/dev/build/tasks/clean_tasks.ts +++ b/src/dev/build/tasks/clean_tasks.ts @@ -8,7 +8,7 @@ import minimatch from 'minimatch'; import { discoverBazelPackages } from '@kbn/bazel-packages'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { deleteAll, deleteEmptyFolders, scanDelete, Task, GlobalTask } from '../lib'; export const Clean: GlobalTask = { diff --git a/src/dev/build/tasks/copy_source_task.ts b/src/dev/build/tasks/copy_source_task.ts index 536b59e663a3..c092dc834163 100644 --- a/src/dev/build/tasks/copy_source_task.ts +++ b/src/dev/build/tasks/copy_source_task.ts @@ -52,6 +52,9 @@ export const CopySource: Task = { const piscina = new Piscina({ filename: resolve(__dirname, 'copy_source_worker.js'), + workerData: { + ignoredPkgIds: await config.getPkgIdsInNodeModules(), + }, }); const globbyOptions = { cwd: config.resolveFromRepo('.') }; @@ -74,5 +77,7 @@ export const CopySource: Task = { await Promise.all(tasks); await piscina.destroy(); + + log.success('copied and transpiled', tasks.length, 'files'); }, }; diff --git a/src/dev/build/tasks/copy_source_worker.js b/src/dev/build/tasks/copy_source_worker.js index 5f18cf6f46ea..a272a15b653e 100644 --- a/src/dev/build/tasks/copy_source_worker.js +++ b/src/dev/build/tasks/copy_source_worker.js @@ -10,26 +10,18 @@ const { writeFileSync, readFileSync, copyFileSync, mkdirSync } = require('fs'); const { resolve, extname, dirname } = require('path'); const { optimize } = require('svgo'); -const { transformFileSync } = require('@babel/core'); +const { transformCode } = require('@kbn/babel-transform'); -const presets = require('@kbn/babel-preset/node_preset'); +const { ignoredPkgIds } = require('piscina').workerData; -const { REPO_ROOT } = require('@kbn/utils'); +const { REPO_ROOT } = require('@kbn/repo-info'); const BUILD_ROOT = resolve(REPO_ROOT, 'build', 'kibana'); -const babelOptions = { - presets: [[presets, { 'kibana/rootDir': REPO_ROOT }]], - cwd: REPO_ROOT, - babelrc: false, - sourceMaps: false, - ast: false, -}; - const svgOptions = { removeComments: false, }; -module.exports = ({ source }) => { +module.exports = async ({ source }) => { const absoluteSource = resolve(REPO_ROOT, source); const absoluteDest = resolve(BUILD_ROOT, source); @@ -40,12 +32,17 @@ module.exports = ({ source }) => { case '.js': case '.ts': case '.tsx': - const output = transformFileSync(absoluteSource, babelOptions); + const output = transformCode(absoluteSource, undefined, { + disableSourceMaps: true, + ignoredPkgIds, + }); + if (output.code) { const dest = absoluteDest.substring(0, absoluteDest.lastIndexOf('.')) + '.js'; writeFileSync(dest, output.code); } break; + case '.svg': const input = readFileSync(absoluteSource, 'utf-8'); const result = optimize(input, { @@ -58,7 +55,9 @@ module.exports = ({ source }) => { writeFileSync(absoluteDest, output); } break; + default: copyFileSync(absoluteSource, absoluteDest); + break; } }; diff --git a/src/dev/build/tasks/generate_packages_optimized_assets.ts b/src/dev/build/tasks/generate_packages_optimized_assets.ts index 0f2e22a3c144..566c15786f7a 100644 --- a/src/dev/build/tasks/generate_packages_optimized_assets.ts +++ b/src/dev/build/tasks/generate_packages_optimized_assets.ts @@ -43,7 +43,7 @@ async function optimizeAssets(log: ToolingLog, assetDir: string) { await asyncPipeline( vfs.src(['**/*.css'], { cwd: assetDir }), // eslint-disable-next-line @typescript-eslint/no-var-requires - gulpPostCSS(require('@kbn/optimizer/postcss.config.js').plugins), + gulpPostCSS(require('@kbn/optimizer/postcss.config').plugins), vfs.dest(assetDir) ); diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts index bb417cef3d99..4092390f0836 100644 --- a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts @@ -9,7 +9,7 @@ import { readFileSync } from 'fs'; import Path from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log'; import { createAbsolutePathSerializer, createRecursiveSerializer } from '@kbn/jest-serializers'; diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts index 5f495bf3b168..9a9f8520b8ab 100644 --- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts @@ -9,7 +9,7 @@ import Path from 'path'; import Fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log'; import { createAnyInstanceSerializer, createRecursiveSerializer } from '@kbn/jest-serializers'; diff --git a/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts b/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts index 7f092f399c8e..7df5b21bd562 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/bundle_dockerfiles.ts @@ -11,7 +11,7 @@ import { readFileSync } from 'fs'; import { copyFile } from 'fs/promises'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import Mustache from 'mustache'; import { compressTar, copyAll, mkdirp, write, Config } from '../../../lib'; diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 89944999392e..fa19a11bb593 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -11,7 +11,7 @@ import { resolve, basename } from 'path'; import { promisify } from 'util'; import { ToolingLog } from '@kbn/tooling-log'; -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { write, copyAll, mkdirp, exec, Config, Build } from '../../../lib'; import * as dockerTemplates from './templates'; diff --git a/src/dev/chromium_version.ts b/src/dev/chromium_version.ts index 7bbdfcd59d76..f2cbab5e7a51 100644 --- a/src/dev/chromium_version.ts +++ b/src/dev/chromium_version.ts @@ -8,7 +8,7 @@ import { run } from '@kbn/dev-cli-runner'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import chalk from 'chalk'; import cheerio from 'cheerio'; import fs from 'fs'; diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js index 14f7cefc78ca..f6de641e49dd 100644 --- a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js +++ b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js @@ -8,7 +8,7 @@ import { enumeratePatterns } from '../team_assignment/enumerate_patterns'; import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const log = new ToolingLog({ level: 'info', diff --git a/src/dev/code_coverage/ingest_coverage/team_assignment/index.js b/src/dev/code_coverage/ingest_coverage/team_assignment/index.js index f47cf6e9d535..8db4dd5ddb67 100644 --- a/src/dev/code_coverage/ingest_coverage/team_assignment/index.js +++ b/src/dev/code_coverage/ingest_coverage/team_assignment/index.js @@ -8,7 +8,7 @@ import { run } from '@kbn/dev-cli-runner'; import { createFlagError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { parse } from './parse_owners'; import { flush } from './flush'; import { enumeratePatterns } from './enumerate_patterns'; diff --git a/src/dev/eslint/lint_files.ts b/src/dev/eslint/lint_files.ts index 46c11e283ff4..2e62cbd451ad 100644 --- a/src/dev/eslint/lint_files.ts +++ b/src/dev/eslint/lint_files.ts @@ -8,7 +8,7 @@ import { CLIEngine } from 'eslint'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { createFailError } from '@kbn/dev-cli-errors'; import { ToolingLog } from '@kbn/tooling-log'; import { File } from '../file'; diff --git a/src/dev/eslint/run_eslint_with_types.ts b/src/dev/eslint/run_eslint_with_types.ts index e6eac71b15d0..f3ec09540c36 100644 --- a/src/dev/eslint/run_eslint_with_types.ts +++ b/src/dev/eslint/run_eslint_with_types.ts @@ -16,10 +16,9 @@ import { mergeMap, reduce } from 'rxjs/operators'; import { supportsColor } from 'chalk'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; -import { PROJECTS } from '../typescript/projects'; -import { Project } from '../typescript/project'; +import { PROJECTS, Project } from '@kbn/ts-projects'; export function runEslintWithTypes() { run( @@ -42,7 +41,7 @@ export function runEslintWithTypes() { return false; } - if (projectFilter && project.tsConfigPath !== projectFilter) { + if (projectFilter && project.path !== projectFilter) { log.verbose(`[${project.name}] skipping because it doesn't match --project`); return false; } @@ -79,8 +78,10 @@ export function runEslintWithTypes() { process.execPath, [ Path.relative(project.directory, eslintPath), - ...project.getIncludePatterns().map((p) => (p.endsWith('*') ? `${p}.{ts,tsx}` : p)), - ...project.getExcludePatterns().flatMap((p) => ['--ignore-pattern', p]), + ...(project.config.include ?? []).map((p) => + p.endsWith('*') ? `${p}.{ts,tsx}` : p + ), + ...(project.config.exclude ?? []).flatMap((p) => ['--ignore-pattern', p]), ...['--ignore-pattern', '**/*.json'], ...['--ext', '.ts,.tsx'], '--no-error-on-unmatched-pattern', @@ -145,13 +146,7 @@ export function runEslintWithTypes() { } projects failed, run the following commands locally to try auto-fixing them: ${failures - .map( - (p) => - `node scripts/eslint_with_types --fix --project ${Path.relative( - REPO_ROOT, - p.tsConfigPath - )}` - ) + .map((p) => `node scripts/eslint_with_types --fix --project ${p.repoRel}`) .join('\n ')} ` ); diff --git a/src/dev/license_checker/run_check_licenses_cli.ts b/src/dev/license_checker/run_check_licenses_cli.ts index 8ff73d85a748..7c6cd9248f05 100644 --- a/src/dev/license_checker/run_check_licenses_cli.ts +++ b/src/dev/license_checker/run_check_licenses_cli.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { getInstalledPackages } from '../npm'; diff --git a/src/dev/notice/cli.js b/src/dev/notice/cli.js index 8aece9f51d9e..77b3151d0501 100644 --- a/src/dev/notice/cli.js +++ b/src/dev/notice/cli.js @@ -11,7 +11,7 @@ import { resolve } from 'path'; import getopts from 'getopts'; import dedent from 'dedent'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { ToolingLog, pickLevelFromFlags } from '@kbn/tooling-log'; import { generateNoticeFromSource } from './generate_notice_from_source'; diff --git a/src/dev/npm/integration_tests/installed_packages.test.ts b/src/dev/npm/integration_tests/installed_packages.test.ts index 716065fe39b5..079560eb4790 100644 --- a/src/dev/npm/integration_tests/installed_packages.test.ts +++ b/src/dev/npm/integration_tests/installed_packages.test.ts @@ -10,7 +10,7 @@ import { resolve, sep } from 'path'; import { uniq } from 'lodash'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { getInstalledPackages, InstalledPackage } from '../installed_packages'; const FIXTURE1_ROOT = resolve(__dirname, '__fixtures__/fixture1'); diff --git a/src/dev/performance/run_performance_cli.ts b/src/dev/performance/run_performance_cli.ts index 142b024df0d4..daec946f8962 100644 --- a/src/dev/performance/run_performance_cli.ts +++ b/src/dev/performance/run_performance_cli.ts @@ -8,7 +8,7 @@ import { createFlagError } from '@kbn/dev-cli-errors'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import fs from 'fs'; import path from 'path'; diff --git a/src/dev/performance/run_scalability_cli.ts b/src/dev/performance/run_scalability_cli.ts index 5f925772dcc2..86f8c70a11ab 100644 --- a/src/dev/performance/run_scalability_cli.ts +++ b/src/dev/performance/run_scalability_cli.ts @@ -8,7 +8,7 @@ import { createFlagError } from '@kbn/dev-cli-errors'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import fs from 'fs'; import path from 'path'; import { Journey } from './run_performance_cli'; diff --git a/src/dev/plugin_discovery/find_plugins.ts b/src/dev/plugin_discovery/find_plugins.ts index 698a9816a531..93cddbb165c9 100644 --- a/src/dev/plugin_discovery/find_plugins.ts +++ b/src/dev/plugin_discovery/find_plugins.ts @@ -10,7 +10,7 @@ import Path from 'path'; import { getPluginSearchPaths } from '@kbn/plugin-discovery'; import { KibanaPlatformPlugin, simpleKibanaPlatformPluginDiscovery } from '@kbn/plugin-discovery'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export interface SearchOptions { oss: boolean; diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 2cfa9b0299c3..8b8f49e59d5d 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -26,6 +26,7 @@ export const IGNORE_FILE_GLOBS = [ '**/{Dockerfile,docker-compose.yml}', 'x-pack/plugins/canvas/tasks/**/*', 'x-pack/plugins/canvas/canvas_plugin_src/**/*', + 'x-pack/plugins/canvas/server/templates/assets/*.{png,jpg,svg}', 'x-pack/plugins/cases/docs/**/*', 'x-pack/plugins/monitoring/public/lib/jquery_flot/**/*', '**/.*', diff --git a/src/dev/precommit_hook/get_files_for_commit.js b/src/dev/precommit_hook/get_files_for_commit.js index 2afb5dba2510..e540542c34c2 100644 --- a/src/dev/precommit_hook/get_files_for_commit.js +++ b/src/dev/precommit_hook/get_files_for_commit.js @@ -8,7 +8,7 @@ import SimpleGit from 'simple-git'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { File } from '../file'; /** diff --git a/src/dev/run_build_docs_cli.ts b/src/dev/run_build_docs_cli.ts index c121dc69de3d..54871a8a0e8b 100644 --- a/src/dev/run_build_docs_cli.ts +++ b/src/dev/run_build_docs_cli.ts @@ -11,7 +11,7 @@ import Path from 'path'; import dedent from 'dedent'; import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; const DEFAULT_DOC_REPO_PATH = Path.resolve(REPO_ROOT, '..', 'docs'); diff --git a/src/dev/run_check_file_casing.ts b/src/dev/run_check_file_casing.ts index 3dff1c173109..451425e58888 100644 --- a/src/dev/run_check_file_casing.ts +++ b/src/dev/run_check_file_casing.ts @@ -8,7 +8,7 @@ import globby from 'globby'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { run } from '@kbn/dev-cli-runner'; import { File } from './file'; import { checkFileCasing } from './precommit_hook/check_file_casing'; diff --git a/src/dev/run_find_plugins_with_circular_deps.ts b/src/dev/run_find_plugins_with_circular_deps.ts index 67a67a2f1729..27968d15c68d 100644 --- a/src/dev/run_find_plugins_with_circular_deps.ts +++ b/src/dev/run_find_plugins_with_circular_deps.ts @@ -11,7 +11,7 @@ import { parseDependencyTree, parseCircular, prettyCircular } from 'dpdm'; import { relative } from 'path'; import { getPluginSearchPaths } from '@kbn/plugin-discovery'; import { run } from '@kbn/dev-cli-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; interface Options { debug?: boolean; diff --git a/src/dev/run_precommit_hook.js b/src/dev/run_precommit_hook.js index 5774ffb9d9b3..7b8b8d25da12 100644 --- a/src/dev/run_precommit_hook.js +++ b/src/dev/run_precommit_hook.js @@ -10,7 +10,7 @@ import SimpleGit from 'simple-git'; import { run } from '@kbn/dev-cli-runner'; import { createFlagError, combineErrors } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import * as Eslint from './eslint'; import * as Stylelint from './stylelint'; import { getFilesForCommit, checkFileCasing } from './precommit_hook'; diff --git a/src/dev/storybook/commands/clean.ts b/src/dev/storybook/commands/clean.ts index 2688ef4bcdb7..55861ff22bdb 100644 --- a/src/dev/storybook/commands/clean.ts +++ b/src/dev/storybook/commands/clean.ts @@ -7,7 +7,7 @@ */ import { ToolingLog } from '@kbn/tooling-log'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { join } from 'path'; import del from 'del'; diff --git a/src/dev/tsconfig.json b/src/dev/tsconfig.json index 5976c86154da..136db54b123b 100644 --- a/src/dev/tsconfig.json +++ b/src/dev/tsconfig.json @@ -1,20 +1,39 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "**/*.js", "**/*.ts", ], "exclude": [ - "target/types/**/*" + "target/**/*", ], "kbn_references": [ - { "path": "../core/tsconfig.json" }, + "@kbn/core", { "path": "../../tsconfig.json" }, - { "path": "../../x-pack/plugins/screenshotting/tsconfig.json" }, + "@kbn/screenshotting-plugin", + "@kbn/test", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/repo-info", + "@kbn/tooling-log", + "@kbn/plugin-discovery", + "@kbn/ci-stats-reporter", + "@kbn/jest-serializers", + "@kbn/i18n", + "@kbn/storybook", + "@kbn/bazel-packages", + "@kbn/std", + "@kbn/dev-utils", + "@kbn/utils", + "@kbn/optimizer", + "@kbn/bazel-runner", + "@kbn/peggy", + "@kbn/babel-transform", + "@kbn/import-resolver", + "@kbn/find-used-node-modules", + "@kbn/ts-projects", ] } diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts deleted file mode 100644 index c148cccfa735..000000000000 --- a/src/dev/typescript/project.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { IMinimatch, Minimatch } from 'minimatch'; -import { REPO_ROOT } from '@kbn/utils'; - -import { parseTsConfig } from './ts_configfile'; - -function makeMatchers(directory: string, patterns: string[]) { - return patterns.map( - (pattern) => - new Minimatch(Path.resolve(directory, pattern), { - dot: true, - }) - ); -} - -function testMatchers(matchers: IMinimatch[], path: string) { - return matchers.some((matcher) => matcher.match(path)); -} - -export interface ProjectOptions { - name?: string; - disableTypeCheck?: boolean; -} - -interface LoadOptions { - history?: string[]; - cache?: Map; - skipConfigValidation?: boolean; -} - -export class Project { - static load( - tsConfigPath: string, - projectOptions?: ProjectOptions, - loadOptions: LoadOptions = {} - ): Project { - const cache = loadOptions.cache ?? new Map(); - const cached = cache.get(tsConfigPath); - if (cached) { - return cached; - } - - const config = parseTsConfig(tsConfigPath); - - if (!loadOptions?.skipConfigValidation) { - if (config.files) { - throw new Error(`${tsConfigPath} must not use "files" key`); - } - - if (!config.include) { - throw new Error(`${tsConfigPath} must have an "include" key`); - } - } - - const directory = Path.dirname(tsConfigPath); - const disableTypeCheck = projectOptions?.disableTypeCheck || false; - const name = - projectOptions?.name || Path.relative(REPO_ROOT, directory) || Path.basename(directory); - const includePatterns = config.include; - const include = includePatterns ? makeMatchers(directory, includePatterns) : undefined; - const excludePatterns = config.exclude; - const exclude = excludePatterns ? makeMatchers(directory, excludePatterns) : undefined; - - let baseProject; - if (config.extends) { - const baseConfigPath = Path.resolve(directory, config.extends); - - // prevent circular deps - if (loadOptions.history?.includes(baseConfigPath)) { - throw new Error( - `circular "extends" are not supported in tsconfig files: ${loadOptions.history} => ${baseConfigPath}` - ); - } - - baseProject = Project.load( - baseConfigPath, - {}, - { - skipConfigValidation: true, - history: [...(loadOptions.history ?? []), tsConfigPath], - cache, - } - ); - } - - const project = new Project( - tsConfigPath, - directory, - name, - config, - disableTypeCheck, - baseProject, - include, - includePatterns, - exclude, - excludePatterns - ); - cache.set(tsConfigPath, project); - return project; - } - - public readonly typeCheckConfigPath: string; - - constructor( - public readonly tsConfigPath: string, - public readonly directory: string, - public readonly name: string, - public readonly config: any, - public readonly disableTypeCheck: boolean, - - public readonly baseProject?: Project, - private readonly include?: IMinimatch[], - private readonly includePatterns?: string[], - private readonly exclude?: IMinimatch[], - private readonly excludePatterns?: string[] - ) { - this.typeCheckConfigPath = Path.resolve(this.directory, 'tsconfig.type_check.json'); - } - - public getIncludePatterns(): string[] { - return this.includePatterns - ? this.includePatterns - : this.baseProject?.getIncludePatterns() ?? []; - } - public getExcludePatterns(): string[] { - return this.excludePatterns - ? this.excludePatterns - : this.baseProject?.getExcludePatterns() ?? []; - } - - private getInclude(): IMinimatch[] { - return this.include ? this.include : this.baseProject?.getInclude() ?? []; - } - - private getExclude(): IMinimatch[] { - return this.exclude ? this.exclude : this.baseProject?.getExclude() ?? []; - } - - public isAbsolutePathSelected(path: string) { - return testMatchers(this.getExclude(), path) ? false : testMatchers(this.getInclude(), path); - } - - public getOutDir(): string | undefined { - if (this.config.compilerOptions?.outDir) { - return Path.resolve(this.directory, this.config.compilerOptions.outDir); - } - if (this.baseProject) { - return this.baseProject.getOutDir(); - } - return undefined; - } - - public getRefdPaths(): string[] { - if (this.config.references) { - return (this.config.references as Array<{ path: string }>).map(({ path }) => - Path.resolve(this.directory, path) - ); - } - - return this.baseProject ? this.baseProject.getRefdPaths() : []; - } - - public getConfigPaths(): string[] { - return this.baseProject - ? [this.tsConfigPath, ...this.baseProject.getConfigPaths()] - : [this.tsConfigPath]; - } - - public getProjectsDeep(): Project[] { - return this.baseProject ? [this, ...this.baseProject.getProjectsDeep()] : [this]; - } -} diff --git a/src/dev/typescript/run_check_ts_projects_cli.ts b/src/dev/typescript/run_check_ts_projects_cli.ts deleted file mode 100644 index c4998e679195..000000000000 --- a/src/dev/typescript/run_check_ts_projects_cli.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; - -import { run } from '@kbn/dev-cli-runner'; -import { asyncMapWithLimit } from '@kbn/std'; -import { createFailError } from '@kbn/dev-cli-errors'; -import { getRepoFiles } from '@kbn/get-repo-files'; -import { REPO_ROOT } from '@kbn/utils'; -import globby from 'globby'; - -import { File } from '../file'; -import { PROJECTS } from './projects'; -import type { Project } from './project'; - -class Stats { - counts = { - files: new Map(), - ignored: new Map(), - gitMatched: new Map(), - }; - - incr(proj: Project, metric: 'files' | 'ignored' | 'gitMatched', delta = 1) { - const cur = this.counts[metric].get(proj); - this.counts[metric].set(proj, (cur ?? 0) + delta); - } -} - -export async function runCheckTsProjectsCli() { - run( - async ({ log }) => { - const stats = new Stats(); - let failed = false; - - const everyProjectDeep = new Set(PROJECTS.flatMap((p) => p.getProjectsDeep())); - for (const proj of everyProjectDeep) { - const [, ...baseConfigRels] = proj.getConfigPaths().map((p) => Path.relative(REPO_ROOT, p)); - const configRel = Path.relative(REPO_ROOT, proj.tsConfigPath); - - if (baseConfigRels[0] === 'tsconfig.json') { - failed = true; - log.error( - `[${configRel}]: This tsconfig extends the root tsconfig.json file and shouldn't. The root tsconfig.json file is not a valid base config, you probably want to point to the tsconfig.base.json file.` - ); - } - if (configRel !== 'tsconfig.base.json' && !baseConfigRels.includes('tsconfig.base.json')) { - failed = true; - log.error( - `[${configRel}]: This tsconfig does not extend the tsconfig.base.json file either directly or indirectly. The TS config setup for the repo expects every tsconfig file to extend this base config file.` - ); - } - } - - const pathsAndProjects = await asyncMapWithLimit(PROJECTS, 5, async (proj) => { - const paths = await globby(proj.getIncludePatterns(), { - ignore: proj.getExcludePatterns(), - cwd: proj.directory, - onlyFiles: true, - absolute: true, - }); - stats.incr(proj, 'files', paths.length); - return { - proj, - paths, - }; - }); - - const isInMultipleTsProjects = new Map>(); - const pathsToProject = new Map(); - for (const { proj, paths } of pathsAndProjects) { - for (const path of paths) { - if (!pathsToProject.has(path)) { - pathsToProject.set(path, proj); - continue; - } - - if (path.endsWith('.d.ts')) { - stats.incr(proj, 'ignored'); - continue; - } - - isInMultipleTsProjects.set( - path, - new Set([...(isInMultipleTsProjects.get(path) ?? []), proj]) - ); - } - } - - if (isInMultipleTsProjects.size) { - failed = true; - const details = Array.from(isInMultipleTsProjects) - .map( - ([path, projects]) => - ` - ${Path.relative(process.cwd(), path)}:\n${Array.from(projects) - .map((p) => ` - ${Path.relative(process.cwd(), p.tsConfigPath)}`) - .join('\n')}` - ) - .join('\n'); - - log.error( - `The following files belong to multiple tsconfig.json files listed in src/dev/typescript/projects.ts\n${details}` - ); - } - - const isNotInTsProject: File[] = []; - for (const { abs } of await getRepoFiles()) { - const file = new File(abs); - if (!file.isTypescript() || file.isFixture()) { - continue; - } - - const proj = pathsToProject.get(file.getAbsolutePath()); - if (proj === undefined) { - isNotInTsProject.push(file); - } else { - stats.incr(proj, 'gitMatched'); - } - } - - if (isNotInTsProject.length) { - failed = true; - log.error( - `The following files do not belong to a tsconfig.json file, or that tsconfig.json file is not listed in src/dev/typescript/projects.ts\n${isNotInTsProject - .map((file) => ` - ${file.getRelativePath()}`) - .join('\n')}` - ); - } - - for (const [metric, counts] of Object.entries(stats.counts)) { - log.verbose('metric:', metric); - for (const [proj, count] of Array.from(counts).sort((a, b) => - a[0].name.localeCompare(b[0].name) - )) { - log.verbose(' ', proj.name, count); - } - } - - if (failed) { - throw createFailError('see above errors'); - } else { - log.success('All ts files belong to a single ts project'); - } - }, - { - description: - 'Check that all .ts and .tsx files in the repository are assigned to a tsconfig.json file', - } - ); -} diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts deleted file mode 100644 index ad1907f0f120..000000000000 --- a/src/dev/typescript/run_type_check_cli.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Path from 'path'; -import Fs from 'fs'; -import Fsp from 'fs/promises'; - -import { run } from '@kbn/dev-cli-runner'; -import { createFailError } from '@kbn/dev-cli-errors'; -import { REPO_ROOT } from '@kbn/utils'; -import { Jsonc } from '@kbn/bazel-packages'; -import { runBazel } from '@kbn/bazel-runner'; -import { asyncForEachWithLimit } from '@kbn/std'; -import { BazelPackage, discoverBazelPackages } from '@kbn/bazel-packages'; - -import { PROJECTS } from './projects'; -import { Project } from './project'; -import { - updateRootRefsConfig, - cleanupRootRefsConfig, - ROOT_REFS_CONFIG_PATH, -} from './root_refs_config'; - -function rel(from: string, to: string) { - const relative = Path.relative(from, to); - return relative.startsWith('.') ? relative : `./${relative}`; -} - -function isValidRefs(refs: unknown): refs is Array<{ path: string }> { - return ( - Array.isArray(refs) && - refs.every( - (r) => typeof r === 'object' && r !== null && 'path' in r && typeof r.path === 'string' - ) - ); -} - -function parseTsconfig(path: string) { - const jsonc = Fs.readFileSync(path, 'utf8'); - const parsed = Jsonc.parse(jsonc) as Record; - if (typeof parsed !== 'object' || parsed === null) { - throw createFailError(`expected JSON at ${path} to parse into an object`); - } - - return parsed; -} - -function toTypeCheckConfigPath(path: string) { - return path.endsWith('tsconfig.base.json') - ? path.replace(/\/tsconfig\.base\.json$/, '/tsconfig.base.type_check.json') - : path.replace(/\/tsconfig\.json$/, '/tsconfig.type_check.json'); -} - -function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage[]) { - const created = new Set(); - const bazelPackageIds = new Set(bazelPackages.map((p) => p.manifest.id)); - - // write root tsconfig.type_check.json - const baseTypeCheckConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.type_check.json'); - const baseConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json'); - const baseStat = Fs.statSync(baseConfigPath); - const basePaths = parseTsconfig(baseConfigPath).compilerOptions.paths; - if (typeof basePaths !== 'object' || basePaths === null) { - throw createFailError(`expected root compilerOptions.paths to be an object`); - } - Fs.writeFileSync( - baseTypeCheckConfigPath, - JSON.stringify( - { - extends: './tsconfig.base.json', - compilerOptions: { - paths: Object.fromEntries( - Object.entries(basePaths).flatMap(([key, value]) => { - if (key.endsWith('/*') && bazelPackageIds.has(key.slice(0, -2))) { - return []; - } - - if (bazelPackageIds.has(key)) { - return []; - } - - return [[key, value]]; - }) - ), - }, - }, - null, - 2 - ) - ); - Fs.utimesSync(baseTypeCheckConfigPath, baseStat.atime, baseStat.mtime); - created.add(baseTypeCheckConfigPath); - - // write tsconfig.type_check.json files for each project that is not the root - const queue = new Set(projects.map((p) => p.tsConfigPath)); - for (const path of queue) { - const tsconfigStat = Fs.statSync(path); - const parsed = parseTsconfig(path); - - const dir = Path.dirname(path); - const typeCheckConfigPath = Path.resolve(dir, 'tsconfig.type_check.json'); - const refs = parsed.kbn_references ?? []; - if (!isValidRefs(refs)) { - throw new Error(`expected valid TS refs in ${path}`); - } - - const typeCheckConfig = { - ...parsed, - extends: parsed.extends - ? toTypeCheckConfigPath(parsed.extends) - : rel(dir, baseTypeCheckConfigPath), - compilerOptions: { - ...parsed.compilerOptions, - composite: true, - rootDir: '.', - paths: undefined, - }, - kbn_references: undefined, - references: refs.map((ref) => ({ - path: toTypeCheckConfigPath(ref.path), - })), - }; - - Fs.writeFileSync(typeCheckConfigPath, JSON.stringify(typeCheckConfig, null, 2)); - Fs.utimesSync(typeCheckConfigPath, tsconfigStat.atime, tsconfigStat.mtime); - - created.add(typeCheckConfigPath); - - // add all the referenced config files to the queue if they're not already in it - for (const ref of refs) { - queue.add(Path.resolve(dir, ref.path)); - } - } - - return created; -} - -export async function runTypeCheckCli() { - run( - async ({ log, flagsReader, procRunner }) => { - if (flagsReader.boolean('clean-cache')) { - await asyncForEachWithLimit(PROJECTS, 10, async (proj) => { - await Fsp.rm(Path.resolve(proj.directory, 'target/types'), { - force: true, - recursive: true, - }); - }); - log.warning('Deleted all typescript caches'); - } - - await runBazel(['build', '//packages:build_types', '--show_result=1'], { - cwd: REPO_ROOT, - logPrefix: '\x1b[94m[bazel]\x1b[39m', - onErrorExit(code: any, output: any) { - throw createFailError( - `The bazel command that was running exited with code [${code}] and output: ${output}` - ); - }, - }); - - const bazelPackages = await discoverBazelPackages(REPO_ROOT); - - // if the tsconfig.refs.json file is not self-managed then make sure it has - // a reference to every composite project in the repo - await updateRootRefsConfig(log, bazelPackages); - - const projectFilter = flagsReader.path('project'); - - const projects = PROJECTS.filter((p) => { - return !p.disableTypeCheck && (!projectFilter || p.tsConfigPath === projectFilter); - }); - - const created = createTypeCheckConfigs(projects, bazelPackages); - - let pluginBuildResult; - try { - log.info(`Building TypeScript projects to check types...`); - - const relative = Path.relative( - REPO_ROOT, - projects.length === 1 ? projects[0].typeCheckConfigPath : ROOT_REFS_CONFIG_PATH - ); - - await procRunner.run('tsc', { - cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')), - args: [ - '-b', - relative, - '--pretty', - ...(flagsReader.boolean('verbose') ? ['--verbose'] : []), - ], - cwd: REPO_ROOT, - wait: true, - }); - - pluginBuildResult = { failed: false }; - } catch (error) { - pluginBuildResult = { failed: true }; - } - - // cleanup - if (flagsReader.boolean('cleanup')) { - await cleanupRootRefsConfig(); - - await asyncForEachWithLimit(created, 40, async (path) => { - await Fsp.unlink(path); - }); - - await asyncForEachWithLimit(bazelPackages, 40, async (pkg) => { - const targetTypesPaths = Path.resolve( - REPO_ROOT, - 'bazel-bin', - pkg.normalizedRepoRelativeDir, - 'target_type' - ); - - await Fsp.rm(targetTypesPaths, { - force: true, - recursive: true, - }); - }); - } - - if (pluginBuildResult.failed) { - throw createFailError('Unable to build TS project refs'); - } - }, - { - description: ` - Run the TypeScript compiler without emitting files so that it can check types during development. - - Examples: - # check types in all projects - node scripts/type_check - - # check types in a single project - node scripts/type_check --project packages/kbn-pm/tsconfig.json - `, - flags: { - string: ['project'], - boolean: ['clean-cache', 'cleanup'], - default: { - cleanup: true, - }, - help: ` - --project [path] Path to a tsconfig.json file determines the project to check - --help Show this message - --clean-cache Delete any existing TypeScript caches before running type check - --no-cleanup Pass to avoid deleting the temporary tsconfig files written to disk - `, - }, - } - ); -} diff --git a/src/dev/typescript/ts_configfile.ts b/src/dev/typescript/ts_configfile.ts deleted file mode 100644 index 7998edcf80bc..000000000000 --- a/src/dev/typescript/ts_configfile.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import Fs from 'fs'; -import Path from 'path'; - -import { parseConfigFileTextToJson } from 'typescript'; - -// yes, this is just `any`, but I'm hoping that TypeScript will give us some help here eventually -type TsConfigFile = ReturnType['config']; - -export function parseTsConfig(tsConfigPath: string): TsConfigFile { - const { error, config } = parseConfigFileTextToJson( - tsConfigPath, - Fs.readFileSync(tsConfigPath, 'utf8') - ); - - if (error) { - throw error; - } - - return config; -} - -export function getOutputsDeep(tsConfigPaths: string[]) { - const tsConfigs = new Map(); - - const read = (path: string) => { - const cached = tsConfigs.get(path); - if (cached) { - return cached; - } - - const config = parseTsConfig(path); - tsConfigs.set(path, config); - return config; - }; - - const outputDirs: string[] = []; - const seen = new Set(); - - const traverse = (path: string) => { - const config = read(path); - if (seen.has(config)) { - return; - } - seen.add(config); - - const dirname = Path.dirname(path); - const relativeOutDir: string | undefined = config.compilerOptions?.outDir; - if (relativeOutDir) { - outputDirs.push(Path.resolve(dirname, relativeOutDir)); - } - - const refs: undefined | Array<{ path: string }> = config.references; - for (const ref of refs ?? []) { - traverse(Path.resolve(dirname, ref.path)); - } - }; - - for (const path of tsConfigPaths) { - traverse(path); - } - - return outputDirs; -} diff --git a/src/fixtures/tsconfig.json b/src/fixtures/tsconfig.json index bd36efa96533..ceb00717fa6c 100644 --- a/src/fixtures/tsconfig.json +++ b/src/fixtures/tsconfig.json @@ -1,15 +1,15 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "telemetry_collectors/**/*", ], "kbn_references": [ - { "path": "../core/tsconfig.json" }, - { "path": "../plugins/usage_collection/tsconfig.json" }, + "@kbn/usage-collection-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json index 921db12b8986..17a6f098a618 100644 --- a/src/plugins/advanced_settings/tsconfig.json +++ b/src/plugins/advanced_settings/tsconfig.json @@ -1,20 +1,27 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", "server/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../management/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, + "@kbn/core", + "@kbn/management-plugin", + "@kbn/home-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-react-plugin", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/analytics", + "@kbn/kibana-utils-plugin", + "@kbn/i18n-react", + "@kbn/expect", + "@kbn/monaco", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/bfetch/tsconfig.json b/src/plugins/bfetch/tsconfig.json index 829b781e8bd2..dfc8dcab1c1a 100644 --- a/src/plugins/bfetch/tsconfig.json +++ b/src/plugins/bfetch/tsconfig.json @@ -1,13 +1,18 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*", "index.ts"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/i18n", + "@kbn/config-schema", + "@kbn/std", + "@kbn/core-http-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_gauge/tsconfig.json b/src/plugins/chart_expressions/expression_gauge/tsconfig.json index 3ab82197cb9f..0a778f80f7ca 100644 --- a/src/plugins/chart_expressions/expression_gauge/tsconfig.json +++ b/src/plugins/chart_expressions/expression_gauge/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,12 +11,23 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/field-formats-plugin", + "@kbn/charts-plugin", + "@kbn/visualizations-plugin", + "@kbn/coloring", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/analytics", + "@kbn/chart-icons", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_heatmap/tsconfig.json b/src/plugins/chart_expressions/expression_heatmap/tsconfig.json index 3ab82197cb9f..051ed48547ec 100644 --- a/src/plugins/chart_expressions/expression_heatmap/tsconfig.json +++ b/src/plugins/chart_expressions/expression_heatmap/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,12 +11,23 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/field-formats-plugin", + "@kbn/charts-plugin", + "@kbn/visualizations-plugin", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/test-jest-helpers", + "@kbn/chart-icons", + "@kbn/kibana-react-plugin", + "@kbn/analytics", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json b/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json index 900bc4c8da26..e90c86b49baa 100644 --- a/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json +++ b/src/plugins/chart_expressions/expression_legacy_metric/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,12 +11,22 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/presentation-util-plugin", + "@kbn/field-formats-plugin", + "@kbn/charts-plugin", + "@kbn/usage-collection-plugin", + "@kbn/visualizations-plugin", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/utility-types", + "@kbn/kibana-utils-plugin", + "@kbn/analytics", + "@kbn/kibana-react-plugin", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_metric/tsconfig.json b/src/plugins/chart_expressions/expression_metric/tsconfig.json index 3ab82197cb9f..91f2f6ad1e8a 100644 --- a/src/plugins/chart_expressions/expression_metric/tsconfig.json +++ b/src/plugins/chart_expressions/expression_metric/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,12 +11,22 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/field-formats-plugin", + "@kbn/charts-plugin", + "@kbn/visualizations-plugin", + "@kbn/inspector-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/kibana-utils-plugin", + "@kbn/ui-theme", + "@kbn/kibana-react-plugin", + "@kbn/analytics", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json index c899eae805af..6bfe52529a6c 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json +++ b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,13 +11,25 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" } + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/presentation-util-plugin", + "@kbn/data-plugin", + "@kbn/field-formats-plugin", + "@kbn/charts-plugin", + "@kbn/visualizations-plugin", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/embeddable-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + "@kbn/analytics", + "@kbn/chart-icons", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json index 70951dc9e2c0..4fcbf1d0b967 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json +++ b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,13 +11,22 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../presentation_util/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/visualizations-plugin", + "@kbn/charts-plugin", + "@kbn/field-formats-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/utility-types", + "@kbn/coloring", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + "@kbn/analytics", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/expression_xy/tsconfig.json b/src/plugins/chart_expressions/expression_xy/tsconfig.json index 62d9861684cc..0e0820e82426 100644 --- a/src/plugins/chart_expressions/expression_xy/tsconfig.json +++ b/src/plugins/chart_expressions/expression_xy/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,15 +11,27 @@ ], "kbn_references": [ { "path": "../tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../../core/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../data/tsconfig.json"}, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../ui_actions/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json"}, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../event_annotation/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, + "@kbn/charts-plugin", + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/data-plugin", + "@kbn/usage-collection-plugin", + "@kbn/field-formats-plugin", + "@kbn/event-annotation-plugin", + "@kbn/visualizations-plugin", + "@kbn/coloring", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/embeddable-plugin", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/datemath", + "@kbn/chart-icons", + "@kbn/ui-theme", + "@kbn/analytics", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/chart_expressions/tsconfig.json b/src/plugins/chart_expressions/tsconfig.json index 6890928b48d6..7d29316e48f1 100644 --- a/src/plugins/chart_expressions/tsconfig.json +++ b/src/plugins/chart_expressions/tsconfig.json @@ -1,16 +1,16 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ "common/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, + "@kbn/core-execution-context-common", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index 881263657efb..42bbe987f45f 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -1,14 +1,22 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" } + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/embeddable-plugin", + "@kbn/coloring", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/i18n-react", + "@kbn/ui-theme", + "@kbn/shared-ux-utility", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts index ddcb02a0ad45..a8cb74000362 100644 --- a/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts +++ b/src/plugins/console/public/application/models/legacy_core_editor/legacy_core_editor.test.mocks.ts @@ -10,11 +10,7 @@ jest.mock('./mode/worker', () => { return { workerModule: { id: 'sense_editor/mode/worker', src: '' } }; }); -// @ts-ignore -window.Worker = function () { - this.postMessage = () => {}; - (this as unknown as { terminate: () => void }).terminate = () => {}; -}; +import '@kbn/web-worker-stub'; // @ts-ignore window.URL = { diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index cc44f6119f2d..77949a21f62c 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", // there is still a decent amount of JS in this plugin and we are taking // advantage of the fact that TS doesn't know the types of that code and // gives us `any`. Once that code is converted to .ts we can remove this @@ -12,13 +10,28 @@ }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../dev_tools/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" } + "@kbn/core", + "@kbn/dev-tools-plugin", + "@kbn/es-ui-shared-plugin", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/share-plugin", + "@kbn/usage-collection-plugin", + "@kbn/i18n", + "@kbn/analytics", + "@kbn/utility-types", + "@kbn/i18n-react", + "@kbn/shared-ux-utility", + "@kbn/core-http-browser", + "@kbn/ace", + "@kbn/test-jest-helpers", + "@kbn/config-schema", + "@kbn/core-http-server", + "@kbn/core-http-router-server-internal", + "@kbn/web-worker-stub", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/controls/storybook/manager.ts b/src/plugins/controls/storybook/manager.ts index cc6ebbcfdaa7..9b981f8b5823 100644 --- a/src/plugins/controls/storybook/manager.ts +++ b/src/plugins/controls/storybook/manager.ts @@ -10,8 +10,7 @@ import { addons } from '@storybook/addons'; import { create } from '@storybook/theming'; import { PANEL_ID } from '@storybook/addon-actions'; -// @ts-expect-error There's probably a better way to do this. -import { registerThemeSwitcherAddon } from '@kbn/storybook/target_node/src/lib/register_theme_switcher_addon'; +import { registerThemeSwitcherAddon } from '@kbn/storybook/src/lib/register_theme_switcher_addon'; addons.setConfig({ theme: create({ diff --git a/src/plugins/controls/tsconfig.json b/src/plugins/controls/tsconfig.json index 75fa7069996a..6aedcaf23695 100644 --- a/src/plugins/controls/tsconfig.json +++ b/src/plugins/controls/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "extraPublicDirs": ["common"], "include": [ @@ -16,13 +14,26 @@ "./jest_setup.ts" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/embeddable-plugin", + "@kbn/presentation-util-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-plugin", + "@kbn/unified-search-plugin", + "@kbn/es-query", + "@kbn/data-views-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-mount-utils-browser-internal", + "@kbn/datemath", + "@kbn/test-jest-helpers", + "@kbn/config-schema", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/custom_integrations/tsconfig.json b/src/plugins/custom_integrations/tsconfig.json index 0fee0d2156ce..8cee7c6515e6 100644 --- a/src/plugins/custom_integrations/tsconfig.json +++ b/src/plugins/custom_integrations/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../../typings/**/*", @@ -13,7 +11,16 @@ "storybook/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/ui-theme", + "@kbn/logging-mocks", + "@kbn/config-schema", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 390fc6f6a0a5..4e44429125dd 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -1,32 +1,59 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["*.ts", ".storybook/**/*.ts", "common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../controls/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../navigation/tsconfig.json" }, - { "path": "../saved_objects_tagging_oss/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../screenshot_mode/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" } + "@kbn/core", + "@kbn/inspector-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/share-plugin", + "@kbn/controls-plugin", + "@kbn/presentation-util-plugin", + "@kbn/url-forwarding-plugin", + "@kbn/usage-collection-plugin", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/home-plugin", + "@kbn/navigation-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/saved-objects-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/ui-actions-plugin", + "@kbn/visualizations-plugin", + "@kbn/spaces-plugin", + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/es-query", + "@kbn/i18n", + "@kbn/data-view-editor-plugin", + "@kbn/unified-search-plugin", + "@kbn/shared-ux-page-analytics-no-data", + "@kbn/content-management-table-list", + "@kbn/i18n-react", + "@kbn/expressions-plugin", + "@kbn/field-formats-plugin", + "@kbn/test-jest-helpers", + "@kbn/core-application-browser", + "@kbn/ebt-tools", + "@kbn/shared-ux-button-exit-full-screen", + "@kbn/core-analytics-browser-mocks", + "@kbn/core-application-browser-mocks", + "@kbn/analytics", + "@kbn/safer-lodash-set", + "@kbn/core-notifications-browser-mocks", + "@kbn/core-overlays-browser-mocks", + "@kbn/core-theme-browser-mocks", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/core-saved-objects-common", + "@kbn/task-manager-plugin", + "@kbn/core-execution-context-common", + "@kbn/shared-ux-utility", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 415ec0795359..48bb37d77ed9 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -16,18 +14,40 @@ "../../../typings/index.d.ts" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../bfetch/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../screenshot_mode/tsconfig.json" }, - { "path": "../../../x-pack/plugins/task_manager/tsconfig.json" }, - { "path": "../../../x-pack/plugins/security/tsconfig.json" } + "@kbn/core", + "@kbn/bfetch-plugin", + "@kbn/ui-actions-plugin", + "@kbn/share-plugin", + "@kbn/inspector-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-views-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/task-manager-plugin", + "@kbn/security-plugin", + "@kbn/expressions-plugin", + "@kbn/field-types", + "@kbn/es-query", + "@kbn/expect", + "@kbn/datemath", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/utility-types-jest", + "@kbn/safer-lodash-set", + "@kbn/management-plugin", + "@kbn/test-jest-helpers", + "@kbn/core-notifications-browser-mocks", + "@kbn/std", + "@kbn/i18n-react", + "@kbn/analytics", + "@kbn/core-http-browser", + "@kbn/crypto-browser", + "@kbn/config", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/data_view_editor/tsconfig.json b/src/plugins/data_view_editor/tsconfig.json index 6a0f779db2f9..3f1744281db9 100644 --- a/src/plugins/data_view_editor/tsconfig.json +++ b/src/plugins/data_view_editor/tsconfig.json @@ -1,19 +1,24 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", + "@kbn/es-ui-shared-plugin", + "@kbn/i18n-react", + "@kbn/usage-collection-plugin", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/data_view_field_editor/tsconfig.json b/src/plugins/data_view_field_editor/tsconfig.json index c4f3c835bff0..264c9fdb5903 100644 --- a/src/plugins/data_view_field_editor/tsconfig.json +++ b/src/plugins/data_view_field_editor/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../../typings/**/*", @@ -13,12 +11,23 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", + "@kbn/es-ui-shared-plugin", + "@kbn/field-formats-plugin", + "@kbn/test-jest-helpers", + "@kbn/i18n", + "@kbn/usage-collection-plugin", + "@kbn/monaco", + "@kbn/analytics", + "@kbn/i18n-react", + "@kbn/field-types", + "@kbn/utility-types", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/data_view_management/tsconfig.json b/src/plugins/data_view_management/tsconfig.json index 9d2b60cc6954..5fc549c32a46 100644 --- a/src/plugins/data_view_management/tsconfig.json +++ b/src/plugins/data_view_management/tsconfig.json @@ -1,26 +1,39 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../management/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../es_ui_shared/tsconfig.json" }, - { "path": "../data_view_field_editor/tsconfig.json" }, - { "path": "../data_view_editor/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" }, - { "path": "../saved_objects_management/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/management-plugin", + "@kbn/url-forwarding-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/unified-search-plugin", + "@kbn/saved-objects-management-plugin", + "@kbn/spaces-plugin", + "@kbn/i18n", + "@kbn/field-formats-plugin", + "@kbn/data-views-plugin", + "@kbn/i18n-react", + "@kbn/monaco", + "@kbn/field-types", + "@kbn/es-query", + "@kbn/std", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-prompt-no-data-views", + "@kbn/shared-ux-link-redirect-app", + "@kbn/utility-types-jest", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/data_views/tsconfig.json b/src/plugins/data_views/tsconfig.json index 5ac202837385..614b1beda111 100644 --- a/src/plugins/data_views/tsconfig.json +++ b/src/plugins/data_views/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -15,11 +13,21 @@ "server/**/*.json" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" } + "@kbn/core", + "@kbn/usage-collection-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/field-formats-plugin", + "@kbn/expressions-plugin", + "@kbn/core-notifications-browser", + "@kbn/es-query", + "@kbn/field-types", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/core-test-helpers-http-setup-browser", + "@kbn/config-schema", + "@kbn/utility-types-jest", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/dev_tools/tsconfig.json b/src/plugins/dev_tools/tsconfig.json index d7addc665075..314749c7c7f5 100644 --- a/src/plugins/dev_tools/tsconfig.json +++ b/src/plugins/dev_tools/tsconfig.json @@ -1,14 +1,19 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../../../src/plugins/management/tsconfig.json" } + "@kbn/core", + "@kbn/url-forwarding-plugin", + "@kbn/management-plugin", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/ui-theme", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/discover/public/application/context/context_app.scss b/src/plugins/discover/public/application/context/context_app.scss index fa29b0513055..13593a7ed32d 100644 --- a/src/plugins/discover/public/application/context/context_app.scss +++ b/src/plugins/discover/public/application/context/context_app.scss @@ -1,4 +1,4 @@ -@import 'src/core/public/mixins'; +@import '../../../../../core/public/mixins'; .dscDocsPage { @include kibanaFullBodyHeight(54px); // action bar height diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.scss b/src/plugins/discover/public/application/main/components/layout/discover_layout.scss index a65c22b57b2a..b2d9ab190e07 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.scss +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.scss @@ -1,4 +1,4 @@ -@import 'src/core/public/mixins'; +@import '../../../../../../../core/public/mixins'; discover-app { flex-grow: 1; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx index 5b58cda5e0b9..eb39b2f45ab9 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.test.tsx @@ -167,7 +167,7 @@ describe('Discover component', () => { expect( container.querySelector('[data-test-subj="unifiedHistogramChartOptionsToggle"]') ).toBeNull(); - }); + }, 10000); test('selected data view with time field displays chart toggle', async () => { const container = document.createElement('div'); @@ -206,16 +206,16 @@ describe('Discover component', () => { test('should be opened if discover:sidebarClosed was not set', async () => { const component = await mountComponent(dataViewWithTimefieldMock, undefined); expect(component.find(DiscoverSidebar).length).toBe(1); - }); + }, 10000); test('should be opened if discover:sidebarClosed is false', async () => { const component = await mountComponent(dataViewWithTimefieldMock, false); expect(component.find(DiscoverSidebar).length).toBe(1); - }); + }, 10000); test('should be closed if discover:sidebarClosed is true', async () => { const component = await mountComponent(dataViewWithTimefieldMock, true); expect(component.find(DiscoverSidebar).length).toBe(0); - }); + }, 10000); }); }); diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 4239fdfe2ea8..c8974adadb35 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", // there is still a decent amount of JS in this plugin and we are taking // advantage of the fact that TS doesn't know the types of that code and // gives us `any`. Once that code is converted to .ts we can remove this @@ -12,32 +10,55 @@ }, "include": ["common/**/*", "public/**/*", "server/**/*", "../../../typings/**/*", ".storybook/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../saved_search/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../saved_objects_finder/tsconfig.json" }, - { "path": "../navigation/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data_view_field_editor/tsconfig.json"}, - { "path": "../field_formats/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" }, - { "path": "../unified_field_list/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" }, - { "path": "../data_view_editor/tsconfig.json" }, - { "path": "../../../x-pack/plugins/triggers_actions_ui/tsconfig.json" }, - { "path": "../saved_objects_tagging_oss/tsconfig.json" }, - { "path": "../unified_histogram/tsconfig.json" } + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/saved-search-plugin", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/embeddable-plugin", + "@kbn/inspector-plugin", + "@kbn/url-forwarding-plugin", + "@kbn/saved-objects-plugin", + "@kbn/saved-objects-finder-plugin", + "@kbn/navigation-plugin", + "@kbn/ui-actions-plugin", + "@kbn/home-plugin", + "@kbn/share-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-views-plugin", + "@kbn/unified-search-plugin", + "@kbn/unified-field-list-plugin", + "@kbn/spaces-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/unified-histogram-plugin", + "@kbn/analytics", + "@kbn/saved-objects-management-plugin", + "@kbn/lens-plugin", + "@kbn/es-query", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/std", + "@kbn/core-ui-settings-browser", + "@kbn/i18n-react", + "@kbn/datemath", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-page-analytics-no-data", + "@kbn/alerting-plugin", + "@kbn/ui-theme", + "@kbn/react-field", + "@kbn/monaco", + "@kbn/core-notifications-browser", + "@kbn/rison", + "@kbn/config-schema", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index 6943f5fdc547..645b3ae3dfe0 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ ".storybook/**/*", @@ -12,11 +10,25 @@ "server/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, + "@kbn/core", + "@kbn/inspector-plugin", + "@kbn/saved-objects-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/ui-actions-plugin", + "@kbn/i18n-react", + "@kbn/storybook", + "@kbn/utility-types", + "@kbn/es-query", + "@kbn/core-theme-browser", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/std", + "@kbn/expressions-plugin", + "@kbn/usage-collection-plugin", + "@kbn/analytics", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts index 113d33dba710..744f837ea1bb 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/shared_imports.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -// eslint-disable-next-line import/no-extraneous-dependencies export type { TestBed } from '@kbn/test-jest-helpers'; -// eslint-disable-next-line import/no-extraneous-dependencies +// eslint-disable-next-line @kbn/imports/no_boundary_crossing export { registerTestBed, getRandomString } from '@kbn/test-jest-helpers'; diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 5cb4f3ddfffa..b88684db5556 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "__packages_do_not_import__/**/*", @@ -15,7 +13,18 @@ ".storybook/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" } + "@kbn/core", + "@kbn/data-views-plugin", + "@kbn/i18n", + "@kbn/shared-ux-page-kibana-template", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/share-plugin", + "@kbn/kibana-react-plugin", + "@kbn/safer-lodash-set", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/event_annotation/tsconfig.json b/src/plugins/event_annotation/tsconfig.json index 21d8b7390056..0ee8e0ee8f19 100644 --- a/src/plugins/event_annotation/tsconfig.json +++ b/src/plugins/event_annotation/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -11,14 +9,18 @@ "server/**/*" ], "kbn_references": [ - { - "path": "../../core/tsconfig.json" - }, - { - "path": "../expressions/tsconfig.json" - }, - { - "path": "../data/tsconfig.json" - }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/data-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/data-views-plugin", + "@kbn/inspector-plugin", + "@kbn/core-ui-settings-browser", + "@kbn/datemath", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } \ No newline at end of file diff --git a/src/plugins/expression_error/tsconfig.json b/src/plugins/expression_error/tsconfig.json index 419685fe65a3..1cda452adcb7 100644 --- a/src/plugins/expression_error/tsconfig.json +++ b/src/plugins/expression_error/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -12,8 +10,14 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/kibana-react-plugin", + "@kbn/i18n-react", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expression_image/tsconfig.json b/src/plugins/expression_image/tsconfig.json index f77c02661911..8aa60e9f6e42 100644 --- a/src/plugins/expression_image/tsconfig.json +++ b/src/plugins/expression_image/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,8 +11,14 @@ "__fixtures__/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/expect", + "@kbn/i18n", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expression_metric/tsconfig.json b/src/plugins/expression_metric/tsconfig.json index f77c02661911..de672f871a83 100644 --- a/src/plugins/expression_metric/tsconfig.json +++ b/src/plugins/expression_metric/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,8 +11,13 @@ "__fixtures__/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expression_repeat_image/tsconfig.json b/src/plugins/expression_repeat_image/tsconfig.json index 419685fe65a3..c167e9b9e684 100644 --- a/src/plugins/expression_repeat_image/tsconfig.json +++ b/src/plugins/expression_repeat_image/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -12,8 +10,14 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expression_reveal_image/tsconfig.json b/src/plugins/expression_reveal_image/tsconfig.json index 419685fe65a3..c167e9b9e684 100644 --- a/src/plugins/expression_reveal_image/tsconfig.json +++ b/src/plugins/expression_reveal_image/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -12,8 +10,14 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expression_shape/tsconfig.json b/src/plugins/expression_shape/tsconfig.json index f77c02661911..2c3979e83314 100644 --- a/src/plugins/expression_shape/tsconfig.json +++ b/src/plugins/expression_shape/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,8 +11,14 @@ "__fixtures__/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/presentation-util-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/expressions/tsconfig.json b/src/plugins/expressions/tsconfig.json index 890274c1b391..1f1128ae6ab1 100644 --- a/src/plugins/expressions/tsconfig.json +++ b/src/plugins/expressions/tsconfig.json @@ -1,16 +1,23 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*", "./index.ts"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/inspector-plugin", + "@kbn/field-formats-plugin", + "@kbn/logging", + "@kbn/utility-types", + "@kbn/interpreter", + "@kbn/i18n", + "@kbn/std", + "@kbn/core-execution-context-common", + "@kbn/tinymath", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/field_formats/tsconfig.json b/src/plugins/field_formats/tsconfig.json index 4838076f81cd..754b3b993cb0 100644 --- a/src/plugins/field_formats/tsconfig.json +++ b/src/plugins/field_formats/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -13,5 +11,14 @@ "common/**/*.json", "public/**/*.json" ], - "kbn_references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [ + "@kbn/core", + "@kbn/field-types", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", + ] } diff --git a/src/plugins/files/tsconfig.json b/src/plugins/files/tsconfig.json index 7b677de51dab..02b5acc39ff8 100644 --- a/src/plugins/files/tsconfig.json +++ b/src/plugins/files/tsconfig.json @@ -1,14 +1,34 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*", ".storybook/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../../../x-pack/plugins/security/tsconfig.json" }, + "@kbn/core", + "@kbn/usage-collection-plugin", + "@kbn/security-plugin", + "@kbn/config-schema", + "@kbn/shared-ux-file-types", + "@kbn/kibana-utils-plugin", + "@kbn/shared-ux-file-mocks", + "@kbn/utility-types-jest", + "@kbn/core-application-common", + "@kbn/features-plugin", + "@kbn/i18n", + "@kbn/core-analytics-server", + "@kbn/utility-types", + "@kbn/es-query", + "@kbn/core-test-helpers-kbn-server", + "@kbn/ebt-tools", + "@kbn/core-http-router-server-internal", + "@kbn/core-elasticsearch-server", + "@kbn/std", + "@kbn/core-saved-objects-api-server", + "@kbn/core-logging-server-mocks", + "@kbn/ecs", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/files_management/tsconfig.json b/src/plugins/files_management/tsconfig.json index f46c7f926253..a8852fcb7039 100644 --- a/src/plugins/files_management/tsconfig.json +++ b/src/plugins/files_management/tsconfig.json @@ -1,14 +1,20 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*", ".storybook/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../files/tsconfig.json" }, - { "path": "../management/tsconfig.json" } + "@kbn/core", + "@kbn/files-plugin", + "@kbn/management-plugin", + "@kbn/i18n", + "@kbn/content-management-table-list", + "@kbn/kibana-react-plugin", + "@kbn/i18n-react", + "@kbn/shared-ux-file-image", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/guided_onboarding/tsconfig.json b/src/plugins/guided_onboarding/tsconfig.json index 4833767f0d6e..42026215e18f 100644 --- a/src/plugins/guided_onboarding/tsconfig.json +++ b/src/plugins/guided_onboarding/tsconfig.json @@ -1,19 +1,25 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { - "path": "../../core/tsconfig.json" - }, - { - "path": "../kibana_react/tsconfig.json" - }, - { "path": "../../../x-pack/plugins/cloud/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/cloud-plugin", + "@kbn/guided-onboarding", + "@kbn/i18n-react", + "@kbn/core-application-browser-mocks", + "@kbn/core-notifications-browser-mocks", + "@kbn/test-jest-helpers", + "@kbn/i18n", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index b7c8c94e30b8..693c8189c504 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -1,21 +1,38 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": ["common/**/*", "public/**/*", "server/**/*", "config.ts", ".storybook/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../custom_integrations/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../guided_onboarding/tsconfig.json" }, - { "path": "../../../x-pack/plugins/cloud/tsconfig.json" }, + "@kbn/core", + "@kbn/data-views-plugin", + "@kbn/custom-integrations-plugin", + "@kbn/kibana-react-plugin", + "@kbn/share-plugin", + "@kbn/url-forwarding-plugin", + "@kbn/usage-collection-plugin", + "@kbn/guided-onboarding-plugin", + "@kbn/cloud-plugin", + "@kbn/i18n", + "@kbn/home-sample-data-tab", + "@kbn/analytics", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-page-kibana-template", + "@kbn/utility-types", + "@kbn/guided-onboarding", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/ui-theme", + "@kbn/config-schema", + "@kbn/utility-types-jest", + "@kbn/es-query", + "@kbn/ebt-tools", + "@kbn/core-analytics-server", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/image_embeddable/public/imports.ts b/src/plugins/image_embeddable/public/imports.ts index 1761cc5d05a3..5f3c04044acb 100644 --- a/src/plugins/image_embeddable/public/imports.ts +++ b/src/plugins/image_embeddable/public/imports.ts @@ -16,7 +16,7 @@ export type { ScopedFilesClient, } from '@kbn/files-plugin/public'; -export type { FileImageMetadata } from '@kbn/shared-ux-file-types/'; +export type { FileImageMetadata } from '@kbn/shared-ux-file-types'; export type { IContainer, diff --git a/src/plugins/image_embeddable/tsconfig.json b/src/plugins/image_embeddable/tsconfig.json index c3cec07779c3..4d1ba66af6c0 100644 --- a/src/plugins/image_embeddable/tsconfig.json +++ b/src/plugins/image_embeddable/tsconfig.json @@ -1,17 +1,26 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true + "outDir": "target/types", }, "include": ["public/**/*", "common/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../files/tsconfig.json" } + "@kbn/core", + "@kbn/embeddable-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/files-plugin", + "@kbn/shared-ux-file-context", + "@kbn/shared-ux-file-upload", + "@kbn/shared-ux-file-picker", + "@kbn/shared-ux-file-types", + "@kbn/i18n-react", + "@kbn/shared-ux-file-mocks", + "@kbn/i18n", + "@kbn/core-http-browser", + "@kbn/shared-ux-file-image", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/input_control_vis/tsconfig.json b/src/plugins/input_control_vis/tsconfig.json index 0fd1cae17a21..1e3e1f4f0059 100644 --- a/src/plugins/input_control_vis/tsconfig.json +++ b/src/plugins/input_control_vis/tsconfig.json @@ -1,21 +1,28 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", "server/**/*", ], "kbn_references": [ - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data/tsconfig.json"}, - { "path": "../data_views/tsconfig.json"}, - { "path": "../expressions/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" } + "@kbn/kibana-react-plugin", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/unified-search-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/core", + "@kbn/es-query", + "@kbn/expect", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/inspector/tsconfig.json b/src/plugins/inspector/tsconfig.json index 5ccf9c81aee7..11b753d7ae29 100644 --- a/src/plugins/inspector/tsconfig.json +++ b/src/plugins/inspector/tsconfig.json @@ -1,14 +1,19 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "index.ts"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../share/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/share-plugin", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/monaco", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/interactive_setup/tsconfig.json b/src/plugins/interactive_setup/tsconfig.json index d3b0e7924185..f0dcc93a49c1 100644 --- a/src/plugins/interactive_setup/tsconfig.json +++ b/src/plugins/interactive_setup/tsconfig.json @@ -1,10 +1,26 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], - "kbn_references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [ + "@kbn/core", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/ui-theme", + "@kbn/core-http-browser", + "@kbn/core-status-common-internal", + "@kbn/safer-lodash-set", + "@kbn/test-jest-helpers", + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/std", + "@kbn/utils", + "@kbn/core-logging-server-mocks", + "@kbn/core-preboot-server", + ], + "exclude": [ + "target/**/*", + ] } diff --git a/src/plugins/kibana_overview/tsconfig.json b/src/plugins/kibana_overview/tsconfig.json index 98d5602cbd1a..5630613c4bf1 100644 --- a/src/plugins/kibana_overview/tsconfig.json +++ b/src/plugins/kibana_overview/tsconfig.json @@ -1,22 +1,32 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", "common/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../plugins/navigation/tsconfig.json" }, - { "path": "../../plugins/data/tsconfig.json" }, - { "path": "../../plugins/home/tsconfig.json" }, - { "path": "../../plugins/newsfeed/tsconfig.json" }, - { "path": "../../plugins/usage_collection/tsconfig.json" }, - { "path": "../../plugins/kibana_react/tsconfig.json" }, - { "path": "../../plugins/data_view_editor/tsconfig.json" } + "@kbn/core", + "@kbn/navigation-plugin", + "@kbn/home-plugin", + "@kbn/newsfeed-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/data-views-plugin", + "@kbn/share-plugin", + "@kbn/analytics", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-page-kibana-template", + "@kbn/shared-ux-page-analytics-no-data", + "@kbn/shared-ux-avatar-solution", + "@kbn/shared-ux-link-redirect-app", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index 3469a30024b5..f36d691c67ac 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -1,10 +1,20 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [".storybook/**/*", "common/**/*", "public/**/*", "../../../typings/**/*"], - "kbn_references": [{ "path": "../kibana_utils/tsconfig.json" }] + "kbn_references": [ + "@kbn/kibana-utils-plugin", + "@kbn/storybook", + "@kbn/ui-theme", + "@kbn/core", + "@kbn/monaco", + "@kbn/test-jest-helpers", + "@kbn/i18n", + "@kbn/i18n-react", + ], + "exclude": [ + "target/**/*", + ] } diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index 2ad8ff44a312..1fc711d49fda 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,8 +11,14 @@ "../../../typings/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../plugins/usage_collection/tsconfig.json" }, - { "path": "../../plugins/telemetry/tsconfig.json" }, + "@kbn/core", + "@kbn/usage-collection-plugin", + "@kbn/analytics-client", + "@kbn/i18n", + "@kbn/logging", + "@kbn/core-test-helpers-kbn-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index 1b5d5491ff28..fed20365ae6d 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -13,5 +11,17 @@ "index.ts", "../../../typings/**/*" ], - "kbn_references": [{ "path": "../../core/tsconfig.json" }] + "kbn_references": [ + "@kbn/core", + "@kbn/expect", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/utility-types-jest", + "@kbn/test-jest-helpers", + "@kbn/rison", + "@kbn/crypto-browser", + ], + "exclude": [ + "target/**/*", + ] } diff --git a/src/plugins/management/tsconfig.json b/src/plugins/management/tsconfig.json index 27031a7f9324..1270aef15b63 100644 --- a/src/plugins/management/tsconfig.json +++ b/src/plugins/management/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,9 +10,17 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../home/tsconfig.json"}, - { "path": "../kibana_react/tsconfig.json"}, - { "path": "../kibana_utils/tsconfig.json"} + "@kbn/core", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/utility-types", + "@kbn/share-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/shared-ux-page-kibana-template", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index 0060910ae4e0..65a655abedff 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -1,13 +1,16 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*", "./config.ts"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../../x-pack/plugins/licensing/tsconfig.json" } + "@kbn/core", + "@kbn/licensing-plugin", + "@kbn/i18n", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index 5586a0d795eb..b23ee2de840e 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -1,15 +1,18 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/unified-search-plugin", + "@kbn/es-query", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/newsfeed/tsconfig.json b/src/plugins/newsfeed/tsconfig.json index 051ecbe4f202..b10a878fb295 100644 --- a/src/plugins/newsfeed/tsconfig.json +++ b/src/plugins/newsfeed/tsconfig.json @@ -1,14 +1,19 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*", "server/**/*", "common/*", "../../../typings/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json"}, - { "path": "../screenshot_mode/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index 8d0b5927980b..c0c69200676b 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -14,10 +12,23 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data/tsconfig.json" } + "@kbn/core", + "@kbn/saved-objects-plugin", + "@kbn/embeddable-plugin", + "@kbn/kibana-react-plugin", + "@kbn/i18n", + "@kbn/expressions-plugin", + "@kbn/data-views-plugin", + "@kbn/i18n-react", + "@kbn/monaco", + "@kbn/es-query", + "@kbn/field-formats-plugin", + "@kbn/interpreter", + "@kbn/react-field", + "@kbn/config-schema", + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index fbc175869da2..d35fe2e1cc18 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -1,15 +1,22 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/i18n", + "@kbn/data-views-plugin", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/utility-types", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/saved_objects_finder/tsconfig.json b/src/plugins/saved_objects_finder/tsconfig.json index 197d86c7b143..6d3b7ebaa690 100644 --- a/src/plugins/saved_objects_finder/tsconfig.json +++ b/src/plugins/saved_objects_finder/tsconfig.json @@ -1,13 +1,18 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../saved_objects_management/tsconfig.json" } + "@kbn/core", + "@kbn/saved-objects-management-plugin", + "@kbn/test-jest-helpers", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/i18n", + "@kbn/saved-objects-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/saved_objects_management/tsconfig.json b/src/plugins/saved_objects_management/tsconfig.json index c6c8e80f8234..cad061f1a27e 100644 --- a/src/plugins/saved_objects_management/tsconfig.json +++ b/src/plugins/saved_objects_management/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -11,12 +9,23 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../management/tsconfig.json" }, - { "path": "../saved_objects_tagging_oss/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/management-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/spaces-plugin", + "@kbn/i18n", + "@kbn/data-views-plugin", + "@kbn/utility-types", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/core-saved-objects-api-server", + "@kbn/monaco", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/saved_objects_tagging_oss/tsconfig.json b/src/plugins/saved_objects_tagging_oss/tsconfig.json index 1126b3175a76..6b98cba4cbd1 100644 --- a/src/plugins/saved_objects_tagging_oss/tsconfig.json +++ b/src/plugins/saved_objects_tagging_oss/tsconfig.json @@ -1,16 +1,17 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", "public/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, + "@kbn/core", + "@kbn/saved-objects-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/saved_search/tsconfig.json b/src/plugins/saved_search/tsconfig.json index 785abeea70a3..286b11f97c36 100644 --- a/src/plugins/saved_search/tsconfig.json +++ b/src/plugins/saved_search/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,10 +10,14 @@ "../../../typings/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" }, - { "path": "../saved_objects_tagging_oss/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/spaces-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/screenshot_mode/tsconfig.json b/src/plugins/screenshot_mode/tsconfig.json index 5762571bd5bb..24dfeef9ca2e 100644 --- a/src/plugins/screenshot_mode/tsconfig.json +++ b/src/plugins/screenshot_mode/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -11,6 +9,10 @@ "server/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, + "@kbn/core", + "@kbn/utility-types-jest", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 80ef97d5006c..f0d79515d0dc 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -1,14 +1,19 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 7fc00b85008c..adb252c1665e 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -15,13 +13,27 @@ "schema/oss_root.json", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../plugins/home/tsconfig.json" }, - { "path": "../../plugins/kibana_react/tsconfig.json" }, - { "path": "../../plugins/kibana_utils/tsconfig.json" }, - { "path": "../../plugins/screenshot_mode/tsconfig.json" }, - { "path": "../../plugins/telemetry_collection_manager/tsconfig.json" }, - { "path": "../../plugins/usage_collection/tsconfig.json" }, - { "path": "../../../x-pack/plugins/security/tsconfig.json" } + "@kbn/core", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/telemetry-collection-manager-plugin", + "@kbn/usage-collection-plugin", + "@kbn/security-plugin", + "@kbn/analytics-shippers-elastic-v3-browser", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-utility", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/analytics-shippers-elastic-v3-server", + "@kbn/config-schema", + "@kbn/utils", + "@kbn/core-saved-objects-server", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-utils-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/telemetry_collection_manager/tsconfig.json b/src/plugins/telemetry_collection_manager/tsconfig.json index cd505b02a02f..f201a8875c8d 100644 --- a/src/plugins/telemetry_collection_manager/tsconfig.json +++ b/src/plugins/telemetry_collection_manager/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -11,7 +9,10 @@ "common/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../plugins/usage_collection/tsconfig.json" } + "@kbn/core", + "@kbn/usage-collection-plugin" + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 6ced5687dd32..ebdad6eb8661 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -11,16 +9,15 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../telemetry/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../bfetch/tsconfig.json"}, - { "path": "../data/tsconfig.json"}, - { "path": "../advanced_settings/tsconfig.json" }, - { "path": "../management/tsconfig.json"} + "@kbn/core", + "@kbn/usage-collection-plugin", + "@kbn/telemetry-plugin", + "@kbn/advanced-settings-plugin", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/ui_actions/tsconfig.json b/src/plugins/ui_actions/tsconfig.json index 2bd694005d43..f1a83bc52b58 100644 --- a/src/plugins/ui_actions/tsconfig.json +++ b/src/plugins/ui_actions/tsconfig.json @@ -1,16 +1,21 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-views-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/es-query", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/ui_actions_enhanced/tsconfig.json b/src/plugins/ui_actions_enhanced/tsconfig.json index c0d3e64038dc..ccb424b83a1b 100644 --- a/src/plugins/ui_actions_enhanced/tsconfig.json +++ b/src/plugins/ui_actions_enhanced/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", @@ -12,12 +10,24 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../../../x-pack/plugins/licensing/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/ui-actions-plugin", + "@kbn/licensing-plugin", + "@kbn/es-query", + "@kbn/test-jest-helpers", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/i18n-react", + "@kbn/handlebars", + "@kbn/rison", + "@kbn/datemath", + "@kbn/monaco", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/unified_field_list/tsconfig.json b/src/plugins/unified_field_list/tsconfig.json index 82d06d861846..23726803a109 100644 --- a/src/plugins/unified_field_list/tsconfig.json +++ b/src/plugins/unified_field_list/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../typings/**/*", @@ -12,12 +10,26 @@ "server/**/*", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/data-views-plugin", + "@kbn/data-plugin", + "@kbn/charts-plugin", + "@kbn/ui-actions-plugin", + "@kbn/datemath", + "@kbn/es-types", + "@kbn/es-query", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/field-formats-plugin", + "@kbn/i18n-react", + "@kbn/analytics", + "@kbn/config-schema", + "@kbn/core-lifecycle-browser", + "@kbn/react-field", + "@kbn/field-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/unified_histogram/tsconfig.json b/src/plugins/unified_histogram/tsconfig.json index 9c6213783980..a6bd54ed5e6e 100644 --- a/src/plugins/unified_histogram/tsconfig.json +++ b/src/plugins/unified_histogram/tsconfig.json @@ -1,17 +1,30 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../../typings/**/*", "common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../saved_search/tsconfig.json" }, - { "path": "../../../x-pack/plugins/lens/tsconfig.json" } + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/lens-plugin", + "@kbn/field-formats-plugin", + "@kbn/inspector-plugin", + "@kbn/expressions-plugin", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/es-query", + "@kbn/embeddable-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/core-ui-settings-browser", + "@kbn/datemath", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/shared-ux-utility", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/unified_search/tsconfig.json b/src/plugins/unified_search/tsconfig.json index 7477e97c779c..0a4ab525d04b 100644 --- a/src/plugins/unified_search/tsconfig.json +++ b/src/plugins/unified_search/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", @@ -13,14 +11,35 @@ "config.ts", ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../data_view_editor/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/embeddable-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/field-formats-plugin", + "@kbn/es-query", + "@kbn/i18n-react", + "@kbn/screenshot-mode-plugin", + "@kbn/ui-actions-plugin", + "@kbn/i18n", + "@kbn/test-jest-helpers", + "@kbn/shared-ux-utility", + "@kbn/utility-types", + "@kbn/analytics", + "@kbn/datemath", + "@kbn/monaco", + "@kbn/language-documentation-popover", + "@kbn/field-types", + "@kbn/config", + "@kbn/config-schema", + "@kbn/utility-types-jest", + "@kbn/react-field", + "@kbn/ui-theme", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index 9a108878e86f..f4db29b839cf 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -1,12 +1,13 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*"], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, + "@kbn/core", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index 531dde7fd609..0e663d6c9cb8 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "isolatedModules": true }, "include": [ @@ -13,7 +11,17 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../../plugins/kibana_utils/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/analytics", + "@kbn/config-schema", + "@kbn/std", + "@kbn/analytics-client", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/core-http-server-mocks", + ], + "exclude": [ + "target/**/*", ] } \ No newline at end of file diff --git a/src/plugins/vis_default_editor/tsconfig.json b/src/plugins/vis_default_editor/tsconfig.json index 6495253035f6..65d0603523fe 100644 --- a/src/plugins/vis_default_editor/tsconfig.json +++ b/src/plugins/vis_default_editor/tsconfig.json @@ -1,22 +1,34 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../discover/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" }, - { "path": "../unified_search/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/visualizations-plugin", + "@kbn/discover-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/field-formats-plugin", + "@kbn/unified-search-plugin", + "@kbn/data-views-plugin", + "@kbn/i18n", + "@kbn/es-query", + "@kbn/i18n-react", + "@kbn/usage-collection-plugin", + "@kbn/test-jest-helpers", + "@kbn/datemath", + "@kbn/charts-plugin", + "@kbn/coloring", + "@kbn/monaco", + "@kbn/es-ui-shared-plugin", + "@kbn/utility-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index 3bd790ef8046..73c6d160696a 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", @@ -11,10 +9,16 @@ "*.ts" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/kibana-react-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/gauge/tsconfig.json b/src/plugins/vis_types/gauge/tsconfig.json index c94152b4d70d..a681a709f68d 100644 --- a/src/plugins/vis_types/gauge/tsconfig.json +++ b/src/plugins/vis_types/gauge/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,15 +10,22 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../chart_expressions/expression_gauge/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../chart_expressions/expression_partition_vis/tsconfig.json" } - ] + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/expression-gauge-plugin", + "@kbn/visualizations-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/data-views-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/coloring", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", + ] } \ No newline at end of file diff --git a/src/plugins/vis_types/heatmap/tsconfig.json b/src/plugins/vis_types/heatmap/tsconfig.json index f35697fe3699..970c26519807 100644 --- a/src/plugins/vis_types/heatmap/tsconfig.json +++ b/src/plugins/vis_types/heatmap/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,13 +10,22 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" } - ] + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/usage-collection-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/test-jest-helpers", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", + ] } \ No newline at end of file diff --git a/src/plugins/vis_types/metric/tsconfig.json b/src/plugins/vis_types/metric/tsconfig.json index f86fa052e088..4b6f5c5df812 100644 --- a/src/plugins/vis_types/metric/tsconfig.json +++ b/src/plugins/vis_types/metric/tsconfig.json @@ -1,17 +1,24 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*", "server/**/*", "*.ts"], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/visualizations-plugin", + "@kbn/charts-plugin", + "@kbn/expressions-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/i18n", + "@kbn/data-views-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/coloring", + "@kbn/i18n-react", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/pie/tsconfig.json b/src/plugins/vis_types/pie/tsconfig.json index 6c4dc9eae254..663d05228ea2 100644 --- a/src/plugins/vis_types/pie/tsconfig.json +++ b/src/plugins/vis_types/pie/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,14 +10,24 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../usage_collection/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../chart_expressions/expression_partition_vis/tsconfig.json" } - ] + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/usage-collection-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/expression-partition-vis-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/data-views-plugin", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", + ] } \ No newline at end of file diff --git a/src/plugins/vis_types/table/tsconfig.json b/src/plugins/vis_types/table/tsconfig.json index 7af02367b799..f6e296e0e9ec 100644 --- a/src/plugins/vis_types/table/tsconfig.json +++ b/src/plugins/vis_types/table/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,15 +10,24 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../share/tsconfig.json" }, - { "path": "../../data_views/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../kibana_react/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/visualizations-plugin", + "@kbn/share-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/usage-collection-plugin", + "@kbn/analytics", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/ui-theme", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/tagcloud/tsconfig.json b/src/plugins/vis_types/tagcloud/tsconfig.json index 0159681d2e19..45cefb210642 100644 --- a/src/plugins/vis_types/tagcloud/tsconfig.json +++ b/src/plugins/vis_types/tagcloud/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "public/**/*", @@ -11,12 +9,18 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../kibana_react/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/charts-plugin", + "@kbn/kibana-react-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/timelion/tsconfig.json b/src/plugins/vis_types/timelion/tsconfig.json index 5a660d5d4d78..7121a7d7078b 100644 --- a/src/plugins/vis_types/timelion/tsconfig.json +++ b/src/plugins/vis_types/timelion/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -13,14 +11,28 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../field_formats/tsconfig.json" }, - { "path": "../../data_views/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../kibana_react/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, + "@kbn/core", + "@kbn/visualizations-plugin", + "@kbn/data-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/charts-plugin", + "@kbn/usage-collection-plugin", + "@kbn/i18n", + "@kbn/es-query", + "@kbn/analytics", + "@kbn/i18n-react", + "@kbn/monaco", + "@kbn/config-schema", + "@kbn/expect", + "@kbn/std", + "@kbn/timelion-grammar", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/timeseries/tsconfig.json b/src/plugins/vis_types/timeseries/tsconfig.json index 1a001beb9851..e87ecc1e3f98 100644 --- a/src/plugins/vis_types/timeseries/tsconfig.json +++ b/src/plugins/vis_types/timeseries/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "allowJs": true }, "include": [ @@ -14,15 +12,41 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../data_views/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../dashboard/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../kibana_react/tsconfig.json" }, - { "path": "../../unified_search/tsconfig.json" } + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/unified-search-plugin", + "@kbn/i18n", + "@kbn/field-formats-plugin", + "@kbn/datemath", + "@kbn/es-query", + "@kbn/inspector-plugin", + "@kbn/usage-collection-plugin", + "@kbn/core-http-browser", + "@kbn/core-theme-browser", + "@kbn/core-doc-links-browser", + "@kbn/analytics", + "@kbn/i18n-react", + "@kbn/coloring", + "@kbn/test-jest-helpers", + "@kbn/safer-lodash-set", + "@kbn/embeddable-plugin", + "@kbn/handlebars", + "@kbn/rison", + "@kbn/utility-types", + "@kbn/shared-ux-link-redirect-app", + "@kbn/ui-theme", + "@kbn/config-schema", + "@kbn/home-plugin", + "@kbn/std", + "@kbn/tinymath", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json index b942db9888aa..72358ce021c2 100644 --- a/src/plugins/vis_types/vega/tsconfig.json +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", "strictNullChecks": false }, "include": [ @@ -16,17 +14,32 @@ "public/test_utils/vega_graph.json", ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../data_views/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../maps_ems/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../inspector/tsconfig.json" }, - { "path": "../../home/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../kibana_react/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, - { "path": "../../es_ui_shared/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/visualizations-plugin", + "@kbn/maps-ems-plugin", + "@kbn/expressions-plugin", + "@kbn/inspector-plugin", + "@kbn/home-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/usage-collection-plugin", + "@kbn/es-query", + "@kbn/analytics", + "@kbn/core-execution-context-common", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/monaco", + "@kbn/utility-types", + "@kbn/ui-theme", + "@kbn/std", + "@kbn/datemath", + "@kbn/mapbox-gl", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/vislib/tsconfig.json b/src/plugins/vis_types/vislib/tsconfig.json index c63a51db242b..3616b2c7cd8e 100644 --- a/src/plugins/vis_types/vislib/tsconfig.json +++ b/src/plugins/vis_types/vislib/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -14,14 +12,32 @@ "public/fixtures/dispatch_heatmap_data_point.json", ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../data/tsconfig.json" }, - { "path": "../../expressions/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../vis_types/gauge/tsconfig.json" }, - { "path": "../../vis_types/xy/tsconfig.json" }, - { "path": "../../vis_types/heatmap/tsconfig.json" }, + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/expressions-plugin", + "@kbn/visualizations-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/vis-type-gauge-plugin", + "@kbn/vis-type-xy-plugin", + "@kbn/vis-type-heatmap-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-react-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/core-execution-context-common", + "@kbn/analytics", + "@kbn/test-jest-helpers", + "@kbn/safer-lodash-set", + "@kbn/datemath", + "@kbn/i18n-react", + "@kbn/std", + "@kbn/ui-theme", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/vis_types/xy/tsconfig.json b/src/plugins/vis_types/xy/tsconfig.json index f478d2de1b95..14ed87764e51 100644 --- a/src/plugins/vis_types/xy/tsconfig.json +++ b/src/plugins/vis_types/xy/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,10 +10,21 @@ "*.ts" ], "kbn_references": [ - { "path": "../../../core/tsconfig.json" }, - { "path": "../../charts/tsconfig.json" }, - { "path": "../../visualizations/tsconfig.json" }, - { "path": "../../kibana_utils/tsconfig.json" }, - { "path": "../../vis_default_editor/tsconfig.json" }, + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/visualizations-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/vis-default-editor-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/i18n", + "@kbn/data-plugin", + "@kbn/coloring", + "@kbn/test-jest-helpers", + "@kbn/i18n-react", + "@kbn/config-schema", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/plugins/visualizations/tsconfig.json b/src/plugins/visualizations/tsconfig.json index 7f00434c6181..9b73af16bb4b 100644 --- a/src/plugins/visualizations/tsconfig.json +++ b/src/plugins/visualizations/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "common/**/*", @@ -12,26 +10,48 @@ "../../../typings/**/*" ], "kbn_references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../data_views/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../ui_actions/tsconfig.json" }, - { "path": "../embeddable/tsconfig.json" }, - { "path": "../inspector/tsconfig.json" }, - { "path": "../saved_objects/tsconfig.json" }, - { "path": "../saved_objects_tagging_oss/tsconfig.json" }, - { "path": "../kibana_utils/tsconfig.json" }, - { "path": "../kibana_react/tsconfig.json" }, - { "path": "../saved_search/tsconfig.json" }, - { "path": "../url_forwarding/tsconfig.json" }, - { "path": "../navigation/tsconfig.json" }, - { "path": "../home/tsconfig.json" }, - { "path": "../share/tsconfig.json" }, - { "path": "../data_view_editor/tsconfig.json" }, - { "path": "../presentation_util/tsconfig.json" }, - { "path": "../screenshot_mode/tsconfig.json" }, - { "path": "../../../x-pack/plugins/spaces/tsconfig.json" } + "@kbn/core", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/expressions-plugin", + "@kbn/ui-actions-plugin", + "@kbn/embeddable-plugin", + "@kbn/inspector-plugin", + "@kbn/saved-objects-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/saved-search-plugin", + "@kbn/url-forwarding-plugin", + "@kbn/navigation-plugin", + "@kbn/home-plugin", + "@kbn/share-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/presentation-util-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/spaces-plugin", + "@kbn/es-query", + "@kbn/utility-types", + "@kbn/field-formats-plugin", + "@kbn/rison", + "@kbn/i18n", + "@kbn/coloring", + "@kbn/unified-search-plugin", + "@kbn/shared-ux-link-redirect-app", + "@kbn/i18n-react", + "@kbn/safer-lodash-set", + "@kbn/shared-ux-page-analytics-no-data", + "@kbn/content-management-table-list", + "@kbn/test-jest-helpers", + "@kbn/analytics", + "@kbn/content-management-content-editor", + "@kbn/core-saved-objects-api-browser", + "@kbn/core-overlays-browser", + "@kbn/config-schema", + "@kbn/usage-collection-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/src/setup_node_env/dist.js b/src/setup_node_env/dist.js index 3628a27a7793..5beed583cf83 100644 --- a/src/setup_node_env/dist.js +++ b/src/setup_node_env/dist.js @@ -6,5 +6,6 @@ * Side Public License, v 1. */ -require('./no_transpilation_dist'); +// the dist env setup does not include babel/register, just the polyfill +require('./setup_env'); require('./polyfill'); diff --git a/src/setup_node_env/ensure_node_preserve_symlinks.js b/src/setup_node_env/ensure_node_preserve_symlinks.js deleted file mode 100644 index 5ec286801bdc..000000000000 --- a/src/setup_node_env/ensure_node_preserve_symlinks.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -(function () { - var cp = require('child_process'); - - var calculateInspectPortOnExecArgv = function (processExecArgv) { - var execArgv = [].concat(processExecArgv); - - if (execArgv.length === 0) { - return execArgv; - } - - var inspectFlagIndex = execArgv.reverse().findIndex(function (flag) { - return flag.startsWith('--inspect'); - }); - - if (inspectFlagIndex !== -1) { - var inspectFlag; - var inspectPortCounter = 9230; - var argv = execArgv[inspectFlagIndex]; - - if (argv.includes('=')) { - // --inspect=port - var argvSplit = argv.split('='); - var flag = argvSplit[0]; - var port = argvSplit[1]; - inspectFlag = flag; - inspectPortCounter = Number.parseInt(port, 10) + 1; - } else { - // --inspect - inspectFlag = argv; - - // is number? - if (String(execArgv[inspectFlagIndex + 1]).match(/^[0-9]+$/)) { - // --inspect port - inspectPortCounter = Number.parseInt(execArgv[inspectFlagIndex + 1], 10) + 1; - execArgv.slice(inspectFlagIndex + 1, 1); - } - } - - execArgv[inspectFlagIndex] = inspectFlag + '=' + inspectPortCounter; - } - - return execArgv; - }; - - var preserveSymlinksOption = '--preserve-symlinks'; - var preserveSymlinksMainOption = '--preserve-symlinks-main'; - var nodeOptions = (process && process.env && process.env.NODE_OPTIONS) || []; - var nodeExecArgv = calculateInspectPortOnExecArgv((process && process.execArgv) || []); - - var isPreserveSymlinksPresent = - nodeOptions.includes(preserveSymlinksOption) || nodeExecArgv.includes(preserveSymlinksOption); - var isPreserveSymlinksMainPresent = - nodeOptions.includes(preserveSymlinksMainOption) || - nodeExecArgv.includes(preserveSymlinksMainOption); - - if (isPreserveSymlinksPresent && isPreserveSymlinksMainPresent) { - return; - } - - var nodeArgv = (process && process.argv) || []; - var isFirstArgNode = nodeArgv.length > 0 && nodeArgv[0].includes('node') ? nodeArgv[0] : null; - if (!isFirstArgNode) { - return; - } - - var missingNodeArgs = []; - if (!isPreserveSymlinksMainPresent) { - missingNodeArgs.push(preserveSymlinksMainOption); - } - - if (!isPreserveSymlinksPresent) { - missingNodeArgs.push(preserveSymlinksOption); - } - - var nodeArgs = nodeExecArgv.concat(missingNodeArgs); - var restArgs = nodeArgv.length >= 2 ? nodeArgv.slice(1, nodeArgv.length) : []; - - var getExitCodeFromSpawnResult = function (spawnResult) { - if (spawnResult.status !== null) { - return spawnResult.status; - } - - if (spawnResult.signal !== null) { - console.log( - 'ensure_node_preserve_symlinks wrapper: process exitted with signal', - spawnResult.signal - ); - return 1; - } - - if (spawnResult.error) { - console.log( - 'ensure_node_preserve_symlinks wrapper: process exitted with error', - spawnResult.error - ); - return 1; - } - - return 0; - }; - - // Since we are using `stdio: inherit`, the child process will receive - // the `SIGINT` and `SIGTERM` from the terminal. - // However, we want the parent process not to exit until the child does. - // Adding the following handlers achieves that. - process.on('SIGINT', function () {}); - process.on('SIGTERM', function () {}); - - var spawnResult = cp.spawnSync(nodeArgv[0], nodeArgs.concat(restArgs), { stdio: 'inherit' }); - process.exit(getExitCodeFromSpawnResult(spawnResult)); -})(); diff --git a/src/setup_node_env/index.js b/src/setup_node_env/index.js index 9ce60766997c..ca843aff501e 100644 --- a/src/setup_node_env/index.js +++ b/src/setup_node_env/index.js @@ -6,6 +6,7 @@ * Side Public License, v 1. */ -require('./no_transpilation'); -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); +// development env setup includes babel/register after the env is initialized +require('./setup_env'); +require('@kbn/babel-register').install(); +require('./polyfill'); diff --git a/src/setup_node_env/no_transpilation.js b/src/setup_node_env/no_transpilation.js deleted file mode 100644 index b9497734b40b..000000000000 --- a/src/setup_node_env/no_transpilation.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -require('./ensure_node_preserve_symlinks'); -require('./no_transpilation_dist'); diff --git a/packages/kbn-es/src/cli_commands/index.js b/src/setup_node_env/polyfill.ts similarity index 60% rename from packages/kbn-es/src/cli_commands/index.js rename to src/setup_node_env/polyfill.ts index 1d2489031181..0c69256698a1 100644 --- a/packages/kbn-es/src/cli_commands/index.js +++ b/src/setup_node_env/polyfill.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -exports.snapshot = require('./snapshot'); -exports.source = require('./source'); -exports.archive = require('./archive'); -exports.build_snapshots = require('./build_snapshots'); +// require these polyfills after setting up the require hook so that @babel/preset-env +// will spot the import in the polyfill file and replace it with the necessary polyfills +// for the current node.js version +import 'core-js/stable'; diff --git a/src/setup_node_env/no_transpilation_dist.js b/src/setup_node_env/setup_env.js similarity index 93% rename from src/setup_node_env/no_transpilation_dist.js rename to src/setup_node_env/setup_env.js index c52eba70f4ad..08897eb5a78c 100644 --- a/src/setup_node_env/no_transpilation_dist.js +++ b/src/setup_node_env/setup_env.js @@ -12,5 +12,5 @@ require('./harden'); // The following require statements MUST be executed before any others - END require('symbol-observable'); -require('source-map-support/register'); +require('source-map-support').install(); require('./node_version_validator'); diff --git a/src/setup_node_env/tsconfig.json b/src/setup_node_env/tsconfig.json index c7c05f89d04a..ed753806b9f4 100644 --- a/src/setup_node_env/tsconfig.json +++ b/src/setup_node_env/tsconfig.json @@ -1,16 +1,19 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "harden/**/*", "root/**/*", "*.js", + "*.ts", ], "kbn_references": [ { "path": "../../tsconfig.json" }, + "@kbn/babel-register", + ], + "exclude": [ + "target/**/*", ] } diff --git a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json b/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json index 7231438f0b0e..f39686d7e098 100644 --- a/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json +++ b/test/analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "index.ts", @@ -10,8 +10,13 @@ "server/**/*.ts", "../../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/analytics-client", + "@kbn/std", + "@kbn/config-schema", ] } diff --git a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json b/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json index 483252cfa6fd..6a3e9e40e389 100644 --- a/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json +++ b/test/analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "index.ts", @@ -9,8 +9,11 @@ "server/**/*.ts", "../../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", ] } diff --git a/test/examples/config.js b/test/examples/config.js index 836f21f260e0..75ac7c44a54f 100644 --- a/test/examples/config.js +++ b/test/examples/config.js @@ -9,7 +9,7 @@ import { resolve } from 'path'; import { services } from '../plugin_functional/services'; import fs from 'fs'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; export default async function ({ readConfigFile }) { const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js')); diff --git a/test/functional/apps/management/_files.ts b/test/functional/apps/management/_files.ts index b117e376a39a..deebdb18f374 100644 --- a/test/functional/apps/management/_files.ts +++ b/test/functional/apps/management/_files.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import expect from '@kbn/expect/expect'; +import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { diff --git a/test/functional/services/remote/webdriver.ts b/test/functional/services/remote/webdriver.ts index 21eae36a67b7..af2e1056e686 100644 --- a/test/functional/services/remote/webdriver.ts +++ b/test/functional/services/remote/webdriver.ts @@ -26,7 +26,7 @@ import { Executor } from 'selenium-webdriver/lib/http'; import { getLogger } from 'selenium-webdriver/lib/logging'; import { installDriver } from 'ms-chromium-edge-driver'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { pollForLogEntry$ } from './poll_for_log_entry'; import { createStdoutSocket } from './create_stdout_stream'; import { preventParallelCalls } from './prevent_parallel_calls'; diff --git a/test/health_gateway/plugins/status/tsconfig.json b/test/health_gateway/plugins/status/tsconfig.json index 481e1091600f..ca820cb2858d 100644 --- a/test/health_gateway/plugins/status/tsconfig.json +++ b/test/health_gateway/plugins/status/tsconfig.json @@ -1,13 +1,16 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "server/**/*.ts", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema" ] } diff --git a/test/health_gateway/services/health_gateway.ts b/test/health_gateway/services/health_gateway.ts index dc3480c4552a..a84b995e38e9 100644 --- a/test/health_gateway/services/health_gateway.ts +++ b/test/health_gateway/services/health_gateway.ts @@ -11,7 +11,7 @@ import { format } from 'url'; import getPort from 'get-port'; import supertest from 'supertest'; import { ProcRunner } from '@kbn/dev-proc-runner'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT } from '@kbn/repo-info'; import { FtrService } from '../../functional/ftr_provider_context'; interface HealthGatewayOptions { diff --git a/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json b/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json index 99f621e42374..5e64dd7d0c93 100644 --- a/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json +++ b/test/interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json @@ -1,16 +1,15 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true + "outDir": "target/types", }, "include": [ "server/**/*.ts", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, + "@kbn/core", ], } diff --git a/test/interactive_setup_functional/tests/enrollment_token.ts b/test/interactive_setup_functional/tests/enrollment_token.ts index 5af4ed0fc3f2..fb86a9a6f691 100644 --- a/test/interactive_setup_functional/tests/enrollment_token.ts +++ b/test/interactive_setup_functional/tests/enrollment_token.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import type { FtrProviderContext } from '../../functional/ftr_provider_context'; import { getElasticsearchCaCertificate } from '../../interactive_setup_api_integration/fixtures/tls_tools'; diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json index c50067e5cb87..db591faecfd1 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,12 +10,15 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/expressions/tsconfig.json" }, - { "path": "../../../../src/plugins/inspector/tsconfig.json" }, - { "path": "../../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../../src/plugins/kibana_utils/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/inspector-plugin", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/config-schema", ] } diff --git a/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json b/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json index 97fa33bb4d1e..bf146797a42e 100644 --- a/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json +++ b/test/node_roles_functional/plugins/core_plugin_initializer_context/tsconfig.json @@ -1,15 +1,17 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/app_link_test/tsconfig.json b/test/plugin_functional/plugins/app_link_test/tsconfig.json index 5e38e7f98cbb..b44abdbe6224 100644 --- a/test/plugin_functional/plugins/app_link_test/tsconfig.json +++ b/test/plugin_functional/plugins/app_link_test/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,11 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/plugins/kibana_react/tsconfig.json" } + "@kbn/kibana-react-plugin", + "@kbn/core", ] } diff --git a/test/plugin_functional/plugins/core_app_status/tsconfig.json b/test/plugin_functional/plugins/core_app_status/tsconfig.json index c81a6cc88fae..ef3b1a3322e4 100644 --- a/test/plugin_functional/plugins/core_app_status/tsconfig.json +++ b/test/plugin_functional/plugins/core_app_status/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "index.ts", @@ -11,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, + "@kbn/core", ], } diff --git a/test/plugin_functional/plugins/core_history_block/tsconfig.json b/test/plugin_functional/plugins/core_history_block/tsconfig.json index 4804462c5637..f7ddd34a35c2 100644 --- a/test/plugin_functional/plugins/core_history_block/tsconfig.json +++ b/test/plugin_functional/plugins/core_history_block/tsconfig.json @@ -1,12 +1,14 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": ["index.ts", "public/**/*.ts", "public/**/*.tsx", "../../../../typings/**/*"], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/kibana_react/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin" ] } diff --git a/test/plugin_functional/plugins/core_http/tsconfig.json b/test/plugin_functional/plugins/core_http/tsconfig.json index 151126379c60..1031bd9b3802 100644 --- a/test/plugin_functional/plugins/core_http/tsconfig.json +++ b/test/plugin_functional/plugins/core_http/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,10 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json index 151126379c60..1031bd9b3802 100644 --- a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,10 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json index b69ff0d55b06..c4001804608c 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json index 582a563fa87d..0a3cc148df18 100644 --- a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,12 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../core_plugin_a/tsconfig.json" }, + "@kbn/core", + "@kbn/core-plugin-a-plugin", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json index a45b03ddb018..3a0bc171cada 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, + "@kbn/core", ] } diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json index b69ff0d55b06..c4001804608c 100644 --- a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json index 151126379c60..a51c8d185a06 100644 --- a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,12 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", + "@kbn/config", ] } diff --git a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json index 7e4d103b3c8b..7b61be54e3c9 100644 --- a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json @@ -1,14 +1,16 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json index da607f805aca..b8e50d76d962 100644 --- a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json index 4e34148ffcc4..b158efd9c6fb 100644 --- a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json @@ -1,14 +1,17 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "server/**/*.ts", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json index da607f805aca..b8e50d76d962 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,8 +9,10 @@ "public/**/*.tsx", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json index 1010dbde5e13..452f8602deec 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "index.ts", @@ -11,8 +9,10 @@ "public/**/*.ts", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, + "@kbn/core", ], } diff --git a/test/plugin_functional/plugins/data_search/tsconfig.json b/test/plugin_functional/plugins/data_search/tsconfig.json index fd0c6aee8672..fb37a658fe59 100644 --- a/test/plugin_functional/plugins/data_search/tsconfig.json +++ b/test/plugin_functional/plugins/data_search/tsconfig.json @@ -1,15 +1,18 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "server/**/*.ts", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/data/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json index 4e34148ffcc4..b7a209b858dd 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json @@ -1,14 +1,16 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "server/**/*.ts", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/index_patterns/tsconfig.json b/test/plugin_functional/plugins/index_patterns/tsconfig.json index 9eb132317249..da94640700c7 100644 --- a/test/plugin_functional/plugins/index_patterns/tsconfig.json +++ b/test/plugin_functional/plugins/index_patterns/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,9 +9,12 @@ "server/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/data/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json index 5ee68ce60a9a..a3fe79437f30 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,11 +9,13 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../../src/plugins/kibana_react/tsconfig.json" }, + "@kbn/core", + "@kbn/ui-actions-plugin", + "@kbn/embeddable-plugin", + "@kbn/kibana-react-plugin", ] } diff --git a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json index 2d0007320313..e4faa6b88696 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,11 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/navigation/tsconfig.json" }, + "@kbn/core", + "@kbn/navigation-plugin", ] } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json index 954a4daa1eef..0b75f43b4b7f 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,11 +9,13 @@ "public/**/*.tsx", "../../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../../src/plugins/visualizations/tsconfig.json" }, - { "path": "../../../../src/plugins/expressions/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/visualizations-plugin", + "@kbn/expressions-plugin", ] } diff --git a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json index ee1ece5036cf..91f33da6a5de 100644 --- a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -9,9 +9,11 @@ "public/**/*.tsx", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/management/tsconfig.json" }, + "@kbn/core", + "@kbn/management-plugin", ] } diff --git a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json index 151126379c60..192e9f0fb4f5 100644 --- a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,11 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json index 97fa33bb4d1e..bf146797a42e 100644 --- a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json @@ -1,15 +1,17 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json index 151126379c60..1031bd9b3802 100644 --- a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,8 +10,10 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json index 97fa33bb4d1e..bf146797a42e 100644 --- a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json +++ b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json @@ -1,15 +1,17 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/plugin_functional/plugins/session_notifications/tsconfig.json b/test/plugin_functional/plugins/session_notifications/tsconfig.json index 32b53be5109f..a7881eb76bf9 100644 --- a/test/plugin_functional/plugins/session_notifications/tsconfig.json +++ b/test/plugin_functional/plugins/session_notifications/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,10 +10,12 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../../src/plugins/data/tsconfig.json" }, + "@kbn/core", + "@kbn/navigation-plugin", + "@kbn/data-plugin", ] } diff --git a/test/plugin_functional/plugins/telemetry/tsconfig.json b/test/plugin_functional/plugins/telemetry/tsconfig.json index bde8ed4c57ae..e4d237e88538 100644 --- a/test/plugin_functional/plugins/telemetry/tsconfig.json +++ b/test/plugin_functional/plugins/telemetry/tsconfig.json @@ -1,12 +1,14 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": ["public/**/*.ts", "types.ts", "../../../../typings/**/*"], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/telemetry/tsconfig.json" }, + "@kbn/core", + "@kbn/telemetry-plugin", ] } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json index 1282ecf76b30..7a9ab454d85a 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json @@ -1,14 +1,17 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", ] } diff --git a/test/plugin_functional/plugins/usage_collection/tsconfig.json b/test/plugin_functional/plugins/usage_collection/tsconfig.json index 56abcf79f17d..96ee2dd5a312 100644 --- a/test/plugin_functional/plugins/usage_collection/tsconfig.json +++ b/test/plugin_functional/plugins/usage_collection/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,9 +10,11 @@ "server/**/*.ts", "../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../src/core/tsconfig.json" }, - { "path": "../../../../src/plugins/usage_collection/tsconfig.json" }, + "@kbn/core", + "@kbn/usage-collection-plugin", ] } diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json index e0bcff939a45..8789ef4f3583 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json @@ -1,15 +1,18 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "index.ts", "server/**/*.ts", "../../../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../../src/core/tsconfig.json" } + "@kbn/core", + "@kbn/config-schema", ] } diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json index 0d45d9195da6..4b333551c149 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json @@ -1,15 +1,17 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "server/**/*.ts", "../../../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../../../src/core/tsconfig.json" } + "@kbn/core" ] } diff --git a/test/tsconfig.json b/test/tsconfig.json index 904735349c3a..2d4e7e38b942 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,10 +1,7 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, + "outDir": "target/types", "types": [ "node", "@emotion/react/types/css-prop", @@ -29,44 +26,50 @@ "*/plugins/**/*", ], "kbn_references": [ - { "path": "../src/core/tsconfig.json" }, + "@kbn/core", { "path": "../src/setup_node_env/tsconfig.json" }, - { "path": "../src/plugins/telemetry_management_section/tsconfig.json" }, - { "path": "../src/plugins/advanced_settings/tsconfig.json" }, - { "path": "../src/plugins/management/tsconfig.json" }, - { "path": "../src/plugins/bfetch/tsconfig.json" }, - { "path": "../src/plugins/charts/tsconfig.json" }, - { "path": "../src/plugins/console/tsconfig.json" }, - { "path": "../src/plugins/dashboard/tsconfig.json" }, - { "path": "../src/plugins/discover/tsconfig.json" }, - { "path": "../src/plugins/embeddable/tsconfig.json" }, - { "path": "../src/plugins/es_ui_shared/tsconfig.json" }, - { "path": "../src/plugins/expressions/tsconfig.json" }, - { "path": "../src/plugins/home/tsconfig.json" }, - { "path": "../src/plugins/inspector/tsconfig.json" }, - { "path": "../src/plugins/kibana_overview/tsconfig.json" }, - { "path": "../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../src/plugins/kibana_usage_collection/tsconfig.json" }, - { "path": "../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../src/plugins/navigation/tsconfig.json" }, - { "path": "../src/plugins/unified_search/tsconfig.json" }, - { "path": "../src/plugins/newsfeed/tsconfig.json" }, - { "path": "../src/plugins/saved_objects/tsconfig.json" }, - { "path": "../src/plugins/saved_objects_management/tsconfig.json" }, - { "path": "../src/plugins/saved_objects_tagging_oss/tsconfig.json" }, - { "path": "../src/plugins/telemetry_collection_manager/tsconfig.json" }, - { "path": "../src/plugins/telemetry/tsconfig.json" }, - { "path": "../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../src/plugins/url_forwarding/tsconfig.json" }, - { "path": "../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../src/plugins/data_view_management/tsconfig.json" }, - { "path": "../src/plugins/visualizations/tsconfig.json" }, - { "path": "analytics/fixtures/plugins/analytics_ftr_helpers/tsconfig.json"}, - { "path": "analytics/fixtures/plugins/analytics_plugin_a/tsconfig.json"}, + "@kbn/bfetch-plugin", + "@kbn/dashboard-plugin", + "@kbn/expressions-plugin", + "@kbn/saved-objects-management-plugin", + "@kbn/telemetry-plugin", + "@kbn/usage-collection-plugin", + "@kbn/visualizations-plugin", + "@kbn/analytics-ftr-helpers-plugin", + "@kbn/analytics-plugin-a-plugin", { "path": "interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json" }, - { "path": "plugin_functional/plugins/core_app_status/tsconfig.json" }, - { "path": "plugin_functional/plugins/core_provider_plugin/tsconfig.json" }, - { "path": "server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json" }, - { "path": "server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json" }, + "@kbn/core-app-status-plugin", + "@kbn/core-provider-plugin", + "@kbn/test", + "@kbn/repo-info", + "@kbn/utils", + "@kbn/expect", + "@kbn/data-plugin", + "@kbn/ftr-common-functional-services", + "@kbn/tooling-log", + "@kbn/std", + "@kbn/test-subj-selector", + "@kbn/rison", + "@kbn/controls-plugin", + "@kbn/field-formats-plugin", + "@kbn/axe-config", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/data-view-field-editor-plugin", + "@kbn/data-views-plugin", + "@kbn/guided-onboarding-plugin", + "@kbn/guided-onboarding", + "@kbn/config-schema", + "@kbn/analytics", + "@kbn/field-types", + "@kbn/ftr-screenshot-filename", + "@kbn/es-archiver", + "@kbn/core-application-browser", + "@kbn/screenshot-mode-plugin", + "@kbn/dev-utils", + "@kbn/analytics-client", + "@kbn/safer-lodash-set", + "@kbn/utility-types", + "@kbn/dev-proc-runner", ] } diff --git a/tsconfig.base.json b/tsconfig.base.json index 24261b27d66e..a27504bd796d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -3,11 +3,43 @@ "baseUrl": ".", "rootDir": ".", "paths": { - "@kbn/core": ["src/core"], - "@kbn/core/*": ["src/core/*"], // START AUTOMATED PACKAGE LISTING + "@kbn/ace": ["packages/kbn-ace"], + "@kbn/ace/*": ["packages/kbn-ace/*"], + "@kbn/actions-plugin": ["x-pack/plugins/actions"], + "@kbn/actions-plugin/*": ["x-pack/plugins/actions/*"], + "@kbn/advanced-settings-plugin": ["src/plugins/advanced_settings"], + "@kbn/advanced-settings-plugin/*": ["src/plugins/advanced_settings/*"], + "@kbn/aiops-components": ["x-pack/packages/ml/aiops_components"], + "@kbn/aiops-components/*": ["x-pack/packages/ml/aiops_components/*"], + "@kbn/aiops-plugin": ["x-pack/plugins/aiops"], + "@kbn/aiops-plugin/*": ["x-pack/plugins/aiops/*"], + "@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"], + "@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"], + "@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"], + "@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"], + "@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts"], + "@kbn/alerting-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/*"], + "@kbn/alerting-plugin": ["x-pack/plugins/alerting"], + "@kbn/alerting-plugin/*": ["x-pack/plugins/alerting/*"], + "@kbn/alerts": ["packages/kbn-alerts"], + "@kbn/alerts/*": ["packages/kbn-alerts/*"], + "@kbn/ambient-common-types": ["packages/kbn-ambient-common-types"], + "@kbn/ambient-common-types/*": ["packages/kbn-ambient-common-types/*"], + "@kbn/ambient-ftr-types": ["packages/kbn-ambient-ftr-types"], + "@kbn/ambient-ftr-types/*": ["packages/kbn-ambient-ftr-types/*"], + "@kbn/ambient-storybook-types": ["packages/kbn-ambient-storybook-types"], + "@kbn/ambient-storybook-types/*": ["packages/kbn-ambient-storybook-types/*"], + "@kbn/ambient-ui-types": ["packages/kbn-ambient-ui-types"], + "@kbn/ambient-ui-types/*": ["packages/kbn-ambient-ui-types/*"], + "@kbn/analytics": ["packages/kbn-analytics"], + "@kbn/analytics/*": ["packages/kbn-analytics/*"], "@kbn/analytics-client": ["packages/analytics/client"], "@kbn/analytics-client/*": ["packages/analytics/client/*"], + "@kbn/analytics-ftr-helpers-plugin": ["test/analytics/fixtures/plugins/analytics_ftr_helpers"], + "@kbn/analytics-ftr-helpers-plugin/*": ["test/analytics/fixtures/plugins/analytics_ftr_helpers/*"], + "@kbn/analytics-plugin-a-plugin": ["test/analytics/fixtures/plugins/analytics_plugin_a"], + "@kbn/analytics-plugin-a-plugin/*": ["test/analytics/fixtures/plugins/analytics_plugin_a/*"], "@kbn/analytics-shippers-elastic-v3-browser": ["packages/analytics/shippers/elastic_v3/browser"], "@kbn/analytics-shippers-elastic-v3-browser/*": ["packages/analytics/shippers/elastic_v3/browser/*"], "@kbn/analytics-shippers-elastic-v3-common": ["packages/analytics/shippers/elastic_v3/common"], @@ -18,10 +50,96 @@ "@kbn/analytics-shippers-fullstory/*": ["packages/analytics/shippers/fullstory/*"], "@kbn/analytics-shippers-gainsight": ["packages/analytics/shippers/gainsight"], "@kbn/analytics-shippers-gainsight/*": ["packages/analytics/shippers/gainsight/*"], + "@kbn/apm-config-loader": ["packages/kbn-apm-config-loader"], + "@kbn/apm-config-loader/*": ["packages/kbn-apm-config-loader/*"], + "@kbn/apm-plugin": ["x-pack/plugins/apm"], + "@kbn/apm-plugin/*": ["x-pack/plugins/apm/*"], + "@kbn/apm-synthtrace": ["packages/kbn-apm-synthtrace"], + "@kbn/apm-synthtrace/*": ["packages/kbn-apm-synthtrace/*"], + "@kbn/apm-utils": ["packages/kbn-apm-utils"], + "@kbn/apm-utils/*": ["packages/kbn-apm-utils/*"], + "@kbn/app-link-test-plugin": ["test/plugin_functional/plugins/app_link_test"], + "@kbn/app-link-test-plugin/*": ["test/plugin_functional/plugins/app_link_test/*"], + "@kbn/application-usage-test-plugin": ["x-pack/test/usage_collection/plugins/application_usage_test"], + "@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"], + "@kbn/axe-config": ["packages/kbn-axe-config"], + "@kbn/axe-config/*": ["packages/kbn-axe-config/*"], + "@kbn/babel-plugin-package-imports": ["packages/kbn-babel-plugin-package-imports"], + "@kbn/babel-plugin-package-imports/*": ["packages/kbn-babel-plugin-package-imports/*"], + "@kbn/babel-preset": ["packages/kbn-babel-preset"], + "@kbn/babel-preset/*": ["packages/kbn-babel-preset/*"], + "@kbn/babel-register": ["packages/kbn-babel-register"], + "@kbn/babel-register/*": ["packages/kbn-babel-register/*"], + "@kbn/babel-transform": ["packages/kbn-babel-transform"], + "@kbn/babel-transform/*": ["packages/kbn-babel-transform/*"], + "@kbn/banners-plugin": ["x-pack/plugins/banners"], + "@kbn/banners-plugin/*": ["x-pack/plugins/banners/*"], + "@kbn/bazel-packages": ["packages/kbn-bazel-packages"], + "@kbn/bazel-packages/*": ["packages/kbn-bazel-packages/*"], + "@kbn/bazel-runner": ["packages/kbn-bazel-runner"], + "@kbn/bazel-runner/*": ["packages/kbn-bazel-runner/*"], + "@kbn/bfetch-explorer-plugin": ["examples/bfetch_explorer"], + "@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"], + "@kbn/bfetch-plugin": ["src/plugins/bfetch"], + "@kbn/bfetch-plugin/*": ["src/plugins/bfetch/*"], + "@kbn/canvas-plugin": ["x-pack/plugins/canvas"], + "@kbn/canvas-plugin/*": ["x-pack/plugins/canvas/*"], + "@kbn/cases-components": ["packages/kbn-cases-components"], + "@kbn/cases-components/*": ["packages/kbn-cases-components/*"], + "@kbn/cases-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases"], + "@kbn/cases-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/*"], + "@kbn/cases-plugin": ["x-pack/plugins/cases"], + "@kbn/cases-plugin/*": ["x-pack/plugins/cases/*"], + "@kbn/chart-icons": ["packages/kbn-chart-icons"], + "@kbn/chart-icons/*": ["packages/kbn-chart-icons/*"], + "@kbn/charts-plugin": ["src/plugins/charts"], + "@kbn/charts-plugin/*": ["src/plugins/charts/*"], + "@kbn/ci-stats-core": ["packages/kbn-ci-stats-core"], + "@kbn/ci-stats-core/*": ["packages/kbn-ci-stats-core/*"], + "@kbn/ci-stats-performance-metrics": ["packages/kbn-ci-stats-performance-metrics"], + "@kbn/ci-stats-performance-metrics/*": ["packages/kbn-ci-stats-performance-metrics/*"], + "@kbn/ci-stats-reporter": ["packages/kbn-ci-stats-reporter"], + "@kbn/ci-stats-reporter/*": ["packages/kbn-ci-stats-reporter/*"], + "@kbn/cli-dev-mode": ["packages/kbn-cli-dev-mode"], + "@kbn/cli-dev-mode/*": ["packages/kbn-cli-dev-mode/*"], + "@kbn/cloud-chat-plugin": ["x-pack/plugins/cloud_integrations/cloud_chat"], + "@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"], + "@kbn/cloud-data-migration-plugin": ["x-pack/plugins/cloud_integrations/cloud_data_migration"], + "@kbn/cloud-data-migration-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_data_migration/*"], + "@kbn/cloud-defend-plugin": ["x-pack/plugins/cloud_defend"], + "@kbn/cloud-defend-plugin/*": ["x-pack/plugins/cloud_defend/*"], + "@kbn/cloud-experiments-plugin": ["x-pack/plugins/cloud_integrations/cloud_experiments"], + "@kbn/cloud-experiments-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_experiments/*"], + "@kbn/cloud-full-story-plugin": ["x-pack/plugins/cloud_integrations/cloud_full_story"], + "@kbn/cloud-full-story-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_full_story/*"], + "@kbn/cloud-gainsight-plugin": ["x-pack/plugins/cloud_integrations/cloud_gain_sight"], + "@kbn/cloud-gainsight-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_gain_sight/*"], + "@kbn/cloud-links-plugin": ["x-pack/plugins/cloud_integrations/cloud_links"], + "@kbn/cloud-links-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_links/*"], + "@kbn/cloud-plugin": ["x-pack/plugins/cloud"], + "@kbn/cloud-plugin/*": ["x-pack/plugins/cloud/*"], + "@kbn/cloud-security-posture-plugin": ["x-pack/plugins/cloud_security_posture"], + "@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"], + "@kbn/coloring": ["packages/kbn-coloring"], + "@kbn/coloring/*": ["packages/kbn-coloring/*"], + "@kbn/config": ["packages/kbn-config"], + "@kbn/config/*": ["packages/kbn-config/*"], + "@kbn/config-mocks": ["packages/kbn-config-mocks"], + "@kbn/config-mocks/*": ["packages/kbn-config-mocks/*"], + "@kbn/config-schema": ["packages/kbn-config-schema"], + "@kbn/config-schema/*": ["packages/kbn-config-schema/*"], + "@kbn/console-plugin": ["src/plugins/console"], + "@kbn/console-plugin/*": ["src/plugins/console/*"], "@kbn/content-management-content-editor": ["packages/content-management/content_editor"], "@kbn/content-management-content-editor/*": ["packages/content-management/content_editor/*"], "@kbn/content-management-table-list": ["packages/content-management/table_list"], "@kbn/content-management-table-list/*": ["packages/content-management/table_list/*"], + "@kbn/controls-example-plugin": ["examples/controls_example"], + "@kbn/controls-example-plugin/*": ["examples/controls_example/*"], + "@kbn/controls-plugin": ["src/plugins/controls"], + "@kbn/controls-plugin/*": ["src/plugins/controls/*"], + "@kbn/core": ["src/core"], + "@kbn/core/*": ["src/core/*"], "@kbn/core-analytics-browser": ["packages/core/analytics/core-analytics-browser"], "@kbn/core-analytics-browser/*": ["packages/core/analytics/core-analytics-browser/*"], "@kbn/core-analytics-browser-internal": ["packages/core/analytics/core-analytics-browser-internal"], @@ -34,6 +152,8 @@ "@kbn/core-analytics-server-internal/*": ["packages/core/analytics/core-analytics-server-internal/*"], "@kbn/core-analytics-server-mocks": ["packages/core/analytics/core-analytics-server-mocks"], "@kbn/core-analytics-server-mocks/*": ["packages/core/analytics/core-analytics-server-mocks/*"], + "@kbn/core-app-status-plugin": ["test/plugin_functional/plugins/core_app_status"], + "@kbn/core-app-status-plugin/*": ["test/plugin_functional/plugins/core_app_status/*"], "@kbn/core-application-browser": ["packages/core/application/core-application-browser"], "@kbn/core-application-browser/*": ["packages/core/application/core-application-browser/*"], "@kbn/core-application-browser-internal": ["packages/core/application/core-application-browser-internal"], @@ -140,6 +260,8 @@ "@kbn/core-fatal-errors-browser-internal/*": ["packages/core/fatal-errors/core-fatal-errors-browser-internal/*"], "@kbn/core-fatal-errors-browser-mocks": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks"], "@kbn/core-fatal-errors-browser-mocks/*": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks/*"], + "@kbn/core-history-block-plugin": ["test/plugin_functional/plugins/core_history_block"], + "@kbn/core-history-block-plugin/*": ["test/plugin_functional/plugins/core_history_block/*"], "@kbn/core-http-browser": ["packages/core/http/core-http-browser"], "@kbn/core-http-browser/*": ["packages/core/http/core-http-browser/*"], "@kbn/core-http-browser-internal": ["packages/core/http/core-http-browser-internal"], @@ -152,6 +274,8 @@ "@kbn/core-http-context-server-internal/*": ["packages/core/http/core-http-context-server-internal/*"], "@kbn/core-http-context-server-mocks": ["packages/core/http/core-http-context-server-mocks"], "@kbn/core-http-context-server-mocks/*": ["packages/core/http/core-http-context-server-mocks/*"], + "@kbn/core-http-plugin": ["test/plugin_functional/plugins/core_http"], + "@kbn/core-http-plugin/*": ["test/plugin_functional/plugins/core_http/*"], "@kbn/core-http-request-handler-context-server": ["packages/core/http/core-http-request-handler-context-server"], "@kbn/core-http-request-handler-context-server/*": ["packages/core/http/core-http-request-handler-context-server/*"], "@kbn/core-http-request-handler-context-server-internal": ["packages/core/http/core-http-request-handler-context-server-internal"], @@ -250,6 +374,26 @@ "@kbn/core-overlays-browser-internal/*": ["packages/core/overlays/core-overlays-browser-internal/*"], "@kbn/core-overlays-browser-mocks": ["packages/core/overlays/core-overlays-browser-mocks"], "@kbn/core-overlays-browser-mocks/*": ["packages/core/overlays/core-overlays-browser-mocks/*"], + "@kbn/core-plugin-a-plugin": ["test/plugin_functional/plugins/core_plugin_a"], + "@kbn/core-plugin-a-plugin/*": ["test/plugin_functional/plugins/core_plugin_a/*"], + "@kbn/core-plugin-appleave-plugin": ["test/plugin_functional/plugins/core_plugin_appleave"], + "@kbn/core-plugin-appleave-plugin/*": ["test/plugin_functional/plugins/core_plugin_appleave/*"], + "@kbn/core-plugin-b-plugin": ["test/plugin_functional/plugins/core_plugin_b"], + "@kbn/core-plugin-b-plugin/*": ["test/plugin_functional/plugins/core_plugin_b/*"], + "@kbn/core-plugin-chromeless-plugin": ["test/plugin_functional/plugins/core_plugin_chromeless"], + "@kbn/core-plugin-chromeless-plugin/*": ["test/plugin_functional/plugins/core_plugin_chromeless/*"], + "@kbn/core-plugin-deep-links-plugin": ["test/plugin_functional/plugins/core_plugin_deep_links"], + "@kbn/core-plugin-deep-links-plugin/*": ["test/plugin_functional/plugins/core_plugin_deep_links/*"], + "@kbn/core-plugin-deprecations-plugin": ["test/plugin_functional/plugins/core_plugin_deprecations"], + "@kbn/core-plugin-deprecations-plugin/*": ["test/plugin_functional/plugins/core_plugin_deprecations/*"], + "@kbn/core-plugin-execution-context-plugin": ["test/plugin_functional/plugins/core_plugin_execution_context"], + "@kbn/core-plugin-execution-context-plugin/*": ["test/plugin_functional/plugins/core_plugin_execution_context/*"], + "@kbn/core-plugin-helpmenu-plugin": ["test/plugin_functional/plugins/core_plugin_helpmenu"], + "@kbn/core-plugin-helpmenu-plugin/*": ["test/plugin_functional/plugins/core_plugin_helpmenu/*"], + "@kbn/core-plugin-route-timeouts-plugin": ["test/plugin_functional/plugins/core_plugin_route_timeouts"], + "@kbn/core-plugin-route-timeouts-plugin/*": ["test/plugin_functional/plugins/core_plugin_route_timeouts/*"], + "@kbn/core-plugin-static-assets-plugin": ["test/plugin_functional/plugins/core_plugin_static_assets"], + "@kbn/core-plugin-static-assets-plugin/*": ["test/plugin_functional/plugins/core_plugin_static_assets/*"], "@kbn/core-plugins-base-server-internal": ["packages/core/plugins/core-plugins-base-server-internal"], "@kbn/core-plugins-base-server-internal/*": ["packages/core/plugins/core-plugins-base-server-internal/*"], "@kbn/core-plugins-browser": ["packages/core/plugins/core-plugins-browser"], @@ -270,6 +414,8 @@ "@kbn/core-preboot-server-internal/*": ["packages/core/preboot/core-preboot-server-internal/*"], "@kbn/core-preboot-server-mocks": ["packages/core/preboot/core-preboot-server-mocks"], "@kbn/core-preboot-server-mocks/*": ["packages/core/preboot/core-preboot-server-mocks/*"], + "@kbn/core-provider-plugin": ["test/plugin_functional/plugins/core_provider_plugin"], + "@kbn/core-provider-plugin/*": ["test/plugin_functional/plugins/core_provider_plugin/*"], "@kbn/core-rendering-browser-internal": ["packages/core/rendering/core-rendering-browser-internal"], "@kbn/core-rendering-browser-internal/*": ["packages/core/rendering/core-rendering-browser-internal/*"], "@kbn/core-rendering-browser-mocks": ["packages/core/rendering/core-rendering-browser-mocks"], @@ -366,66 +512,42 @@ "@kbn/core-usage-data-server-internal/*": ["packages/core/usage-data/core-usage-data-server-internal/*"], "@kbn/core-usage-data-server-mocks": ["packages/core/usage-data/core-usage-data-server-mocks"], "@kbn/core-usage-data-server-mocks/*": ["packages/core/usage-data/core-usage-data-server-mocks/*"], - "@kbn/home-sample-data-card": ["packages/home/sample_data_card"], - "@kbn/home-sample-data-card/*": ["packages/home/sample_data_card/*"], - "@kbn/home-sample-data-tab": ["packages/home/sample_data_tab"], - "@kbn/home-sample-data-tab/*": ["packages/home/sample_data_tab/*"], - "@kbn/home-sample-data-types": ["packages/home/sample_data_types"], - "@kbn/home-sample-data-types/*": ["packages/home/sample_data_types/*"], - "@kbn/ace": ["packages/kbn-ace"], - "@kbn/ace/*": ["packages/kbn-ace/*"], - "@kbn/alerts": ["packages/kbn-alerts"], - "@kbn/alerts/*": ["packages/kbn-alerts/*"], - "@kbn/ambient-common-types": ["packages/kbn-ambient-common-types"], - "@kbn/ambient-common-types/*": ["packages/kbn-ambient-common-types/*"], - "@kbn/ambient-ftr-types": ["packages/kbn-ambient-ftr-types"], - "@kbn/ambient-ftr-types/*": ["packages/kbn-ambient-ftr-types/*"], - "@kbn/ambient-storybook-types": ["packages/kbn-ambient-storybook-types"], - "@kbn/ambient-storybook-types/*": ["packages/kbn-ambient-storybook-types/*"], - "@kbn/ambient-ui-types": ["packages/kbn-ambient-ui-types"], - "@kbn/ambient-ui-types/*": ["packages/kbn-ambient-ui-types/*"], - "@kbn/analytics": ["packages/kbn-analytics"], - "@kbn/analytics/*": ["packages/kbn-analytics/*"], - "@kbn/apm-config-loader": ["packages/kbn-apm-config-loader"], - "@kbn/apm-config-loader/*": ["packages/kbn-apm-config-loader/*"], - "@kbn/apm-synthtrace": ["packages/kbn-apm-synthtrace"], - "@kbn/apm-synthtrace/*": ["packages/kbn-apm-synthtrace/*"], - "@kbn/apm-utils": ["packages/kbn-apm-utils"], - "@kbn/apm-utils/*": ["packages/kbn-apm-utils/*"], - "@kbn/axe-config": ["packages/kbn-axe-config"], - "@kbn/axe-config/*": ["packages/kbn-axe-config/*"], - "@kbn/babel-plugin-synthetic-packages": ["packages/kbn-babel-plugin-synthetic-packages"], - "@kbn/babel-plugin-synthetic-packages/*": ["packages/kbn-babel-plugin-synthetic-packages/*"], - "@kbn/babel-preset": ["packages/kbn-babel-preset"], - "@kbn/babel-preset/*": ["packages/kbn-babel-preset/*"], - "@kbn/bazel-packages": ["packages/kbn-bazel-packages"], - "@kbn/bazel-packages/*": ["packages/kbn-bazel-packages/*"], - "@kbn/bazel-runner": ["packages/kbn-bazel-runner"], - "@kbn/bazel-runner/*": ["packages/kbn-bazel-runner/*"], - "@kbn/cases-components": ["packages/kbn-cases-components"], - "@kbn/cases-components/*": ["packages/kbn-cases-components/*"], - "@kbn/chart-icons": ["packages/kbn-chart-icons"], - "@kbn/chart-icons/*": ["packages/kbn-chart-icons/*"], - "@kbn/ci-stats-core": ["packages/kbn-ci-stats-core"], - "@kbn/ci-stats-core/*": ["packages/kbn-ci-stats-core/*"], - "@kbn/ci-stats-performance-metrics": ["packages/kbn-ci-stats-performance-metrics"], - "@kbn/ci-stats-performance-metrics/*": ["packages/kbn-ci-stats-performance-metrics/*"], - "@kbn/ci-stats-reporter": ["packages/kbn-ci-stats-reporter"], - "@kbn/ci-stats-reporter/*": ["packages/kbn-ci-stats-reporter/*"], - "@kbn/cli-dev-mode": ["packages/kbn-cli-dev-mode"], - "@kbn/cli-dev-mode/*": ["packages/kbn-cli-dev-mode/*"], - "@kbn/coloring": ["packages/kbn-coloring"], - "@kbn/coloring/*": ["packages/kbn-coloring/*"], - "@kbn/config": ["packages/kbn-config"], - "@kbn/config/*": ["packages/kbn-config/*"], - "@kbn/config-mocks": ["packages/kbn-config-mocks"], - "@kbn/config-mocks/*": ["packages/kbn-config-mocks/*"], - "@kbn/config-schema": ["packages/kbn-config-schema"], - "@kbn/config-schema/*": ["packages/kbn-config-schema/*"], + "@kbn/coverage-fixtures-plugin": ["test/common/fixtures/plugins/coverage"], + "@kbn/coverage-fixtures-plugin/*": ["test/common/fixtures/plugins/coverage/*"], + "@kbn/cross-cluster-replication-plugin": ["x-pack/plugins/cross_cluster_replication"], + "@kbn/cross-cluster-replication-plugin/*": ["x-pack/plugins/cross_cluster_replication/*"], "@kbn/crypto": ["packages/kbn-crypto"], "@kbn/crypto/*": ["packages/kbn-crypto/*"], "@kbn/crypto-browser": ["packages/kbn-crypto-browser"], "@kbn/crypto-browser/*": ["packages/kbn-crypto-browser/*"], + "@kbn/custom-branding-plugin": ["x-pack/plugins/custom_branding"], + "@kbn/custom-branding-plugin/*": ["x-pack/plugins/custom_branding/*"], + "@kbn/custom-integrations-plugin": ["src/plugins/custom_integrations"], + "@kbn/custom-integrations-plugin/*": ["src/plugins/custom_integrations/*"], + "@kbn/cypress-config": ["packages/kbn-cypress-config"], + "@kbn/cypress-config/*": ["packages/kbn-cypress-config/*"], + "@kbn/dashboard-embeddable-examples-plugin": ["examples/dashboard_embeddable_examples"], + "@kbn/dashboard-embeddable-examples-plugin/*": ["examples/dashboard_embeddable_examples/*"], + "@kbn/dashboard-enhanced-plugin": ["x-pack/plugins/dashboard_enhanced"], + "@kbn/dashboard-enhanced-plugin/*": ["x-pack/plugins/dashboard_enhanced/*"], + "@kbn/dashboard-plugin": ["src/plugins/dashboard"], + "@kbn/dashboard-plugin/*": ["src/plugins/dashboard/*"], + "@kbn/data-plugin": ["src/plugins/data"], + "@kbn/data-plugin/*": ["src/plugins/data/*"], + "@kbn/data-search-plugin": ["test/plugin_functional/plugins/data_search"], + "@kbn/data-search-plugin/*": ["test/plugin_functional/plugins/data_search/*"], + "@kbn/data-view-editor-plugin": ["src/plugins/data_view_editor"], + "@kbn/data-view-editor-plugin/*": ["src/plugins/data_view_editor/*"], + "@kbn/data-view-field-editor-example-plugin": ["examples/data_view_field_editor_example"], + "@kbn/data-view-field-editor-example-plugin/*": ["examples/data_view_field_editor_example/*"], + "@kbn/data-view-field-editor-plugin": ["src/plugins/data_view_field_editor"], + "@kbn/data-view-field-editor-plugin/*": ["src/plugins/data_view_field_editor/*"], + "@kbn/data-view-management-plugin": ["src/plugins/data_view_management"], + "@kbn/data-view-management-plugin/*": ["src/plugins/data_view_management/*"], + "@kbn/data-views-plugin": ["src/plugins/data_views"], + "@kbn/data-views-plugin/*": ["src/plugins/data_views/*"], + "@kbn/data-visualizer-plugin": ["x-pack/plugins/data_visualizer"], + "@kbn/data-visualizer-plugin/*": ["x-pack/plugins/data_visualizer/*"], "@kbn/datemath": ["packages/kbn-datemath"], "@kbn/datemath/*": ["packages/kbn-datemath/*"], "@kbn/dev-cli-errors": ["packages/kbn-dev-cli-errors"], @@ -434,8 +556,16 @@ "@kbn/dev-cli-runner/*": ["packages/kbn-dev-cli-runner/*"], "@kbn/dev-proc-runner": ["packages/kbn-dev-proc-runner"], "@kbn/dev-proc-runner/*": ["packages/kbn-dev-proc-runner/*"], + "@kbn/dev-tools-plugin": ["src/plugins/dev_tools"], + "@kbn/dev-tools-plugin/*": ["src/plugins/dev_tools/*"], "@kbn/dev-utils": ["packages/kbn-dev-utils"], "@kbn/dev-utils/*": ["packages/kbn-dev-utils/*"], + "@kbn/developer-examples-plugin": ["examples/developer_examples"], + "@kbn/developer-examples-plugin/*": ["examples/developer_examples/*"], + "@kbn/discover-enhanced-plugin": ["x-pack/plugins/discover_enhanced"], + "@kbn/discover-enhanced-plugin/*": ["x-pack/plugins/discover_enhanced/*"], + "@kbn/discover-plugin": ["src/plugins/discover"], + "@kbn/discover-plugin/*": ["src/plugins/discover/*"], "@kbn/doc-links": ["packages/kbn-doc-links"], "@kbn/doc-links/*": ["packages/kbn-doc-links/*"], "@kbn/docs-utils": ["packages/kbn-docs-utils"], @@ -444,6 +574,24 @@ "@kbn/ebt-tools/*": ["packages/kbn-ebt-tools/*"], "@kbn/ecs": ["packages/kbn-ecs"], "@kbn/ecs/*": ["packages/kbn-ecs/*"], + "@kbn/elasticsearch-client-plugin": ["test/plugin_functional/plugins/elasticsearch_client_plugin"], + "@kbn/elasticsearch-client-plugin/*": ["test/plugin_functional/plugins/elasticsearch_client_plugin/*"], + "@kbn/elasticsearch-client-xpack-plugin": ["x-pack/test/plugin_api_integration/plugins/elasticsearch_client"], + "@kbn/elasticsearch-client-xpack-plugin/*": ["x-pack/test/plugin_api_integration/plugins/elasticsearch_client/*"], + "@kbn/embeddable-enhanced-plugin": ["x-pack/plugins/embeddable_enhanced"], + "@kbn/embeddable-enhanced-plugin/*": ["x-pack/plugins/embeddable_enhanced/*"], + "@kbn/embeddable-examples-plugin": ["examples/embeddable_examples"], + "@kbn/embeddable-examples-plugin/*": ["examples/embeddable_examples/*"], + "@kbn/embeddable-explorer-plugin": ["examples/embeddable_explorer"], + "@kbn/embeddable-explorer-plugin/*": ["examples/embeddable_explorer/*"], + "@kbn/embeddable-plugin": ["src/plugins/embeddable"], + "@kbn/embeddable-plugin/*": ["src/plugins/embeddable/*"], + "@kbn/embedded-lens-example-plugin": ["x-pack/examples/embedded_lens_example"], + "@kbn/embedded-lens-example-plugin/*": ["x-pack/examples/embedded_lens_example/*"], + "@kbn/encrypted-saved-objects-plugin": ["x-pack/plugins/encrypted_saved_objects"], + "@kbn/encrypted-saved-objects-plugin/*": ["x-pack/plugins/encrypted_saved_objects/*"], + "@kbn/enterprise-search-plugin": ["x-pack/plugins/enterprise_search"], + "@kbn/enterprise-search-plugin/*": ["x-pack/plugins/enterprise_search/*"], "@kbn/es": ["packages/kbn-es"], "@kbn/es/*": ["packages/kbn-es/*"], "@kbn/es-archiver": ["packages/kbn-es-archiver"], @@ -454,6 +602,8 @@ "@kbn/es-query/*": ["packages/kbn-es-query/*"], "@kbn/es-types": ["packages/kbn-es-types"], "@kbn/es-types/*": ["packages/kbn-es-types/*"], + "@kbn/es-ui-shared-plugin": ["src/plugins/es_ui_shared"], + "@kbn/es-ui-shared-plugin/*": ["src/plugins/es_ui_shared/*"], "@kbn/eslint-config": ["packages/kbn-eslint-config"], "@kbn/eslint-config/*": ["packages/kbn-eslint-config/*"], "@kbn/eslint-plugin-disable": ["packages/kbn-eslint-plugin-disable"], @@ -462,14 +612,70 @@ "@kbn/eslint-plugin-eslint/*": ["packages/kbn-eslint-plugin-eslint/*"], "@kbn/eslint-plugin-imports": ["packages/kbn-eslint-plugin-imports"], "@kbn/eslint-plugin-imports/*": ["packages/kbn-eslint-plugin-imports/*"], + "@kbn/event-annotation-plugin": ["src/plugins/event_annotation"], + "@kbn/event-annotation-plugin/*": ["src/plugins/event_annotation/*"], + "@kbn/event-log-fixture-plugin": ["x-pack/test/plugin_api_integration/plugins/event_log"], + "@kbn/event-log-fixture-plugin/*": ["x-pack/test/plugin_api_integration/plugins/event_log/*"], + "@kbn/event-log-plugin": ["x-pack/plugins/event_log"], + "@kbn/event-log-plugin/*": ["x-pack/plugins/event_log/*"], "@kbn/expect": ["packages/kbn-expect"], "@kbn/expect/*": ["packages/kbn-expect/*"], + "@kbn/exploratory-view-example-plugin": ["x-pack/examples/exploratory_view_example"], + "@kbn/exploratory-view-example-plugin/*": ["x-pack/examples/exploratory_view_example/*"], + "@kbn/expression-error-plugin": ["src/plugins/expression_error"], + "@kbn/expression-error-plugin/*": ["src/plugins/expression_error/*"], + "@kbn/expression-gauge-plugin": ["src/plugins/chart_expressions/expression_gauge"], + "@kbn/expression-gauge-plugin/*": ["src/plugins/chart_expressions/expression_gauge/*"], + "@kbn/expression-heatmap-plugin": ["src/plugins/chart_expressions/expression_heatmap"], + "@kbn/expression-heatmap-plugin/*": ["src/plugins/chart_expressions/expression_heatmap/*"], + "@kbn/expression-image-plugin": ["src/plugins/expression_image"], + "@kbn/expression-image-plugin/*": ["src/plugins/expression_image/*"], + "@kbn/expression-legacy-metric-vis-plugin": ["src/plugins/chart_expressions/expression_legacy_metric"], + "@kbn/expression-legacy-metric-vis-plugin/*": ["src/plugins/chart_expressions/expression_legacy_metric/*"], + "@kbn/expression-metric-plugin": ["src/plugins/expression_metric"], + "@kbn/expression-metric-plugin/*": ["src/plugins/expression_metric/*"], + "@kbn/expression-metric-vis-plugin": ["src/plugins/chart_expressions/expression_metric"], + "@kbn/expression-metric-vis-plugin/*": ["src/plugins/chart_expressions/expression_metric/*"], + "@kbn/expression-partition-vis-plugin": ["src/plugins/chart_expressions/expression_partition_vis"], + "@kbn/expression-partition-vis-plugin/*": ["src/plugins/chart_expressions/expression_partition_vis/*"], + "@kbn/expression-repeat-image-plugin": ["src/plugins/expression_repeat_image"], + "@kbn/expression-repeat-image-plugin/*": ["src/plugins/expression_repeat_image/*"], + "@kbn/expression-reveal-image-plugin": ["src/plugins/expression_reveal_image"], + "@kbn/expression-reveal-image-plugin/*": ["src/plugins/expression_reveal_image/*"], + "@kbn/expression-shape-plugin": ["src/plugins/expression_shape"], + "@kbn/expression-shape-plugin/*": ["src/plugins/expression_shape/*"], + "@kbn/expression-tagcloud-plugin": ["src/plugins/chart_expressions/expression_tagcloud"], + "@kbn/expression-tagcloud-plugin/*": ["src/plugins/chart_expressions/expression_tagcloud/*"], + "@kbn/expression-xy-plugin": ["src/plugins/chart_expressions/expression_xy"], + "@kbn/expression-xy-plugin/*": ["src/plugins/chart_expressions/expression_xy/*"], + "@kbn/expressions-explorer-plugin": ["examples/expressions_explorer"], + "@kbn/expressions-explorer-plugin/*": ["examples/expressions_explorer/*"], + "@kbn/expressions-plugin": ["src/plugins/expressions"], + "@kbn/expressions-plugin/*": ["src/plugins/expressions/*"], "@kbn/failed-test-reporter-cli": ["packages/kbn-failed-test-reporter-cli"], "@kbn/failed-test-reporter-cli/*": ["packages/kbn-failed-test-reporter-cli/*"], + "@kbn/feature-usage-test-plugin": ["x-pack/test/plugin_api_integration/plugins/feature_usage_test"], + "@kbn/feature-usage-test-plugin/*": ["x-pack/test/plugin_api_integration/plugins/feature_usage_test/*"], + "@kbn/features-plugin": ["x-pack/plugins/features"], + "@kbn/features-plugin/*": ["x-pack/plugins/features/*"], + "@kbn/field-formats-example-plugin": ["examples/field_formats_example"], + "@kbn/field-formats-example-plugin/*": ["examples/field_formats_example/*"], + "@kbn/field-formats-plugin": ["src/plugins/field_formats"], + "@kbn/field-formats-plugin/*": ["src/plugins/field_formats/*"], "@kbn/field-types": ["packages/kbn-field-types"], "@kbn/field-types/*": ["packages/kbn-field-types/*"], + "@kbn/file-upload-plugin": ["x-pack/plugins/file_upload"], + "@kbn/file-upload-plugin/*": ["x-pack/plugins/file_upload/*"], + "@kbn/files-example-plugin": ["examples/files_example"], + "@kbn/files-example-plugin/*": ["examples/files_example/*"], + "@kbn/files-management-plugin": ["src/plugins/files_management"], + "@kbn/files-management-plugin/*": ["src/plugins/files_management/*"], + "@kbn/files-plugin": ["src/plugins/files"], + "@kbn/files-plugin/*": ["src/plugins/files/*"], "@kbn/find-used-node-modules": ["packages/kbn-find-used-node-modules"], "@kbn/find-used-node-modules/*": ["packages/kbn-find-used-node-modules/*"], + "@kbn/fleet-plugin": ["x-pack/plugins/fleet"], + "@kbn/fleet-plugin/*": ["x-pack/plugins/fleet/*"], "@kbn/flot-charts": ["packages/kbn-flot-charts"], "@kbn/flot-charts/*": ["packages/kbn-flot-charts/*"], "@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"], @@ -480,20 +686,64 @@ "@kbn/generate/*": ["packages/kbn-generate/*"], "@kbn/get-repo-files": ["packages/kbn-get-repo-files"], "@kbn/get-repo-files/*": ["packages/kbn-get-repo-files/*"], + "@kbn/global-search-bar-plugin": ["x-pack/plugins/global_search_bar"], + "@kbn/global-search-bar-plugin/*": ["x-pack/plugins/global_search_bar/*"], + "@kbn/global-search-plugin": ["x-pack/plugins/global_search"], + "@kbn/global-search-plugin/*": ["x-pack/plugins/global_search/*"], + "@kbn/global-search-providers-plugin": ["x-pack/plugins/global_search_providers"], + "@kbn/global-search-providers-plugin/*": ["x-pack/plugins/global_search_providers/*"], + "@kbn/global-search-test-plugin": ["x-pack/test/plugin_functional/plugins/global_search_test"], + "@kbn/global-search-test-plugin/*": ["x-pack/test/plugin_functional/plugins/global_search_test/*"], + "@kbn/graph-plugin": ["x-pack/plugins/graph"], + "@kbn/graph-plugin/*": ["x-pack/plugins/graph/*"], + "@kbn/grokdebugger-plugin": ["x-pack/plugins/grokdebugger"], + "@kbn/grokdebugger-plugin/*": ["x-pack/plugins/grokdebugger/*"], "@kbn/guided-onboarding": ["packages/kbn-guided-onboarding"], "@kbn/guided-onboarding/*": ["packages/kbn-guided-onboarding/*"], + "@kbn/guided-onboarding-example-plugin": ["examples/guided_onboarding_example"], + "@kbn/guided-onboarding-example-plugin/*": ["examples/guided_onboarding_example/*"], + "@kbn/guided-onboarding-plugin": ["src/plugins/guided_onboarding"], + "@kbn/guided-onboarding-plugin/*": ["src/plugins/guided_onboarding/*"], "@kbn/handlebars": ["packages/kbn-handlebars"], "@kbn/handlebars/*": ["packages/kbn-handlebars/*"], "@kbn/hapi-mocks": ["packages/kbn-hapi-mocks"], "@kbn/hapi-mocks/*": ["packages/kbn-hapi-mocks/*"], "@kbn/health-gateway-server": ["packages/kbn-health-gateway-server"], "@kbn/health-gateway-server/*": ["packages/kbn-health-gateway-server/*"], + "@kbn/hello-world-plugin": ["examples/hello_world"], + "@kbn/hello-world-plugin/*": ["examples/hello_world/*"], + "@kbn/home-plugin": ["src/plugins/home"], + "@kbn/home-plugin/*": ["src/plugins/home/*"], + "@kbn/home-sample-data-card": ["packages/home/sample_data_card"], + "@kbn/home-sample-data-card/*": ["packages/home/sample_data_card/*"], + "@kbn/home-sample-data-tab": ["packages/home/sample_data_tab"], + "@kbn/home-sample-data-tab/*": ["packages/home/sample_data_tab/*"], + "@kbn/home-sample-data-types": ["packages/home/sample_data_types"], + "@kbn/home-sample-data-types/*": ["packages/home/sample_data_types/*"], "@kbn/i18n": ["packages/kbn-i18n"], "@kbn/i18n/*": ["packages/kbn-i18n/*"], "@kbn/i18n-react": ["packages/kbn-i18n-react"], "@kbn/i18n-react/*": ["packages/kbn-i18n-react/*"], + "@kbn/image-embeddable-plugin": ["src/plugins/image_embeddable"], + "@kbn/image-embeddable-plugin/*": ["src/plugins/image_embeddable/*"], "@kbn/import-resolver": ["packages/kbn-import-resolver"], "@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"], + "@kbn/index-lifecycle-management-plugin": ["x-pack/plugins/index_lifecycle_management"], + "@kbn/index-lifecycle-management-plugin/*": ["x-pack/plugins/index_lifecycle_management/*"], + "@kbn/index-management-plugin": ["x-pack/plugins/index_management"], + "@kbn/index-management-plugin/*": ["x-pack/plugins/index_management/*"], + "@kbn/index-patterns-test-plugin": ["test/plugin_functional/plugins/index_patterns"], + "@kbn/index-patterns-test-plugin/*": ["test/plugin_functional/plugins/index_patterns/*"], + "@kbn/infra-plugin": ["x-pack/plugins/infra"], + "@kbn/infra-plugin/*": ["x-pack/plugins/infra/*"], + "@kbn/ingest-pipelines-plugin": ["x-pack/plugins/ingest_pipelines"], + "@kbn/ingest-pipelines-plugin/*": ["x-pack/plugins/ingest_pipelines/*"], + "@kbn/input-control-vis-plugin": ["src/plugins/input_control_vis"], + "@kbn/input-control-vis-plugin/*": ["src/plugins/input_control_vis/*"], + "@kbn/inspector-plugin": ["src/plugins/inspector"], + "@kbn/inspector-plugin/*": ["src/plugins/inspector/*"], + "@kbn/interactive-setup-plugin": ["src/plugins/interactive_setup"], + "@kbn/interactive-setup-plugin/*": ["src/plugins/interactive_setup/*"], "@kbn/interpreter": ["packages/kbn-interpreter"], "@kbn/interpreter/*": ["packages/kbn-interpreter/*"], "@kbn/io-ts-utils": ["packages/kbn-io-ts-utils"], @@ -502,28 +752,106 @@ "@kbn/jest-serializers/*": ["packages/kbn-jest-serializers/*"], "@kbn/journeys": ["packages/kbn-journeys"], "@kbn/journeys/*": ["packages/kbn-journeys/*"], + "@kbn/kbn-health-gateway-status-plugin": ["test/health_gateway/plugins/status"], + "@kbn/kbn-health-gateway-status-plugin/*": ["test/health_gateway/plugins/status/*"], + "@kbn/kbn-sample-panel-action-plugin": ["test/plugin_functional/plugins/kbn_sample_panel_action"], + "@kbn/kbn-sample-panel-action-plugin/*": ["test/plugin_functional/plugins/kbn_sample_panel_action/*"], + "@kbn/kbn-top-nav-plugin": ["test/plugin_functional/plugins/kbn_top_nav"], + "@kbn/kbn-top-nav-plugin/*": ["test/plugin_functional/plugins/kbn_top_nav/*"], + "@kbn/kbn-tp-custom-visualizations-plugin": ["test/plugin_functional/plugins/kbn_tp_custom_visualizations"], + "@kbn/kbn-tp-custom-visualizations-plugin/*": ["test/plugin_functional/plugins/kbn_tp_custom_visualizations/*"], + "@kbn/kbn-tp-run-pipeline-plugin": ["test/interpreter_functional/plugins/kbn_tp_run_pipeline"], + "@kbn/kbn-tp-run-pipeline-plugin/*": ["test/interpreter_functional/plugins/kbn_tp_run_pipeline/*"], "@kbn/kibana-manifest-schema": ["packages/kbn-kibana-manifest-schema"], "@kbn/kibana-manifest-schema/*": ["packages/kbn-kibana-manifest-schema/*"], + "@kbn/kibana-overview-plugin": ["src/plugins/kibana_overview"], + "@kbn/kibana-overview-plugin/*": ["src/plugins/kibana_overview/*"], + "@kbn/kibana-react-plugin": ["src/plugins/kibana_react"], + "@kbn/kibana-react-plugin/*": ["src/plugins/kibana_react/*"], + "@kbn/kibana-usage-collection-plugin": ["src/plugins/kibana_usage_collection"], + "@kbn/kibana-usage-collection-plugin/*": ["src/plugins/kibana_usage_collection/*"], + "@kbn/kibana-utils-plugin": ["src/plugins/kibana_utils"], + "@kbn/kibana-utils-plugin/*": ["src/plugins/kibana_utils/*"], + "@kbn/kubernetes-security-plugin": ["x-pack/plugins/kubernetes_security"], + "@kbn/kubernetes-security-plugin/*": ["x-pack/plugins/kubernetes_security/*"], "@kbn/language-documentation-popover": ["packages/kbn-language-documentation-popover"], "@kbn/language-documentation-popover/*": ["packages/kbn-language-documentation-popover/*"], + "@kbn/lens-plugin": ["x-pack/plugins/lens"], + "@kbn/lens-plugin/*": ["x-pack/plugins/lens/*"], + "@kbn/license-api-guard-plugin": ["x-pack/plugins/license_api_guard"], + "@kbn/license-api-guard-plugin/*": ["x-pack/plugins/license_api_guard/*"], + "@kbn/license-management-plugin": ["x-pack/plugins/license_management"], + "@kbn/license-management-plugin/*": ["x-pack/plugins/license_management/*"], + "@kbn/licensing-plugin": ["x-pack/plugins/licensing"], + "@kbn/licensing-plugin/*": ["x-pack/plugins/licensing/*"], + "@kbn/lists-plugin": ["x-pack/plugins/lists"], + "@kbn/lists-plugin/*": ["x-pack/plugins/lists/*"], + "@kbn/locator-examples-plugin": ["examples/locator_examples"], + "@kbn/locator-examples-plugin/*": ["examples/locator_examples/*"], + "@kbn/locator-explorer-plugin": ["examples/locator_explorer"], + "@kbn/locator-explorer-plugin/*": ["examples/locator_explorer/*"], "@kbn/logging": ["packages/kbn-logging"], "@kbn/logging/*": ["packages/kbn-logging/*"], "@kbn/logging-mocks": ["packages/kbn-logging-mocks"], "@kbn/logging-mocks/*": ["packages/kbn-logging-mocks/*"], + "@kbn/logstash-plugin": ["x-pack/plugins/logstash"], + "@kbn/logstash-plugin/*": ["x-pack/plugins/logstash/*"], "@kbn/managed-vscode-config": ["packages/kbn-managed-vscode-config"], "@kbn/managed-vscode-config/*": ["packages/kbn-managed-vscode-config/*"], "@kbn/managed-vscode-config-cli": ["packages/kbn-managed-vscode-config-cli"], "@kbn/managed-vscode-config-cli/*": ["packages/kbn-managed-vscode-config-cli/*"], + "@kbn/management-plugin": ["src/plugins/management"], + "@kbn/management-plugin/*": ["src/plugins/management/*"], + "@kbn/management-test-plugin": ["test/plugin_functional/plugins/management_test_plugin"], + "@kbn/management-test-plugin/*": ["test/plugin_functional/plugins/management_test_plugin/*"], "@kbn/mapbox-gl": ["packages/kbn-mapbox-gl"], "@kbn/mapbox-gl/*": ["packages/kbn-mapbox-gl/*"], + "@kbn/maps-custom-raster-source-plugin": ["x-pack/examples/third_party_maps_source_example"], + "@kbn/maps-custom-raster-source-plugin/*": ["x-pack/examples/third_party_maps_source_example/*"], + "@kbn/maps-ems-plugin": ["src/plugins/maps_ems"], + "@kbn/maps-ems-plugin/*": ["src/plugins/maps_ems/*"], + "@kbn/maps-plugin": ["x-pack/plugins/maps"], + "@kbn/maps-plugin/*": ["x-pack/plugins/maps/*"], + "@kbn/ml-agg-utils": ["x-pack/packages/ml/agg_utils"], + "@kbn/ml-agg-utils/*": ["x-pack/packages/ml/agg_utils/*"], + "@kbn/ml-is-populated-object": ["x-pack/packages/ml/is_populated_object"], + "@kbn/ml-is-populated-object/*": ["x-pack/packages/ml/is_populated_object/*"], + "@kbn/ml-plugin": ["x-pack/plugins/ml"], + "@kbn/ml-plugin/*": ["x-pack/plugins/ml/*"], + "@kbn/ml-string-hash": ["x-pack/packages/ml/string_hash"], + "@kbn/ml-string-hash/*": ["x-pack/packages/ml/string_hash/*"], "@kbn/monaco": ["packages/kbn-monaco"], "@kbn/monaco/*": ["packages/kbn-monaco/*"], + "@kbn/monitoring-collection-plugin": ["x-pack/plugins/monitoring_collection"], + "@kbn/monitoring-collection-plugin/*": ["x-pack/plugins/monitoring_collection/*"], + "@kbn/monitoring-plugin": ["x-pack/plugins/monitoring"], + "@kbn/monitoring-plugin/*": ["x-pack/plugins/monitoring/*"], + "@kbn/navigation-plugin": ["src/plugins/navigation"], + "@kbn/navigation-plugin/*": ["src/plugins/navigation/*"], + "@kbn/newsfeed-fixtures-plugin": ["test/common/fixtures/plugins/newsfeed"], + "@kbn/newsfeed-fixtures-plugin/*": ["test/common/fixtures/plugins/newsfeed/*"], + "@kbn/newsfeed-plugin": ["src/plugins/newsfeed"], + "@kbn/newsfeed-plugin/*": ["src/plugins/newsfeed/*"], + "@kbn/notifications-plugin": ["x-pack/plugins/notifications"], + "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], + "@kbn/observability-plugin": ["x-pack/plugins/observability"], + "@kbn/observability-plugin/*": ["x-pack/plugins/observability/*"], + "@kbn/open-telemetry-instrumented-plugin": ["test/common/fixtures/plugins/otel_metrics"], + "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/fixtures/plugins/otel_metrics/*"], "@kbn/optimizer": ["packages/kbn-optimizer"], "@kbn/optimizer/*": ["packages/kbn-optimizer/*"], "@kbn/optimizer-webpack-helpers": ["packages/kbn-optimizer-webpack-helpers"], "@kbn/optimizer-webpack-helpers/*": ["packages/kbn-optimizer-webpack-helpers/*"], "@kbn/osquery-io-ts-types": ["packages/kbn-osquery-io-ts-types"], "@kbn/osquery-io-ts-types/*": ["packages/kbn-osquery-io-ts-types/*"], + "@kbn/osquery-plugin": ["x-pack/plugins/osquery"], + "@kbn/osquery-plugin/*": ["x-pack/plugins/osquery/*"], + "@kbn/package-map": ["packages/kbn-package-map"], + "@kbn/package-map/*": ["packages/kbn-package-map/*"], + "@kbn/paertial-results-example-plugin": ["examples/partial_results_example"], + "@kbn/paertial-results-example-plugin/*": ["examples/partial_results_example/*"], + "@kbn/painless-lab-plugin": ["x-pack/plugins/painless_lab"], + "@kbn/painless-lab-plugin/*": ["x-pack/plugins/painless_lab/*"], "@kbn/peggy": ["packages/kbn-peggy"], "@kbn/peggy/*": ["packages/kbn-peggy/*"], "@kbn/peggy-loader": ["packages/kbn-peggy-loader"], @@ -536,18 +864,86 @@ "@kbn/plugin-generator/*": ["packages/kbn-plugin-generator/*"], "@kbn/plugin-helpers": ["packages/kbn-plugin-helpers"], "@kbn/plugin-helpers/*": ["packages/kbn-plugin-helpers/*"], + "@kbn/preboot-example-plugin": ["examples/preboot_example"], + "@kbn/preboot-example-plugin/*": ["examples/preboot_example/*"], + "@kbn/presentation-util-plugin": ["src/plugins/presentation_util"], + "@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"], + "@kbn/profiling-plugin": ["x-pack/plugins/profiling"], + "@kbn/profiling-plugin/*": ["x-pack/plugins/profiling/*"], "@kbn/react-field": ["packages/kbn-react-field"], "@kbn/react-field/*": ["packages/kbn-react-field/*"], + "@kbn/remote-clusters-plugin": ["x-pack/plugins/remote_clusters"], + "@kbn/remote-clusters-plugin/*": ["x-pack/plugins/remote_clusters/*"], + "@kbn/rendering-plugin": ["test/plugin_functional/plugins/rendering_plugin"], + "@kbn/rendering-plugin/*": ["test/plugin_functional/plugins/rendering_plugin/*"], + "@kbn/repo-info": ["packages/kbn-repo-info"], + "@kbn/repo-info/*": ["packages/kbn-repo-info/*"], + "@kbn/repo-path": ["packages/kbn-repo-path"], + "@kbn/repo-path/*": ["packages/kbn-repo-path/*"], "@kbn/repo-source-classifier": ["packages/kbn-repo-source-classifier"], "@kbn/repo-source-classifier/*": ["packages/kbn-repo-source-classifier/*"], "@kbn/repo-source-classifier-cli": ["packages/kbn-repo-source-classifier-cli"], "@kbn/repo-source-classifier-cli/*": ["packages/kbn-repo-source-classifier-cli/*"], + "@kbn/reporting-example-plugin": ["x-pack/examples/reporting_example"], + "@kbn/reporting-example-plugin/*": ["x-pack/examples/reporting_example/*"], + "@kbn/reporting-plugin": ["x-pack/plugins/reporting"], + "@kbn/reporting-plugin/*": ["x-pack/plugins/reporting/*"], + "@kbn/resolver-test-plugin": ["x-pack/test/plugin_functional/plugins/resolver_test"], + "@kbn/resolver-test-plugin/*": ["x-pack/test/plugin_functional/plugins/resolver_test/*"], + "@kbn/response-stream-plugin": ["examples/response_stream"], + "@kbn/response-stream-plugin/*": ["examples/response_stream/*"], "@kbn/rison": ["packages/kbn-rison"], "@kbn/rison/*": ["packages/kbn-rison/*"], + "@kbn/rollup-plugin": ["x-pack/plugins/rollup"], + "@kbn/rollup-plugin/*": ["x-pack/plugins/rollup/*"], + "@kbn/routing-example-plugin": ["examples/routing_example"], + "@kbn/routing-example-plugin/*": ["examples/routing_example/*"], "@kbn/rule-data-utils": ["packages/kbn-rule-data-utils"], "@kbn/rule-data-utils/*": ["packages/kbn-rule-data-utils/*"], + "@kbn/rule-registry-plugin": ["x-pack/plugins/rule_registry"], + "@kbn/rule-registry-plugin/*": ["x-pack/plugins/rule_registry/*"], + "@kbn/runtime-fields-plugin": ["x-pack/plugins/runtime_fields"], + "@kbn/runtime-fields-plugin/*": ["x-pack/plugins/runtime_fields/*"], "@kbn/safer-lodash-set": ["packages/kbn-safer-lodash-set"], "@kbn/safer-lodash-set/*": ["packages/kbn-safer-lodash-set/*"], + "@kbn/sample-task-plugin": ["x-pack/test/plugin_api_integration/plugins/sample_task_plugin"], + "@kbn/sample-task-plugin/*": ["x-pack/test/plugin_api_integration/plugins/sample_task_plugin/*"], + "@kbn/saved-object-export-transforms-plugin": ["test/plugin_functional/plugins/saved_object_export_transforms"], + "@kbn/saved-object-export-transforms-plugin/*": ["test/plugin_functional/plugins/saved_object_export_transforms/*"], + "@kbn/saved-object-import-warnings-plugin": ["test/plugin_functional/plugins/saved_object_import_warnings"], + "@kbn/saved-object-import-warnings-plugin/*": ["test/plugin_functional/plugins/saved_object_import_warnings/*"], + "@kbn/saved-objects-finder-plugin": ["src/plugins/saved_objects_finder"], + "@kbn/saved-objects-finder-plugin/*": ["src/plugins/saved_objects_finder/*"], + "@kbn/saved-objects-hidden-type-plugin": ["test/plugin_functional/plugins/saved_objects_hidden_type"], + "@kbn/saved-objects-hidden-type-plugin/*": ["test/plugin_functional/plugins/saved_objects_hidden_type/*"], + "@kbn/saved-objects-management-plugin": ["src/plugins/saved_objects_management"], + "@kbn/saved-objects-management-plugin/*": ["src/plugins/saved_objects_management/*"], + "@kbn/saved-objects-plugin": ["src/plugins/saved_objects"], + "@kbn/saved-objects-plugin/*": ["src/plugins/saved_objects/*"], + "@kbn/saved-objects-tagging-oss-plugin": ["src/plugins/saved_objects_tagging_oss"], + "@kbn/saved-objects-tagging-oss-plugin/*": ["src/plugins/saved_objects_tagging_oss/*"], + "@kbn/saved-objects-tagging-plugin": ["x-pack/plugins/saved_objects_tagging"], + "@kbn/saved-objects-tagging-plugin/*": ["x-pack/plugins/saved_objects_tagging/*"], + "@kbn/saved-search-plugin": ["src/plugins/saved_search"], + "@kbn/saved-search-plugin/*": ["src/plugins/saved_search/*"], + "@kbn/screenshot-mode-example-plugin": ["examples/screenshot_mode_example"], + "@kbn/screenshot-mode-example-plugin/*": ["examples/screenshot_mode_example/*"], + "@kbn/screenshot-mode-plugin": ["src/plugins/screenshot_mode"], + "@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"], + "@kbn/screenshotting-example-plugin": ["x-pack/examples/screenshotting_example"], + "@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"], + "@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"], + "@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"], + "@kbn/search-examples-plugin": ["examples/search_examples"], + "@kbn/search-examples-plugin/*": ["examples/search_examples/*"], + "@kbn/searchprofiler-plugin": ["x-pack/plugins/searchprofiler"], + "@kbn/searchprofiler-plugin/*": ["x-pack/plugins/searchprofiler/*"], + "@kbn/security-plugin": ["x-pack/plugins/security"], + "@kbn/security-plugin/*": ["x-pack/plugins/security/*"], + "@kbn/security-solution-plugin": ["x-pack/plugins/security_solution"], + "@kbn/security-solution-plugin/*": ["x-pack/plugins/security_solution/*"], + "@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/fixtures/common/test_endpoints"], + "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/fixtures/common/test_endpoints/*"], "@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"], "@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"], "@kbn/securitysolution-es-utils": ["packages/kbn-securitysolution-es-utils"], @@ -582,76 +978,28 @@ "@kbn/server-http-tools/*": ["packages/kbn-server-http-tools/*"], "@kbn/server-route-repository": ["packages/kbn-server-route-repository"], "@kbn/server-route-repository/*": ["packages/kbn-server-route-repository/*"], + "@kbn/session-notifications-plugin": ["test/plugin_functional/plugins/session_notifications"], + "@kbn/session-notifications-plugin/*": ["test/plugin_functional/plugins/session_notifications/*"], + "@kbn/session-view-plugin": ["x-pack/plugins/session_view"], + "@kbn/session-view-plugin/*": ["x-pack/plugins/session_view/*"], + "@kbn/share-examples-plugin": ["examples/share_examples"], + "@kbn/share-examples-plugin/*": ["examples/share_examples/*"], + "@kbn/share-plugin": ["src/plugins/share"], + "@kbn/share-plugin/*": ["src/plugins/share/*"], "@kbn/shared-svg": ["packages/kbn-shared-svg"], "@kbn/shared-svg/*": ["packages/kbn-shared-svg/*"], - "@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"], - "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], - "@kbn/some-dev-log": ["packages/kbn-some-dev-log"], - "@kbn/some-dev-log/*": ["packages/kbn-some-dev-log/*"], - "@kbn/sort-package-json": ["packages/kbn-sort-package-json"], - "@kbn/sort-package-json/*": ["packages/kbn-sort-package-json/*"], - "@kbn/spec-to-console": ["packages/kbn-spec-to-console"], - "@kbn/spec-to-console/*": ["packages/kbn-spec-to-console/*"], - "@kbn/std": ["packages/kbn-std"], - "@kbn/std/*": ["packages/kbn-std/*"], - "@kbn/stdio-dev-helpers": ["packages/kbn-stdio-dev-helpers"], - "@kbn/stdio-dev-helpers/*": ["packages/kbn-stdio-dev-helpers/*"], - "@kbn/storybook": ["packages/kbn-storybook"], - "@kbn/storybook/*": ["packages/kbn-storybook/*"], - "@kbn/synthetic-package-map": ["packages/kbn-synthetic-package-map"], - "@kbn/synthetic-package-map/*": ["packages/kbn-synthetic-package-map/*"], - "@kbn/telemetry-tools": ["packages/kbn-telemetry-tools"], - "@kbn/telemetry-tools/*": ["packages/kbn-telemetry-tools/*"], - "@kbn/test": ["packages/kbn-test"], - "@kbn/test/*": ["packages/kbn-test/*"], - "@kbn/test-jest-helpers": ["packages/kbn-test-jest-helpers"], - "@kbn/test-jest-helpers/*": ["packages/kbn-test-jest-helpers/*"], - "@kbn/test-subj-selector": ["packages/kbn-test-subj-selector"], - "@kbn/test-subj-selector/*": ["packages/kbn-test-subj-selector/*"], - "@kbn/timelion-grammar": ["packages/kbn-timelion-grammar"], - "@kbn/timelion-grammar/*": ["packages/kbn-timelion-grammar/*"], - "@kbn/tinymath": ["packages/kbn-tinymath"], - "@kbn/tinymath/*": ["packages/kbn-tinymath/*"], - "@kbn/tooling-log": ["packages/kbn-tooling-log"], - "@kbn/tooling-log/*": ["packages/kbn-tooling-log/*"], - "@kbn/type-summarizer": ["packages/kbn-type-summarizer"], - "@kbn/type-summarizer/*": ["packages/kbn-type-summarizer/*"], - "@kbn/type-summarizer-cli": ["packages/kbn-type-summarizer-cli"], - "@kbn/type-summarizer-cli/*": ["packages/kbn-type-summarizer-cli/*"], - "@kbn/type-summarizer-core": ["packages/kbn-type-summarizer-core"], - "@kbn/type-summarizer-core/*": ["packages/kbn-type-summarizer-core/*"], - "@kbn/typed-react-router-config": ["packages/kbn-typed-react-router-config"], - "@kbn/typed-react-router-config/*": ["packages/kbn-typed-react-router-config/*"], - "@kbn/ui-framework": ["packages/kbn-ui-framework"], - "@kbn/ui-framework/*": ["packages/kbn-ui-framework/*"], - "@kbn/ui-shared-deps-npm": ["packages/kbn-ui-shared-deps-npm"], - "@kbn/ui-shared-deps-npm/*": ["packages/kbn-ui-shared-deps-npm/*"], - "@kbn/ui-shared-deps-src": ["packages/kbn-ui-shared-deps-src"], - "@kbn/ui-shared-deps-src/*": ["packages/kbn-ui-shared-deps-src/*"], - "@kbn/ui-theme": ["packages/kbn-ui-theme"], - "@kbn/ui-theme/*": ["packages/kbn-ui-theme/*"], - "@kbn/user-profile-components": ["packages/kbn-user-profile-components"], - "@kbn/user-profile-components/*": ["packages/kbn-user-profile-components/*"], - "@kbn/utility-types": ["packages/kbn-utility-types"], - "@kbn/utility-types/*": ["packages/kbn-utility-types/*"], - "@kbn/utility-types-jest": ["packages/kbn-utility-types-jest"], - "@kbn/utility-types-jest/*": ["packages/kbn-utility-types-jest/*"], - "@kbn/utils": ["packages/kbn-utils"], - "@kbn/utils/*": ["packages/kbn-utils/*"], - "@kbn/yarn-lock-validator": ["packages/kbn-yarn-lock-validator"], - "@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"], "@kbn/shared-ux-avatar-solution": ["packages/shared-ux/avatar/solution"], "@kbn/shared-ux-avatar-solution/*": ["packages/shared-ux/avatar/solution/*"], "@kbn/shared-ux-avatar-user-profile-components": ["packages/shared-ux/avatar/user_profile/impl"], "@kbn/shared-ux-avatar-user-profile-components/*": ["packages/shared-ux/avatar/user_profile/impl/*"], - "@kbn/shared-ux-button-toolbar": ["packages/shared-ux/button_toolbar"], - "@kbn/shared-ux-button-toolbar/*": ["packages/shared-ux/button_toolbar/*"], "@kbn/shared-ux-button-exit-full-screen": ["packages/shared-ux/button/exit_full_screen/impl"], "@kbn/shared-ux-button-exit-full-screen/*": ["packages/shared-ux/button/exit_full_screen/impl/*"], "@kbn/shared-ux-button-exit-full-screen-mocks": ["packages/shared-ux/button/exit_full_screen/mocks"], "@kbn/shared-ux-button-exit-full-screen-mocks/*": ["packages/shared-ux/button/exit_full_screen/mocks/*"], "@kbn/shared-ux-button-exit-full-screen-types": ["packages/shared-ux/button/exit_full_screen/types"], "@kbn/shared-ux-button-exit-full-screen-types/*": ["packages/shared-ux/button/exit_full_screen/types/*"], + "@kbn/shared-ux-button-toolbar": ["packages/shared-ux/button_toolbar"], + "@kbn/shared-ux-button-toolbar/*": ["packages/shared-ux/button_toolbar/*"], "@kbn/shared-ux-card-no-data": ["packages/shared-ux/card/no_data/impl"], "@kbn/shared-ux-card-no-data/*": ["packages/shared-ux/card/no_data/impl/*"], "@kbn/shared-ux-card-no-data-mocks": ["packages/shared-ux/card/no_data/mocks"], @@ -660,18 +1008,18 @@ "@kbn/shared-ux-card-no-data-types/*": ["packages/shared-ux/card/no_data/types/*"], "@kbn/shared-ux-file-context": ["packages/shared-ux/file/context"], "@kbn/shared-ux-file-context/*": ["packages/shared-ux/file/context/*"], - "@kbn/shared-ux-file-picker": ["packages/shared-ux/file/file_picker/impl"], - "@kbn/shared-ux-file-picker/*": ["packages/shared-ux/file/file_picker/impl/*"], - "@kbn/shared-ux-file-upload": ["packages/shared-ux/file/file_upload/impl"], - "@kbn/shared-ux-file-upload/*": ["packages/shared-ux/file/file_upload/impl/*"], "@kbn/shared-ux-file-image": ["packages/shared-ux/file/image/impl"], "@kbn/shared-ux-file-image/*": ["packages/shared-ux/file/image/impl/*"], "@kbn/shared-ux-file-image-mocks": ["packages/shared-ux/file/image/mocks"], "@kbn/shared-ux-file-image-mocks/*": ["packages/shared-ux/file/image/mocks/*"], "@kbn/shared-ux-file-mocks": ["packages/shared-ux/file/mocks"], "@kbn/shared-ux-file-mocks/*": ["packages/shared-ux/file/mocks/*"], + "@kbn/shared-ux-file-picker": ["packages/shared-ux/file/file_picker/impl"], + "@kbn/shared-ux-file-picker/*": ["packages/shared-ux/file/file_picker/impl/*"], "@kbn/shared-ux-file-types": ["packages/shared-ux/file/types"], "@kbn/shared-ux-file-types/*": ["packages/shared-ux/file/types/*"], + "@kbn/shared-ux-file-upload": ["packages/shared-ux/file/file_upload/impl"], + "@kbn/shared-ux-file-upload/*": ["packages/shared-ux/file/file_upload/impl/*"], "@kbn/shared-ux-file-util": ["packages/shared-ux/file/util"], "@kbn/shared-ux-file-util/*": ["packages/shared-ux/file/util/*"], "@kbn/shared-ux-link-redirect-app": ["packages/shared-ux/link/redirect_app/impl"], @@ -704,14 +1052,14 @@ "@kbn/shared-ux-page-kibana-template-mocks/*": ["packages/shared-ux/page/kibana_template/mocks/*"], "@kbn/shared-ux-page-kibana-template-types": ["packages/shared-ux/page/kibana_template/types"], "@kbn/shared-ux-page-kibana-template-types/*": ["packages/shared-ux/page/kibana_template/types/*"], + "@kbn/shared-ux-page-no-data": ["packages/shared-ux/page/no_data/impl"], + "@kbn/shared-ux-page-no-data/*": ["packages/shared-ux/page/no_data/impl/*"], "@kbn/shared-ux-page-no-data-config": ["packages/shared-ux/page/no_data_config/impl"], "@kbn/shared-ux-page-no-data-config/*": ["packages/shared-ux/page/no_data_config/impl/*"], "@kbn/shared-ux-page-no-data-config-mocks": ["packages/shared-ux/page/no_data_config/mocks"], "@kbn/shared-ux-page-no-data-config-mocks/*": ["packages/shared-ux/page/no_data_config/mocks/*"], "@kbn/shared-ux-page-no-data-config-types": ["packages/shared-ux/page/no_data_config/types"], "@kbn/shared-ux-page-no-data-config-types/*": ["packages/shared-ux/page/no_data_config/types/*"], - "@kbn/shared-ux-page-no-data": ["packages/shared-ux/page/no_data/impl"], - "@kbn/shared-ux-page-no-data/*": ["packages/shared-ux/page/no_data/impl/*"], "@kbn/shared-ux-page-no-data-mocks": ["packages/shared-ux/page/no_data/mocks"], "@kbn/shared-ux-page-no-data-mocks/*": ["packages/shared-ux/page/no_data/mocks/*"], "@kbn/shared-ux-page-no-data-types": ["packages/shared-ux/page/no_data/types"], @@ -736,206 +1084,152 @@ "@kbn/shared-ux-storybook-config/*": ["packages/shared-ux/storybook/config/*"], "@kbn/shared-ux-storybook-mock": ["packages/shared-ux/storybook/mock"], "@kbn/shared-ux-storybook-mock/*": ["packages/shared-ux/storybook/mock/*"], - "@kbn/ml-agg-utils": ["x-pack/packages/ml/agg_utils"], - "@kbn/ml-agg-utils/*": ["x-pack/packages/ml/agg_utils/*"], - "@kbn/aiops-components": ["x-pack/packages/ml/aiops_components"], - "@kbn/aiops-components/*": ["x-pack/packages/ml/aiops_components/*"], - "@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"], - "@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"], - "@kbn/ml-is-populated-object": ["x-pack/packages/ml/is_populated_object"], - "@kbn/ml-is-populated-object/*": ["x-pack/packages/ml/is_populated_object/*"], - "@kbn/ml-string-hash": ["x-pack/packages/ml/string_hash"], - "@kbn/ml-string-hash/*": ["x-pack/packages/ml/string_hash/*"], - "@kbn/bfetch-explorer-plugin": ["examples/bfetch_explorer"], - "@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"], - "@kbn/controls-example-plugin": ["examples/controls_example"], - "@kbn/controls-example-plugin/*": ["examples/controls_example/*"], - "@kbn/dashboard-embeddable-examples-plugin": ["examples/dashboard_embeddable_examples"], - "@kbn/dashboard-embeddable-examples-plugin/*": ["examples/dashboard_embeddable_examples/*"], - "@kbn/data-view-field-editor-example-plugin": ["examples/data_view_field_editor_example"], - "@kbn/data-view-field-editor-example-plugin/*": ["examples/data_view_field_editor_example/*"], - "@kbn/developer-examples-plugin": ["examples/developer_examples"], - "@kbn/developer-examples-plugin/*": ["examples/developer_examples/*"], - "@kbn/embeddable-examples-plugin": ["examples/embeddable_examples"], - "@kbn/embeddable-examples-plugin/*": ["examples/embeddable_examples/*"], - "@kbn/embeddable-explorer-plugin": ["examples/embeddable_explorer"], - "@kbn/embeddable-explorer-plugin/*": ["examples/embeddable_explorer/*"], - "@kbn/expressions-explorer-plugin": ["examples/expressions_explorer"], - "@kbn/expressions-explorer-plugin/*": ["examples/expressions_explorer/*"], - "@kbn/field-formats-example-plugin": ["examples/field_formats_example"], - "@kbn/field-formats-example-plugin/*": ["examples/field_formats_example/*"], - "@kbn/files-example-plugin": ["examples/files_example"], - "@kbn/files-example-plugin/*": ["examples/files_example/*"], - "@kbn/guided-onboarding-example-plugin": ["examples/guided_onboarding_example"], - "@kbn/guided-onboarding-example-plugin/*": ["examples/guided_onboarding_example/*"], - "@kbn/hello-world-plugin": ["examples/hello_world"], - "@kbn/hello-world-plugin/*": ["examples/hello_world/*"], - "@kbn/locator-examples-plugin": ["examples/locator_examples"], - "@kbn/locator-examples-plugin/*": ["examples/locator_examples/*"], - "@kbn/locator-explorer-plugin": ["examples/locator_explorer"], - "@kbn/locator-explorer-plugin/*": ["examples/locator_explorer/*"], - "@kbn/paertial-results-example-plugin": ["examples/partial_results_example"], - "@kbn/paertial-results-example-plugin/*": ["examples/partial_results_example/*"], - "@kbn/preboot-example-plugin": ["examples/preboot_example"], - "@kbn/preboot-example-plugin/*": ["examples/preboot_example/*"], - "@kbn/response-stream-plugin": ["examples/response_stream"], - "@kbn/response-stream-plugin/*": ["examples/response_stream/*"], - "@kbn/routing-example-plugin": ["examples/routing_example"], - "@kbn/routing-example-plugin/*": ["examples/routing_example/*"], - "@kbn/screenshot-mode-example-plugin": ["examples/screenshot_mode_example"], - "@kbn/screenshot-mode-example-plugin/*": ["examples/screenshot_mode_example/*"], - "@kbn/search-examples-plugin": ["examples/search_examples"], - "@kbn/search-examples-plugin/*": ["examples/search_examples/*"], - "@kbn/share-examples-plugin": ["examples/share_examples"], - "@kbn/share-examples-plugin/*": ["examples/share_examples/*"], + "@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"], + "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], + "@kbn/snapshot-restore-plugin": ["x-pack/plugins/snapshot_restore"], + "@kbn/snapshot-restore-plugin/*": ["x-pack/plugins/snapshot_restore/*"], + "@kbn/some-dev-log": ["packages/kbn-some-dev-log"], + "@kbn/some-dev-log/*": ["packages/kbn-some-dev-log/*"], + "@kbn/sort-package-json": ["packages/kbn-sort-package-json"], + "@kbn/sort-package-json/*": ["packages/kbn-sort-package-json/*"], + "@kbn/spaces-plugin": ["x-pack/plugins/spaces"], + "@kbn/spaces-plugin/*": ["x-pack/plugins/spaces/*"], + "@kbn/spec-to-console": ["packages/kbn-spec-to-console"], + "@kbn/spec-to-console/*": ["packages/kbn-spec-to-console/*"], + "@kbn/stack-alerts-plugin": ["x-pack/plugins/stack_alerts"], + "@kbn/stack-alerts-plugin/*": ["x-pack/plugins/stack_alerts/*"], + "@kbn/stack-connectors-plugin": ["x-pack/plugins/stack_connectors"], + "@kbn/stack-connectors-plugin/*": ["x-pack/plugins/stack_connectors/*"], + "@kbn/stack-management-usage-test-plugin": ["x-pack/test/usage_collection/plugins/stack_management_usage_test"], + "@kbn/stack-management-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/stack_management_usage_test/*"], "@kbn/state-containers-examples-plugin": ["examples/state_containers_examples"], "@kbn/state-containers-examples-plugin/*": ["examples/state_containers_examples/*"], - "@kbn/ui-actions-examples-plugin": ["examples/ui_action_examples"], - "@kbn/ui-actions-examples-plugin/*": ["examples/ui_action_examples/*"], - "@kbn/ui-actions-explorer-plugin": ["examples/ui_actions_explorer"], - "@kbn/ui-actions-explorer-plugin/*": ["examples/ui_actions_explorer/*"], - "@kbn/user-profile-examples-plugin": ["examples/user_profile_examples"], - "@kbn/user-profile-examples-plugin/*": ["examples/user_profile_examples/*"], - "@kbn/advanced-settings-plugin": ["src/plugins/advanced_settings"], - "@kbn/advanced-settings-plugin/*": ["src/plugins/advanced_settings/*"], - "@kbn/bfetch-plugin": ["src/plugins/bfetch"], - "@kbn/bfetch-plugin/*": ["src/plugins/bfetch/*"], - "@kbn/expression-gauge-plugin": ["src/plugins/chart_expressions/expression_gauge"], - "@kbn/expression-gauge-plugin/*": ["src/plugins/chart_expressions/expression_gauge/*"], - "@kbn/expression-heatmap-plugin": ["src/plugins/chart_expressions/expression_heatmap"], - "@kbn/expression-heatmap-plugin/*": ["src/plugins/chart_expressions/expression_heatmap/*"], - "@kbn/expression-legacy-metric-vis-plugin": ["src/plugins/chart_expressions/expression_legacy_metric"], - "@kbn/expression-legacy-metric-vis-plugin/*": ["src/plugins/chart_expressions/expression_legacy_metric/*"], - "@kbn/expression-metric-vis-plugin": ["src/plugins/chart_expressions/expression_metric"], - "@kbn/expression-metric-vis-plugin/*": ["src/plugins/chart_expressions/expression_metric/*"], - "@kbn/expression-partition-vis-plugin": ["src/plugins/chart_expressions/expression_partition_vis"], - "@kbn/expression-partition-vis-plugin/*": ["src/plugins/chart_expressions/expression_partition_vis/*"], - "@kbn/expression-tagcloud-plugin": ["src/plugins/chart_expressions/expression_tagcloud"], - "@kbn/expression-tagcloud-plugin/*": ["src/plugins/chart_expressions/expression_tagcloud/*"], - "@kbn/expression-xy-plugin": ["src/plugins/chart_expressions/expression_xy"], - "@kbn/expression-xy-plugin/*": ["src/plugins/chart_expressions/expression_xy/*"], - "@kbn/charts-plugin": ["src/plugins/charts"], - "@kbn/charts-plugin/*": ["src/plugins/charts/*"], - "@kbn/console-plugin": ["src/plugins/console"], - "@kbn/console-plugin/*": ["src/plugins/console/*"], - "@kbn/controls-plugin": ["src/plugins/controls"], - "@kbn/controls-plugin/*": ["src/plugins/controls/*"], - "@kbn/custom-integrations-plugin": ["src/plugins/custom_integrations"], - "@kbn/custom-integrations-plugin/*": ["src/plugins/custom_integrations/*"], - "@kbn/dashboard-plugin": ["src/plugins/dashboard"], - "@kbn/dashboard-plugin/*": ["src/plugins/dashboard/*"], - "@kbn/data-view-editor-plugin": ["src/plugins/data_view_editor"], - "@kbn/data-view-editor-plugin/*": ["src/plugins/data_view_editor/*"], - "@kbn/data-view-field-editor-plugin": ["src/plugins/data_view_field_editor"], - "@kbn/data-view-field-editor-plugin/*": ["src/plugins/data_view_field_editor/*"], - "@kbn/data-view-management-plugin": ["src/plugins/data_view_management"], - "@kbn/data-view-management-plugin/*": ["src/plugins/data_view_management/*"], - "@kbn/data-views-plugin": ["src/plugins/data_views"], - "@kbn/data-views-plugin/*": ["src/plugins/data_views/*"], - "@kbn/data-plugin": ["src/plugins/data"], - "@kbn/data-plugin/*": ["src/plugins/data/*"], - "@kbn/dev-tools-plugin": ["src/plugins/dev_tools"], - "@kbn/dev-tools-plugin/*": ["src/plugins/dev_tools/*"], - "@kbn/discover-plugin": ["src/plugins/discover"], - "@kbn/discover-plugin/*": ["src/plugins/discover/*"], - "@kbn/embeddable-plugin": ["src/plugins/embeddable"], - "@kbn/embeddable-plugin/*": ["src/plugins/embeddable/*"], - "@kbn/es-ui-shared-plugin": ["src/plugins/es_ui_shared"], - "@kbn/es-ui-shared-plugin/*": ["src/plugins/es_ui_shared/*"], - "@kbn/event-annotation-plugin": ["src/plugins/event_annotation"], - "@kbn/event-annotation-plugin/*": ["src/plugins/event_annotation/*"], - "@kbn/expression-error-plugin": ["src/plugins/expression_error"], - "@kbn/expression-error-plugin/*": ["src/plugins/expression_error/*"], - "@kbn/expression-image-plugin": ["src/plugins/expression_image"], - "@kbn/expression-image-plugin/*": ["src/plugins/expression_image/*"], - "@kbn/expression-metric-plugin": ["src/plugins/expression_metric"], - "@kbn/expression-metric-plugin/*": ["src/plugins/expression_metric/*"], - "@kbn/expression-repeat-image-plugin": ["src/plugins/expression_repeat_image"], - "@kbn/expression-repeat-image-plugin/*": ["src/plugins/expression_repeat_image/*"], - "@kbn/expression-reveal-image-plugin": ["src/plugins/expression_reveal_image"], - "@kbn/expression-reveal-image-plugin/*": ["src/plugins/expression_reveal_image/*"], - "@kbn/expression-shape-plugin": ["src/plugins/expression_shape"], - "@kbn/expression-shape-plugin/*": ["src/plugins/expression_shape/*"], - "@kbn/expressions-plugin": ["src/plugins/expressions"], - "@kbn/expressions-plugin/*": ["src/plugins/expressions/*"], - "@kbn/field-formats-plugin": ["src/plugins/field_formats"], - "@kbn/field-formats-plugin/*": ["src/plugins/field_formats/*"], - "@kbn/files-management-plugin": ["src/plugins/files_management"], - "@kbn/files-management-plugin/*": ["src/plugins/files_management/*"], - "@kbn/files-plugin": ["src/plugins/files"], - "@kbn/files-plugin/*": ["src/plugins/files/*"], - "@kbn/guided-onboarding-plugin": ["src/plugins/guided_onboarding"], - "@kbn/guided-onboarding-plugin/*": ["src/plugins/guided_onboarding/*"], - "@kbn/home-plugin": ["src/plugins/home"], - "@kbn/home-plugin/*": ["src/plugins/home/*"], - "@kbn/image-embeddable-plugin": ["src/plugins/image_embeddable"], - "@kbn/image-embeddable-plugin/*": ["src/plugins/image_embeddable/*"], - "@kbn/input-control-vis-plugin": ["src/plugins/input_control_vis"], - "@kbn/input-control-vis-plugin/*": ["src/plugins/input_control_vis/*"], - "@kbn/inspector-plugin": ["src/plugins/inspector"], - "@kbn/inspector-plugin/*": ["src/plugins/inspector/*"], - "@kbn/interactive-setup-plugin": ["src/plugins/interactive_setup"], - "@kbn/interactive-setup-plugin/*": ["src/plugins/interactive_setup/*"], - "@kbn/kibana-overview-plugin": ["src/plugins/kibana_overview"], - "@kbn/kibana-overview-plugin/*": ["src/plugins/kibana_overview/*"], - "@kbn/kibana-react-plugin": ["src/plugins/kibana_react"], - "@kbn/kibana-react-plugin/*": ["src/plugins/kibana_react/*"], - "@kbn/kibana-usage-collection-plugin": ["src/plugins/kibana_usage_collection"], - "@kbn/kibana-usage-collection-plugin/*": ["src/plugins/kibana_usage_collection/*"], - "@kbn/kibana-utils-plugin": ["src/plugins/kibana_utils"], - "@kbn/kibana-utils-plugin/*": ["src/plugins/kibana_utils/*"], - "@kbn/management-plugin": ["src/plugins/management"], - "@kbn/management-plugin/*": ["src/plugins/management/*"], - "@kbn/maps-ems-plugin": ["src/plugins/maps_ems"], - "@kbn/maps-ems-plugin/*": ["src/plugins/maps_ems/*"], - "@kbn/navigation-plugin": ["src/plugins/navigation"], - "@kbn/navigation-plugin/*": ["src/plugins/navigation/*"], - "@kbn/newsfeed-plugin": ["src/plugins/newsfeed"], - "@kbn/newsfeed-plugin/*": ["src/plugins/newsfeed/*"], - "@kbn/presentation-util-plugin": ["src/plugins/presentation_util"], - "@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"], - "@kbn/saved-objects-finder-plugin": ["src/plugins/saved_objects_finder"], - "@kbn/saved-objects-finder-plugin/*": ["src/plugins/saved_objects_finder/*"], - "@kbn/saved-objects-management-plugin": ["src/plugins/saved_objects_management"], - "@kbn/saved-objects-management-plugin/*": ["src/plugins/saved_objects_management/*"], - "@kbn/saved-objects-tagging-oss-plugin": ["src/plugins/saved_objects_tagging_oss"], - "@kbn/saved-objects-tagging-oss-plugin/*": ["src/plugins/saved_objects_tagging_oss/*"], - "@kbn/saved-objects-plugin": ["src/plugins/saved_objects"], - "@kbn/saved-objects-plugin/*": ["src/plugins/saved_objects/*"], - "@kbn/saved-search-plugin": ["src/plugins/saved_search"], - "@kbn/saved-search-plugin/*": ["src/plugins/saved_search/*"], - "@kbn/screenshot-mode-plugin": ["src/plugins/screenshot_mode"], - "@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"], - "@kbn/share-plugin": ["src/plugins/share"], - "@kbn/share-plugin/*": ["src/plugins/share/*"], + "@kbn/status-plugin-a-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_a"], + "@kbn/status-plugin-a-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_a/*"], + "@kbn/status-plugin-b-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_b"], + "@kbn/status-plugin-b-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_b/*"], + "@kbn/std": ["packages/kbn-std"], + "@kbn/std/*": ["packages/kbn-std/*"], + "@kbn/stdio-dev-helpers": ["packages/kbn-stdio-dev-helpers"], + "@kbn/stdio-dev-helpers/*": ["packages/kbn-stdio-dev-helpers/*"], + "@kbn/storybook": ["packages/kbn-storybook"], + "@kbn/storybook/*": ["packages/kbn-storybook/*"], + "@kbn/synthetics-plugin": ["x-pack/plugins/synthetics"], + "@kbn/synthetics-plugin/*": ["x-pack/plugins/synthetics/*"], + "@kbn/task-manager-performance-plugin": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance"], + "@kbn/task-manager-performance-plugin/*": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance/*"], + "@kbn/task-manager-plugin": ["x-pack/plugins/task_manager"], + "@kbn/task-manager-plugin/*": ["x-pack/plugins/task_manager/*"], "@kbn/telemetry-collection-manager-plugin": ["src/plugins/telemetry_collection_manager"], "@kbn/telemetry-collection-manager-plugin/*": ["src/plugins/telemetry_collection_manager/*"], + "@kbn/telemetry-collection-xpack-plugin": ["x-pack/plugins/telemetry_collection_xpack"], + "@kbn/telemetry-collection-xpack-plugin/*": ["x-pack/plugins/telemetry_collection_xpack/*"], "@kbn/telemetry-management-section-plugin": ["src/plugins/telemetry_management_section"], "@kbn/telemetry-management-section-plugin/*": ["src/plugins/telemetry_management_section/*"], "@kbn/telemetry-plugin": ["src/plugins/telemetry"], "@kbn/telemetry-plugin/*": ["src/plugins/telemetry/*"], + "@kbn/telemetry-test-plugin": ["test/plugin_functional/plugins/telemetry"], + "@kbn/telemetry-test-plugin/*": ["test/plugin_functional/plugins/telemetry/*"], + "@kbn/telemetry-tools": ["packages/kbn-telemetry-tools"], + "@kbn/telemetry-tools/*": ["packages/kbn-telemetry-tools/*"], + "@kbn/test": ["packages/kbn-test"], + "@kbn/test/*": ["packages/kbn-test/*"], + "@kbn/test-feature-usage-plugin": ["x-pack/test/licensing_plugin/plugins/test_feature_usage"], + "@kbn/test-feature-usage-plugin/*": ["x-pack/test/licensing_plugin/plugins/test_feature_usage/*"], + "@kbn/test-jest-helpers": ["packages/kbn-test-jest-helpers"], + "@kbn/test-jest-helpers/*": ["packages/kbn-test-jest-helpers/*"], + "@kbn/test-subj-selector": ["packages/kbn-test-subj-selector"], + "@kbn/test-subj-selector/*": ["packages/kbn-test-subj-selector/*"], + "@kbn/testing-embedded-lens-plugin": ["x-pack/examples/testing_embedded_lens"], + "@kbn/testing-embedded-lens-plugin/*": ["x-pack/examples/testing_embedded_lens/*"], + "@kbn/third-party-lens-navigation-prompt-plugin": ["x-pack/examples/third_party_lens_navigation_prompt"], + "@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"], + "@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"], + "@kbn/third-party-vis-lens-example-plugin/*": ["x-pack/examples/third_party_vis_lens_example/*"], + "@kbn/threat-intelligence-plugin": ["x-pack/plugins/threat_intelligence"], + "@kbn/threat-intelligence-plugin/*": ["x-pack/plugins/threat_intelligence/*"], + "@kbn/timelines-plugin": ["x-pack/plugins/timelines"], + "@kbn/timelines-plugin/*": ["x-pack/plugins/timelines/*"], + "@kbn/timelion-grammar": ["packages/kbn-timelion-grammar"], + "@kbn/timelion-grammar/*": ["packages/kbn-timelion-grammar/*"], + "@kbn/tinymath": ["packages/kbn-tinymath"], + "@kbn/tinymath/*": ["packages/kbn-tinymath/*"], + "@kbn/tooling-log": ["packages/kbn-tooling-log"], + "@kbn/tooling-log/*": ["packages/kbn-tooling-log/*"], + "@kbn/transform-plugin": ["x-pack/plugins/transform"], + "@kbn/transform-plugin/*": ["x-pack/plugins/transform/*"], + "@kbn/translations-plugin": ["x-pack/plugins/translations"], + "@kbn/translations-plugin/*": ["x-pack/plugins/translations/*"], + "@kbn/triggers-actions-ui-example-plugin": ["x-pack/examples/triggers_actions_ui_example"], + "@kbn/triggers-actions-ui-example-plugin/*": ["x-pack/examples/triggers_actions_ui_example/*"], + "@kbn/triggers-actions-ui-plugin": ["x-pack/plugins/triggers_actions_ui"], + "@kbn/triggers-actions-ui-plugin/*": ["x-pack/plugins/triggers_actions_ui/*"], + "@kbn/ts-project-linter": ["packages/kbn-ts-project-linter"], + "@kbn/ts-project-linter/*": ["packages/kbn-ts-project-linter/*"], + "@kbn/ts-project-linter-cli": ["packages/kbn-ts-project-linter-cli"], + "@kbn/ts-project-linter-cli/*": ["packages/kbn-ts-project-linter-cli/*"], + "@kbn/ts-projects": ["packages/kbn-ts-projects"], + "@kbn/ts-projects/*": ["packages/kbn-ts-projects/*"], + "@kbn/ts-type-check-cli": ["packages/kbn-ts-type-check-cli"], + "@kbn/ts-type-check-cli/*": ["packages/kbn-ts-type-check-cli/*"], + "@kbn/typed-react-router-config": ["packages/kbn-typed-react-router-config"], + "@kbn/typed-react-router-config/*": ["packages/kbn-typed-react-router-config/*"], + "@kbn/ui-actions-enhanced-examples-plugin": ["x-pack/examples/ui_actions_enhanced_examples"], + "@kbn/ui-actions-enhanced-examples-plugin/*": ["x-pack/examples/ui_actions_enhanced_examples/*"], "@kbn/ui-actions-enhanced-plugin": ["src/plugins/ui_actions_enhanced"], "@kbn/ui-actions-enhanced-plugin/*": ["src/plugins/ui_actions_enhanced/*"], + "@kbn/ui-actions-examples-plugin": ["examples/ui_action_examples"], + "@kbn/ui-actions-examples-plugin/*": ["examples/ui_action_examples/*"], + "@kbn/ui-actions-explorer-plugin": ["examples/ui_actions_explorer"], + "@kbn/ui-actions-explorer-plugin/*": ["examples/ui_actions_explorer/*"], "@kbn/ui-actions-plugin": ["src/plugins/ui_actions"], "@kbn/ui-actions-plugin/*": ["src/plugins/ui_actions/*"], + "@kbn/ui-framework": ["packages/kbn-ui-framework"], + "@kbn/ui-framework/*": ["packages/kbn-ui-framework/*"], + "@kbn/ui-settings-plugin": ["test/plugin_functional/plugins/ui_settings_plugin"], + "@kbn/ui-settings-plugin/*": ["test/plugin_functional/plugins/ui_settings_plugin/*"], + "@kbn/ui-shared-deps-npm": ["packages/kbn-ui-shared-deps-npm"], + "@kbn/ui-shared-deps-npm/*": ["packages/kbn-ui-shared-deps-npm/*"], + "@kbn/ui-shared-deps-src": ["packages/kbn-ui-shared-deps-src"], + "@kbn/ui-shared-deps-src/*": ["packages/kbn-ui-shared-deps-src/*"], + "@kbn/ui-theme": ["packages/kbn-ui-theme"], + "@kbn/ui-theme/*": ["packages/kbn-ui-theme/*"], "@kbn/unified-field-list-plugin": ["src/plugins/unified_field_list"], "@kbn/unified-field-list-plugin/*": ["src/plugins/unified_field_list/*"], "@kbn/unified-histogram-plugin": ["src/plugins/unified_histogram"], "@kbn/unified-histogram-plugin/*": ["src/plugins/unified_histogram/*"], "@kbn/unified-search-plugin": ["src/plugins/unified_search"], "@kbn/unified-search-plugin/*": ["src/plugins/unified_search/*"], + "@kbn/upgrade-assistant-plugin": ["x-pack/plugins/upgrade_assistant"], + "@kbn/upgrade-assistant-plugin/*": ["x-pack/plugins/upgrade_assistant/*"], + "@kbn/url-drilldown-plugin": ["x-pack/plugins/drilldowns/url_drilldown"], + "@kbn/url-drilldown-plugin/*": ["x-pack/plugins/drilldowns/url_drilldown/*"], "@kbn/url-forwarding-plugin": ["src/plugins/url_forwarding"], "@kbn/url-forwarding-plugin/*": ["src/plugins/url_forwarding/*"], "@kbn/usage-collection-plugin": ["src/plugins/usage_collection"], "@kbn/usage-collection-plugin/*": ["src/plugins/usage_collection/*"], + "@kbn/usage-collection-test-plugin": ["test/plugin_functional/plugins/usage_collection"], + "@kbn/usage-collection-test-plugin/*": ["test/plugin_functional/plugins/usage_collection/*"], + "@kbn/user-profile-components": ["packages/kbn-user-profile-components"], + "@kbn/user-profile-components/*": ["packages/kbn-user-profile-components/*"], + "@kbn/user-profile-examples-plugin": ["examples/user_profile_examples"], + "@kbn/user-profile-examples-plugin/*": ["examples/user_profile_examples/*"], + "@kbn/utility-types": ["packages/kbn-utility-types"], + "@kbn/utility-types/*": ["packages/kbn-utility-types/*"], + "@kbn/utility-types-jest": ["packages/kbn-utility-types-jest"], + "@kbn/utility-types-jest/*": ["packages/kbn-utility-types-jest/*"], + "@kbn/utils": ["packages/kbn-utils"], + "@kbn/utils/*": ["packages/kbn-utils/*"], + "@kbn/ux-plugin": ["x-pack/plugins/ux"], + "@kbn/ux-plugin/*": ["x-pack/plugins/ux/*"], "@kbn/vis-default-editor-plugin": ["src/plugins/vis_default_editor"], "@kbn/vis-default-editor-plugin/*": ["src/plugins/vis_default_editor/*"], - "@kbn/vis-type-markdown-plugin": ["src/plugins/vis_type_markdown"], - "@kbn/vis-type-markdown-plugin/*": ["src/plugins/vis_type_markdown/*"], "@kbn/vis-type-gauge-plugin": ["src/plugins/vis_types/gauge"], "@kbn/vis-type-gauge-plugin/*": ["src/plugins/vis_types/gauge/*"], "@kbn/vis-type-heatmap-plugin": ["src/plugins/vis_types/heatmap"], "@kbn/vis-type-heatmap-plugin/*": ["src/plugins/vis_types/heatmap/*"], + "@kbn/vis-type-markdown-plugin": ["src/plugins/vis_type_markdown"], + "@kbn/vis-type-markdown-plugin/*": ["src/plugins/vis_type_markdown/*"], "@kbn/vis-type-metric-plugin": ["src/plugins/vis_types/metric"], "@kbn/vis-type-metric-plugin/*": ["src/plugins/vis_types/metric/*"], "@kbn/vis-type-pie-plugin": ["src/plugins/vis_types/pie"], @@ -956,292 +1250,12 @@ "@kbn/vis-type-xy-plugin/*": ["src/plugins/vis_types/xy/*"], "@kbn/visualizations-plugin": ["src/plugins/visualizations"], "@kbn/visualizations-plugin/*": ["src/plugins/visualizations/*"], - "@kbn/analytics-ftr-helpers-plugin": ["test/analytics/fixtures/plugins/analytics_ftr_helpers"], - "@kbn/analytics-ftr-helpers-plugin/*": ["test/analytics/fixtures/plugins/analytics_ftr_helpers/*"], - "@kbn/analytics-plugin-a-plugin": ["test/analytics/fixtures/plugins/analytics_plugin_a"], - "@kbn/analytics-plugin-a-plugin/*": ["test/analytics/fixtures/plugins/analytics_plugin_a/*"], - "@kbn/coverage-fixtures-plugin": ["test/common/fixtures/plugins/coverage"], - "@kbn/coverage-fixtures-plugin/*": ["test/common/fixtures/plugins/coverage/*"], - "@kbn/newsfeed-fixtures-plugin": ["test/common/fixtures/plugins/newsfeed"], - "@kbn/newsfeed-fixtures-plugin/*": ["test/common/fixtures/plugins/newsfeed/*"], - "@kbn/open-telemetry-instrumented-plugin": ["test/common/fixtures/plugins/otel_metrics"], - "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/fixtures/plugins/otel_metrics/*"], - "@kbn/kbn-health-gateway-status-plugin": ["test/health_gateway/plugins/status"], - "@kbn/kbn-health-gateway-status-plugin/*": ["test/health_gateway/plugins/status/*"], - "@kbn/kbn-tp-run-pipeline-plugin": ["test/interpreter_functional/plugins/kbn_tp_run_pipeline"], - "@kbn/kbn-tp-run-pipeline-plugin/*": ["test/interpreter_functional/plugins/kbn_tp_run_pipeline/*"], - "@kbn/app-link-test-plugin": ["test/plugin_functional/plugins/app_link_test"], - "@kbn/app-link-test-plugin/*": ["test/plugin_functional/plugins/app_link_test/*"], - "@kbn/core-app-status-plugin": ["test/plugin_functional/plugins/core_app_status"], - "@kbn/core-app-status-plugin/*": ["test/plugin_functional/plugins/core_app_status/*"], - "@kbn/core-history-block-plugin": ["test/plugin_functional/plugins/core_history_block"], - "@kbn/core-history-block-plugin/*": ["test/plugin_functional/plugins/core_history_block/*"], - "@kbn/core-http-plugin": ["test/plugin_functional/plugins/core_http"], - "@kbn/core-http-plugin/*": ["test/plugin_functional/plugins/core_http/*"], - "@kbn/core-plugin-a-plugin": ["test/plugin_functional/plugins/core_plugin_a"], - "@kbn/core-plugin-a-plugin/*": ["test/plugin_functional/plugins/core_plugin_a/*"], - "@kbn/core-plugin-appleave-plugin": ["test/plugin_functional/plugins/core_plugin_appleave"], - "@kbn/core-plugin-appleave-plugin/*": ["test/plugin_functional/plugins/core_plugin_appleave/*"], - "@kbn/core-plugin-b-plugin": ["test/plugin_functional/plugins/core_plugin_b"], - "@kbn/core-plugin-b-plugin/*": ["test/plugin_functional/plugins/core_plugin_b/*"], - "@kbn/core-plugin-chromeless-plugin": ["test/plugin_functional/plugins/core_plugin_chromeless"], - "@kbn/core-plugin-chromeless-plugin/*": ["test/plugin_functional/plugins/core_plugin_chromeless/*"], - "@kbn/core-plugin-deep-links-plugin": ["test/plugin_functional/plugins/core_plugin_deep_links"], - "@kbn/core-plugin-deep-links-plugin/*": ["test/plugin_functional/plugins/core_plugin_deep_links/*"], - "@kbn/core-plugin-deprecations-plugin": ["test/plugin_functional/plugins/core_plugin_deprecations"], - "@kbn/core-plugin-deprecations-plugin/*": ["test/plugin_functional/plugins/core_plugin_deprecations/*"], - "@kbn/core-plugin-execution-context-plugin": ["test/plugin_functional/plugins/core_plugin_execution_context"], - "@kbn/core-plugin-execution-context-plugin/*": ["test/plugin_functional/plugins/core_plugin_execution_context/*"], - "@kbn/core-plugin-helpmenu-plugin": ["test/plugin_functional/plugins/core_plugin_helpmenu"], - "@kbn/core-plugin-helpmenu-plugin/*": ["test/plugin_functional/plugins/core_plugin_helpmenu/*"], - "@kbn/core-plugin-route-timeouts-plugin": ["test/plugin_functional/plugins/core_plugin_route_timeouts"], - "@kbn/core-plugin-route-timeouts-plugin/*": ["test/plugin_functional/plugins/core_plugin_route_timeouts/*"], - "@kbn/core-plugin-static-assets-plugin": ["test/plugin_functional/plugins/core_plugin_static_assets"], - "@kbn/core-plugin-static-assets-plugin/*": ["test/plugin_functional/plugins/core_plugin_static_assets/*"], - "@kbn/core-provider-plugin": ["test/plugin_functional/plugins/core_provider_plugin"], - "@kbn/core-provider-plugin/*": ["test/plugin_functional/plugins/core_provider_plugin/*"], - "@kbn/data-search-plugin": ["test/plugin_functional/plugins/data_search"], - "@kbn/data-search-plugin/*": ["test/plugin_functional/plugins/data_search/*"], - "@kbn/elasticsearch-client-plugin": ["test/plugin_functional/plugins/elasticsearch_client_plugin"], - "@kbn/elasticsearch-client-plugin/*": ["test/plugin_functional/plugins/elasticsearch_client_plugin/*"], - "@kbn/index-patterns-test-plugin": ["test/plugin_functional/plugins/index_patterns"], - "@kbn/index-patterns-test-plugin/*": ["test/plugin_functional/plugins/index_patterns/*"], - "@kbn/kbn-sample-panel-action-plugin": ["test/plugin_functional/plugins/kbn_sample_panel_action"], - "@kbn/kbn-sample-panel-action-plugin/*": ["test/plugin_functional/plugins/kbn_sample_panel_action/*"], - "@kbn/kbn-top-nav-plugin": ["test/plugin_functional/plugins/kbn_top_nav"], - "@kbn/kbn-top-nav-plugin/*": ["test/plugin_functional/plugins/kbn_top_nav/*"], - "@kbn/kbn-tp-custom-visualizations-plugin": ["test/plugin_functional/plugins/kbn_tp_custom_visualizations"], - "@kbn/kbn-tp-custom-visualizations-plugin/*": ["test/plugin_functional/plugins/kbn_tp_custom_visualizations/*"], - "@kbn/management-test-plugin": ["test/plugin_functional/plugins/management_test_plugin"], - "@kbn/management-test-plugin/*": ["test/plugin_functional/plugins/management_test_plugin/*"], - "@kbn/rendering-plugin": ["test/plugin_functional/plugins/rendering_plugin"], - "@kbn/rendering-plugin/*": ["test/plugin_functional/plugins/rendering_plugin/*"], - "@kbn/saved-object-export-transforms-plugin": ["test/plugin_functional/plugins/saved_object_export_transforms"], - "@kbn/saved-object-export-transforms-plugin/*": ["test/plugin_functional/plugins/saved_object_export_transforms/*"], - "@kbn/saved-object-import-warnings-plugin": ["test/plugin_functional/plugins/saved_object_import_warnings"], - "@kbn/saved-object-import-warnings-plugin/*": ["test/plugin_functional/plugins/saved_object_import_warnings/*"], - "@kbn/saved-objects-hidden-type-plugin": ["test/plugin_functional/plugins/saved_objects_hidden_type"], - "@kbn/saved-objects-hidden-type-plugin/*": ["test/plugin_functional/plugins/saved_objects_hidden_type/*"], - "@kbn/session-notifications-plugin": ["test/plugin_functional/plugins/session_notifications"], - "@kbn/session-notifications-plugin/*": ["test/plugin_functional/plugins/session_notifications/*"], - "@kbn/telemetry-test-plugin": ["test/plugin_functional/plugins/telemetry"], - "@kbn/telemetry-test-plugin/*": ["test/plugin_functional/plugins/telemetry/*"], - "@kbn/ui-settings-plugin": ["test/plugin_functional/plugins/ui_settings_plugin"], - "@kbn/ui-settings-plugin/*": ["test/plugin_functional/plugins/ui_settings_plugin/*"], - "@kbn/usage-collection-test-plugin": ["test/plugin_functional/plugins/usage_collection"], - "@kbn/usage-collection-test-plugin/*": ["test/plugin_functional/plugins/usage_collection/*"], - "@kbn/status-plugin-a-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_a"], - "@kbn/status-plugin-a-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_a/*"], - "@kbn/status-plugin-b-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_b"], - "@kbn/status-plugin-b-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_b/*"], - "@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"], - "@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"], - "@kbn/embedded-lens-example-plugin": ["x-pack/examples/embedded_lens_example"], - "@kbn/embedded-lens-example-plugin/*": ["x-pack/examples/embedded_lens_example/*"], - "@kbn/exploratory-view-example-plugin": ["x-pack/examples/exploratory_view_example"], - "@kbn/exploratory-view-example-plugin/*": ["x-pack/examples/exploratory_view_example/*"], - "@kbn/reporting-example-plugin": ["x-pack/examples/reporting_example"], - "@kbn/reporting-example-plugin/*": ["x-pack/examples/reporting_example/*"], - "@kbn/screenshotting-example-plugin": ["x-pack/examples/screenshotting_example"], - "@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"], - "@kbn/testing-embedded-lens-plugin": ["x-pack/examples/testing_embedded_lens"], - "@kbn/testing-embedded-lens-plugin/*": ["x-pack/examples/testing_embedded_lens/*"], - "@kbn/third-party-lens-navigation-prompt-plugin": ["x-pack/examples/third_party_lens_navigation_prompt"], - "@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"], - "@kbn/maps-custom-raster-source-plugin": ["x-pack/examples/third_party_maps_source_example"], - "@kbn/maps-custom-raster-source-plugin/*": ["x-pack/examples/third_party_maps_source_example/*"], - "@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"], - "@kbn/third-party-vis-lens-example-plugin/*": ["x-pack/examples/third_party_vis_lens_example/*"], - "@kbn/triggers-actions-ui-example-plugin": ["x-pack/examples/triggers_actions_ui_example"], - "@kbn/triggers-actions-ui-example-plugin/*": ["x-pack/examples/triggers_actions_ui_example/*"], - "@kbn/ui-actions-enhanced-examples-plugin": ["x-pack/examples/ui_actions_enhanced_examples"], - "@kbn/ui-actions-enhanced-examples-plugin/*": ["x-pack/examples/ui_actions_enhanced_examples/*"], - "@kbn/actions-plugin": ["x-pack/plugins/actions"], - "@kbn/actions-plugin/*": ["x-pack/plugins/actions/*"], - "@kbn/aiops-plugin": ["x-pack/plugins/aiops"], - "@kbn/aiops-plugin/*": ["x-pack/plugins/aiops/*"], - "@kbn/alerting-plugin": ["x-pack/plugins/alerting"], - "@kbn/alerting-plugin/*": ["x-pack/plugins/alerting/*"], - "@kbn/apm-plugin": ["x-pack/plugins/apm"], - "@kbn/apm-plugin/*": ["x-pack/plugins/apm/*"], - "@kbn/banners-plugin": ["x-pack/plugins/banners"], - "@kbn/banners-plugin/*": ["x-pack/plugins/banners/*"], - "@kbn/canvas-plugin": ["x-pack/plugins/canvas"], - "@kbn/canvas-plugin/*": ["x-pack/plugins/canvas/*"], - "@kbn/cases-plugin": ["x-pack/plugins/cases"], - "@kbn/cases-plugin/*": ["x-pack/plugins/cases/*"], - "@kbn/cloud-defend-plugin": ["x-pack/plugins/cloud_defend"], - "@kbn/cloud-defend-plugin/*": ["x-pack/plugins/cloud_defend/*"], - "@kbn/cloud-chat-plugin": ["x-pack/plugins/cloud_integrations/cloud_chat"], - "@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"], - "@kbn/cloud-data-migration-plugin": ["x-pack/plugins/cloud_integrations/cloud_data_migration"], - "@kbn/cloud-data-migration-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_data_migration/*"], - "@kbn/cloud-experiments-plugin": ["x-pack/plugins/cloud_integrations/cloud_experiments"], - "@kbn/cloud-experiments-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_experiments/*"], - "@kbn/cloud-full-story-plugin": ["x-pack/plugins/cloud_integrations/cloud_full_story"], - "@kbn/cloud-full-story-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_full_story/*"], - "@kbn/cloud-gainsight-plugin": ["x-pack/plugins/cloud_integrations/cloud_gain_sight"], - "@kbn/cloud-gainsight-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_gain_sight/*"], - "@kbn/cloud-links-plugin": ["x-pack/plugins/cloud_integrations/cloud_links"], - "@kbn/cloud-links-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_links/*"], - "@kbn/cloud-security-posture-plugin": ["x-pack/plugins/cloud_security_posture"], - "@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"], - "@kbn/cloud-plugin": ["x-pack/plugins/cloud"], - "@kbn/cloud-plugin/*": ["x-pack/plugins/cloud/*"], - "@kbn/cross-cluster-replication-plugin": ["x-pack/plugins/cross_cluster_replication"], - "@kbn/cross-cluster-replication-plugin/*": ["x-pack/plugins/cross_cluster_replication/*"], - "@kbn/custom-branding-plugin": ["x-pack/plugins/custom_branding"], - "@kbn/custom-branding-plugin/*": ["x-pack/plugins/custom_branding/*"], - "@kbn/dashboard-enhanced-plugin": ["x-pack/plugins/dashboard_enhanced"], - "@kbn/dashboard-enhanced-plugin/*": ["x-pack/plugins/dashboard_enhanced/*"], - "@kbn/data-visualizer-plugin": ["x-pack/plugins/data_visualizer"], - "@kbn/data-visualizer-plugin/*": ["x-pack/plugins/data_visualizer/*"], - "@kbn/discover-enhanced-plugin": ["x-pack/plugins/discover_enhanced"], - "@kbn/discover-enhanced-plugin/*": ["x-pack/plugins/discover_enhanced/*"], - "@kbn/url-drilldown-plugin": ["x-pack/plugins/drilldowns/url_drilldown"], - "@kbn/url-drilldown-plugin/*": ["x-pack/plugins/drilldowns/url_drilldown/*"], - "@kbn/embeddable-enhanced-plugin": ["x-pack/plugins/embeddable_enhanced"], - "@kbn/embeddable-enhanced-plugin/*": ["x-pack/plugins/embeddable_enhanced/*"], - "@kbn/encrypted-saved-objects-plugin": ["x-pack/plugins/encrypted_saved_objects"], - "@kbn/encrypted-saved-objects-plugin/*": ["x-pack/plugins/encrypted_saved_objects/*"], - "@kbn/enterprise-search-plugin": ["x-pack/plugins/enterprise_search"], - "@kbn/enterprise-search-plugin/*": ["x-pack/plugins/enterprise_search/*"], - "@kbn/event-log-plugin": ["x-pack/plugins/event_log"], - "@kbn/event-log-plugin/*": ["x-pack/plugins/event_log/*"], - "@kbn/features-plugin": ["x-pack/plugins/features"], - "@kbn/features-plugin/*": ["x-pack/plugins/features/*"], - "@kbn/file-upload-plugin": ["x-pack/plugins/file_upload"], - "@kbn/file-upload-plugin/*": ["x-pack/plugins/file_upload/*"], - "@kbn/fleet-plugin": ["x-pack/plugins/fleet"], - "@kbn/fleet-plugin/*": ["x-pack/plugins/fleet/*"], - "@kbn/global-search-bar-plugin": ["x-pack/plugins/global_search_bar"], - "@kbn/global-search-bar-plugin/*": ["x-pack/plugins/global_search_bar/*"], - "@kbn/global-search-providers-plugin": ["x-pack/plugins/global_search_providers"], - "@kbn/global-search-providers-plugin/*": ["x-pack/plugins/global_search_providers/*"], - "@kbn/global-search-plugin": ["x-pack/plugins/global_search"], - "@kbn/global-search-plugin/*": ["x-pack/plugins/global_search/*"], - "@kbn/graph-plugin": ["x-pack/plugins/graph"], - "@kbn/graph-plugin/*": ["x-pack/plugins/graph/*"], - "@kbn/grokdebugger-plugin": ["x-pack/plugins/grokdebugger"], - "@kbn/grokdebugger-plugin/*": ["x-pack/plugins/grokdebugger/*"], - "@kbn/index-lifecycle-management-plugin": ["x-pack/plugins/index_lifecycle_management"], - "@kbn/index-lifecycle-management-plugin/*": ["x-pack/plugins/index_lifecycle_management/*"], - "@kbn/index-management-plugin": ["x-pack/plugins/index_management"], - "@kbn/index-management-plugin/*": ["x-pack/plugins/index_management/*"], - "@kbn/infra-plugin": ["x-pack/plugins/infra"], - "@kbn/infra-plugin/*": ["x-pack/plugins/infra/*"], - "@kbn/ingest-pipelines-plugin": ["x-pack/plugins/ingest_pipelines"], - "@kbn/ingest-pipelines-plugin/*": ["x-pack/plugins/ingest_pipelines/*"], - "@kbn/kubernetes-security-plugin": ["x-pack/plugins/kubernetes_security"], - "@kbn/kubernetes-security-plugin/*": ["x-pack/plugins/kubernetes_security/*"], - "@kbn/lens-plugin": ["x-pack/plugins/lens"], - "@kbn/lens-plugin/*": ["x-pack/plugins/lens/*"], - "@kbn/license-api-guard-plugin": ["x-pack/plugins/license_api_guard"], - "@kbn/license-api-guard-plugin/*": ["x-pack/plugins/license_api_guard/*"], - "@kbn/license-management-plugin": ["x-pack/plugins/license_management"], - "@kbn/license-management-plugin/*": ["x-pack/plugins/license_management/*"], - "@kbn/licensing-plugin": ["x-pack/plugins/licensing"], - "@kbn/licensing-plugin/*": ["x-pack/plugins/licensing/*"], - "@kbn/lists-plugin": ["x-pack/plugins/lists"], - "@kbn/lists-plugin/*": ["x-pack/plugins/lists/*"], - "@kbn/logstash-plugin": ["x-pack/plugins/logstash"], - "@kbn/logstash-plugin/*": ["x-pack/plugins/logstash/*"], - "@kbn/maps-plugin": ["x-pack/plugins/maps"], - "@kbn/maps-plugin/*": ["x-pack/plugins/maps/*"], - "@kbn/ml-plugin": ["x-pack/plugins/ml"], - "@kbn/ml-plugin/*": ["x-pack/plugins/ml/*"], - "@kbn/monitoring-collection-plugin": ["x-pack/plugins/monitoring_collection"], - "@kbn/monitoring-collection-plugin/*": ["x-pack/plugins/monitoring_collection/*"], - "@kbn/monitoring-plugin": ["x-pack/plugins/monitoring"], - "@kbn/monitoring-plugin/*": ["x-pack/plugins/monitoring/*"], - "@kbn/notifications-plugin": ["x-pack/plugins/notifications"], - "@kbn/notifications-plugin/*": ["x-pack/plugins/notifications/*"], - "@kbn/observability-plugin": ["x-pack/plugins/observability"], - "@kbn/observability-plugin/*": ["x-pack/plugins/observability/*"], - "@kbn/osquery-plugin": ["x-pack/plugins/osquery"], - "@kbn/osquery-plugin/*": ["x-pack/plugins/osquery/*"], - "@kbn/painless-lab-plugin": ["x-pack/plugins/painless_lab"], - "@kbn/painless-lab-plugin/*": ["x-pack/plugins/painless_lab/*"], - "@kbn/profiling-plugin": ["x-pack/plugins/profiling"], - "@kbn/profiling-plugin/*": ["x-pack/plugins/profiling/*"], - "@kbn/remote-clusters-plugin": ["x-pack/plugins/remote_clusters"], - "@kbn/remote-clusters-plugin/*": ["x-pack/plugins/remote_clusters/*"], - "@kbn/reporting-plugin": ["x-pack/plugins/reporting"], - "@kbn/reporting-plugin/*": ["x-pack/plugins/reporting/*"], - "@kbn/rollup-plugin": ["x-pack/plugins/rollup"], - "@kbn/rollup-plugin/*": ["x-pack/plugins/rollup/*"], - "@kbn/rule-registry-plugin": ["x-pack/plugins/rule_registry"], - "@kbn/rule-registry-plugin/*": ["x-pack/plugins/rule_registry/*"], - "@kbn/runtime-fields-plugin": ["x-pack/plugins/runtime_fields"], - "@kbn/runtime-fields-plugin/*": ["x-pack/plugins/runtime_fields/*"], - "@kbn/saved-objects-tagging-plugin": ["x-pack/plugins/saved_objects_tagging"], - "@kbn/saved-objects-tagging-plugin/*": ["x-pack/plugins/saved_objects_tagging/*"], - "@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"], - "@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"], - "@kbn/searchprofiler-plugin": ["x-pack/plugins/searchprofiler"], - "@kbn/searchprofiler-plugin/*": ["x-pack/plugins/searchprofiler/*"], - "@kbn/security-solution-plugin": ["x-pack/plugins/security_solution"], - "@kbn/security-solution-plugin/*": ["x-pack/plugins/security_solution/*"], - "@kbn/security-plugin": ["x-pack/plugins/security"], - "@kbn/security-plugin/*": ["x-pack/plugins/security/*"], - "@kbn/session-view-plugin": ["x-pack/plugins/session_view"], - "@kbn/session-view-plugin/*": ["x-pack/plugins/session_view/*"], - "@kbn/snapshot-restore-plugin": ["x-pack/plugins/snapshot_restore"], - "@kbn/snapshot-restore-plugin/*": ["x-pack/plugins/snapshot_restore/*"], - "@kbn/spaces-plugin": ["x-pack/plugins/spaces"], - "@kbn/spaces-plugin/*": ["x-pack/plugins/spaces/*"], - "@kbn/stack-alerts-plugin": ["x-pack/plugins/stack_alerts"], - "@kbn/stack-alerts-plugin/*": ["x-pack/plugins/stack_alerts/*"], - "@kbn/stack-connectors-plugin": ["x-pack/plugins/stack_connectors"], - "@kbn/stack-connectors-plugin/*": ["x-pack/plugins/stack_connectors/*"], - "@kbn/synthetics-plugin": ["x-pack/plugins/synthetics"], - "@kbn/synthetics-plugin/*": ["x-pack/plugins/synthetics/*"], - "@kbn/task-manager-plugin": ["x-pack/plugins/task_manager"], - "@kbn/task-manager-plugin/*": ["x-pack/plugins/task_manager/*"], - "@kbn/telemetry-collection-xpack-plugin": ["x-pack/plugins/telemetry_collection_xpack"], - "@kbn/telemetry-collection-xpack-plugin/*": ["x-pack/plugins/telemetry_collection_xpack/*"], - "@kbn/threat-intelligence-plugin": ["x-pack/plugins/threat_intelligence"], - "@kbn/threat-intelligence-plugin/*": ["x-pack/plugins/threat_intelligence/*"], - "@kbn/timelines-plugin": ["x-pack/plugins/timelines"], - "@kbn/timelines-plugin/*": ["x-pack/plugins/timelines/*"], - "@kbn/transform-plugin": ["x-pack/plugins/transform"], - "@kbn/transform-plugin/*": ["x-pack/plugins/transform/*"], - "@kbn/translations-plugin": ["x-pack/plugins/translations"], - "@kbn/translations-plugin/*": ["x-pack/plugins/translations/*"], - "@kbn/triggers-actions-ui-plugin": ["x-pack/plugins/triggers_actions_ui"], - "@kbn/triggers-actions-ui-plugin/*": ["x-pack/plugins/triggers_actions_ui/*"], - "@kbn/upgrade-assistant-plugin": ["x-pack/plugins/upgrade_assistant"], - "@kbn/upgrade-assistant-plugin/*": ["x-pack/plugins/upgrade_assistant/*"], - "@kbn/ux-plugin": ["x-pack/plugins/ux"], - "@kbn/ux-plugin/*": ["x-pack/plugins/ux/*"], "@kbn/watcher-plugin": ["x-pack/plugins/watcher"], "@kbn/watcher-plugin/*": ["x-pack/plugins/watcher/*"], - "@kbn/alerting-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts"], - "@kbn/alerting-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/*"], - "@kbn/cases-fixture-plugin": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases"], - "@kbn/cases-fixture-plugin/*": ["x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/*"], - "@kbn/test-feature-usage-plugin": ["x-pack/test/licensing_plugin/plugins/test_feature_usage"], - "@kbn/test-feature-usage-plugin/*": ["x-pack/test/licensing_plugin/plugins/test_feature_usage/*"], - "@kbn/elasticsearch-client-xpack-plugin": ["x-pack/test/plugin_api_integration/plugins/elasticsearch_client"], - "@kbn/elasticsearch-client-xpack-plugin/*": ["x-pack/test/plugin_api_integration/plugins/elasticsearch_client/*"], - "@kbn/event-log-fixture-plugin": ["x-pack/test/plugin_api_integration/plugins/event_log"], - "@kbn/event-log-fixture-plugin/*": ["x-pack/test/plugin_api_integration/plugins/event_log/*"], - "@kbn/feature-usage-test-plugin": ["x-pack/test/plugin_api_integration/plugins/feature_usage_test"], - "@kbn/feature-usage-test-plugin/*": ["x-pack/test/plugin_api_integration/plugins/feature_usage_test/*"], - "@kbn/sample-task-plugin": ["x-pack/test/plugin_api_integration/plugins/sample_task_plugin"], - "@kbn/sample-task-plugin/*": ["x-pack/test/plugin_api_integration/plugins/sample_task_plugin/*"], - "@kbn/task-manager-performance-plugin": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance"], - "@kbn/task-manager-performance-plugin/*": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance/*"], - "@kbn/global-search-test-plugin": ["x-pack/test/plugin_functional/plugins/global_search_test"], - "@kbn/global-search-test-plugin/*": ["x-pack/test/plugin_functional/plugins/global_search_test/*"], - "@kbn/resolver-test-plugin": ["x-pack/test/plugin_functional/plugins/resolver_test"], - "@kbn/resolver-test-plugin/*": ["x-pack/test/plugin_functional/plugins/resolver_test/*"], - "@kbn/security-test-endpoints-plugin": ["x-pack/test/security_functional/fixtures/common/test_endpoints"], - "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/fixtures/common/test_endpoints/*"], - "@kbn/application-usage-test-plugin": ["x-pack/test/usage_collection/plugins/application_usage_test"], - "@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"], - "@kbn/stack-management-usage-test-plugin": ["x-pack/test/usage_collection/plugins/stack_management_usage_test"], - "@kbn/stack-management-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/stack_management_usage_test/*"], + "@kbn/web-worker-stub": ["packages/kbn-web-worker-stub"], + "@kbn/web-worker-stub/*": ["packages/kbn-web-worker-stub/*"], + "@kbn/yarn-lock-validator": ["packages/kbn-yarn-lock-validator"], + "@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"], // END AUTOMATED PACKAGE LISTING // Allows for importing from `kibana` package for the exported types. "@emotion/core": ["typings/@emotion"], @@ -1297,8 +1311,6 @@ "moduleResolution": "node", // "resolveJsonModule" allows for importing, extracting types from and generating .json files. "resolveJsonModule": true, - // Do not resolve symlinks to their real path; treat a symlinked file like a real one. - "preserveSymlinks": true, // Disallow inconsistently-cased references to the same file. "forceConsistentCasingInFileNames": false, // Forbid unused local variables as the rule was deprecated by ts-lint diff --git a/tsconfig.bazel.json b/tsconfig.bazel.json deleted file mode 100644 index 892c727ef588..000000000000 --- a/tsconfig.bazel.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "incremental": false, - "composite": false - } -} diff --git a/tsconfig.json b/tsconfig.json index 0e1d602ee945..91afa752c068 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,16 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "outDir": "target/root_types" + "outDir": "target/types" }, "include": [ "kibana.d.ts", "package.json", ], "kbn_references": [ - { "path": "./src/core/tsconfig.json" }, + "@kbn/core", + ], + "exclude": [ + "target/**/*", ] -} \ No newline at end of file +} diff --git a/x-pack/examples/alerting_example/tsconfig.json b/x-pack/examples/alerting_example/tsconfig.json index 024d7304ffad..4e9b08067304 100644 --- a/x-pack/examples/alerting_example/tsconfig.json +++ b/x-pack/examples/alerting_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,15 +11,19 @@ "common/**/*.ts", "../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/charts/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../plugins/alerting/tsconfig.json" }, - { "path": "../../plugins/triggers_actions_ui/tsconfig.json" }, - { "path": "../../plugins/features/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/charts-plugin", + "@kbn/data-plugin", + "@kbn/alerting-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/features-plugin", + "@kbn/developer-examples-plugin", + "@kbn/i18n", + "@kbn/core-application-common", ] } diff --git a/x-pack/examples/embedded_lens_example/tsconfig.json b/x-pack/examples/embedded_lens_example/tsconfig.json index d5689e03aeb6..ea5b99db315d 100644 --- a/x-pack/examples/embedded_lens_example/tsconfig.json +++ b/x-pack/examples/embedded_lens_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,12 +10,16 @@ "server/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../plugins/lens/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/lens-plugin", + "@kbn/developer-examples-plugin", + "@kbn/data-views-plugin", + "@kbn/ui-actions-plugin", ] } diff --git a/x-pack/examples/exploratory_view_example/tsconfig.json b/x-pack/examples/exploratory_view_example/tsconfig.json index 795beb43c563..aa3363da4fe9 100644 --- a/x-pack/examples/exploratory_view_example/tsconfig.json +++ b/x-pack/examples/exploratory_view_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,12 +10,15 @@ "server/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../plugins/observability/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/observability-plugin", + "@kbn/developer-examples-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", ] } diff --git a/x-pack/examples/reporting_example/tsconfig.json b/x-pack/examples/reporting_example/tsconfig.json index 4d20a411bd06..c8f6db0e7690 100644 --- a/x-pack/examples/reporting_example/tsconfig.json +++ b/x-pack/examples/reporting_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,13 +11,18 @@ "common/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, - { "path": "../../plugins/reporting/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/navigation-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/developer-examples-plugin", + "@kbn/reporting-plugin", + "@kbn/share-plugin", + "@kbn/i18n-react", + "@kbn/utility-types", ] } diff --git a/x-pack/examples/screenshotting_example/tsconfig.json b/x-pack/examples/screenshotting_example/tsconfig.json index cf117533adc8..3c1351f817c1 100644 --- a/x-pack/examples/screenshotting_example/tsconfig.json +++ b/x-pack/examples/screenshotting_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -11,13 +11,13 @@ "common/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, - { "path": "../../plugins/screenshotting/tsconfig.json" } + "@kbn/core", + "@kbn/developer-examples-plugin", + "@kbn/screenshotting-plugin", + "@kbn/config-schema", ] } diff --git a/x-pack/examples/testing_embedded_lens/tsconfig.json b/x-pack/examples/testing_embedded_lens/tsconfig.json index d5689e03aeb6..b5e78a46c300 100644 --- a/x-pack/examples/testing_embedded_lens/tsconfig.json +++ b/x-pack/examples/testing_embedded_lens/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,12 +10,17 @@ "server/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../plugins/lens/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/lens-plugin", + "@kbn/developer-examples-plugin", + "@kbn/data-views-plugin", + "@kbn/ui-actions-plugin", + "@kbn/kibana-react-plugin", ] } diff --git a/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json b/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json index 2fe95c9cd483..249de6790d8f 100644 --- a/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json +++ b/x-pack/examples/third_party_lens_navigation_prompt/tsconfig.json @@ -1,22 +1,21 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", "public/**/*", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/expressions/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/data_views/tsconfig.json" }, - { "path": "../../../src/plugins/field_formats/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../plugins/lens/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/data-views-plugin", + "@kbn/lens-plugin", + "@kbn/developer-examples-plugin", + "@kbn/data-plugin", ] } diff --git a/x-pack/examples/third_party_maps_source_example/tsconfig.json b/x-pack/examples/third_party_maps_source_example/tsconfig.json index 988c6c54a2d2..4957d44a7f46 100644 --- a/x-pack/examples/third_party_maps_source_example/tsconfig.json +++ b/x-pack/examples/third_party_maps_source_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", + "outDir": "target/types", }, "include": [ "public/**/*.ts", @@ -10,8 +10,12 @@ "../../../typings/**/*", ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../plugins/maps/tsconfig.json"}, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/maps-plugin", + "@kbn/developer-examples-plugin", + "@kbn/data-plugin", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/examples/third_party_vis_lens_example/tsconfig.json b/x-pack/examples/third_party_vis_lens_example/tsconfig.json index bb145ebd3006..ef98a7a9f447 100644 --- a/x-pack/examples/third_party_vis_lens_example/tsconfig.json +++ b/x-pack/examples/third_party_vis_lens_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,15 +10,17 @@ "common/**/*", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/expressions/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/data_views/tsconfig.json" }, - { "path": "../../../src/plugins/field_formats/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../plugins/lens/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/expressions-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-views-plugin", + "@kbn/field-formats-plugin", + "@kbn/lens-plugin", + "@kbn/developer-examples-plugin", + "@kbn/interpreter", ] } diff --git a/x-pack/examples/triggers_actions_ui_example/tsconfig.json b/x-pack/examples/triggers_actions_ui_example/tsconfig.json index d28a560f8ba8..0e78735f7a13 100644 --- a/x-pack/examples/triggers_actions_ui_example/tsconfig.json +++ b/x-pack/examples/triggers_actions_ui_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,12 +10,17 @@ "server/**/*.ts", "../../../typings/**/*", ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../plugins/alerting/tsconfig.json" }, - { "path": "../../plugins/triggers_actions_ui/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/alerting-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/developer-examples-plugin", + "@kbn/rule-data-utils", + "@kbn/data-plugin", + "@kbn/i18n-react", ] } diff --git a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json index 8b87cc628e77..2ab960659555 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json +++ b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types" + "outDir": "target/types" }, "include": [ "index.ts", @@ -10,17 +10,24 @@ "server/**/*.ts", "../../../typings/**/*" ], - "exclude": [], + "exclude": [ + "target/**/*", + ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/share/tsconfig.json" }, - { "path": "../../../src/plugins/discover/tsconfig.json" }, - { "path": "../../../src/plugins/dashboard/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../src/plugins/ui_actions_enhanced/tsconfig.json" }, - { "path": "../../../examples/developer_examples/tsconfig.json" }, - { "path": "../../plugins/dashboard_enhanced/tsconfig.json" }, + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/share-plugin", + "@kbn/discover-plugin", + "@kbn/dashboard-plugin", + "@kbn/embeddable-plugin", + "@kbn/ui-actions-enhanced-plugin", + "@kbn/developer-examples-plugin", + "@kbn/dashboard-enhanced-plugin", + "@kbn/data-plugin", + "@kbn/ui-actions-plugin", + "@kbn/i18n", + "@kbn/unified-search-plugin", + "@kbn/utility-types", ] } diff --git a/x-pack/packages/ml/agg_utils/BUILD.bazel b/x-pack/packages/ml/agg_utils/BUILD.bazel deleted file mode 100644 index ef8d59c000f0..000000000000 --- a/x-pack/packages/ml/agg_utils/BUILD.bazel +++ /dev/null @@ -1,134 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "agg_utils" -PKG_REQUIRE_NAME = "@kbn/ml-agg-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//@elastic/elasticsearch", - "@npm//lodash", - "//packages/kbn-field-types", - "//x-pack/packages/ml/is_populated_object", - "//x-pack/packages/ml/string_hash", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/lodash", - "@npm//@elastic/elasticsearch", - "@npm//tslib", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/kbn-field-types:npm_module_types", - "//x-pack/packages/ml/is_populated_object:npm_module_types", - "//x-pack/packages/ml/string_hash:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/x-pack/packages/ml/agg_utils/kibana.jsonc b/x-pack/packages/ml/agg_utils/kibana.jsonc index 4bcfcbd8721a..3c29356a24ad 100644 --- a/x-pack/packages/ml/agg_utils/kibana.jsonc +++ b/x-pack/packages/ml/agg_utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ml-agg-utils", - "owner": "@elastic/ml-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/ml-ui" } diff --git a/x-pack/packages/ml/agg_utils/package.json b/x-pack/packages/ml/agg_utils/package.json index 671b3c479e48..509fcaf1f6ea 100644 --- a/x-pack/packages/ml/agg_utils/package.json +++ b/x-pack/packages/ml/agg_utils/package.json @@ -5,7 +5,5 @@ "homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-ml-agg-utils", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/ml/agg_utils/src/validate_number.test.ts b/x-pack/packages/ml/agg_utils/src/validate_number.test.ts index e40bc604f417..e124908f278b 100644 --- a/x-pack/packages/ml/agg_utils/src/validate_number.test.ts +++ b/x-pack/packages/ml/agg_utils/src/validate_number.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { numberValidator } from '@kbn/ml-agg-utils'; +import { numberValidator } from './validate_number'; describe('numberValidator', () => { it('should only allow integers above zero', () => { diff --git a/x-pack/packages/ml/agg_utils/tsconfig.json b/x-pack/packages/ml/agg_utils/tsconfig.json index 424a7c9d5962..a7620df0a88d 100644 --- a/x-pack/packages/ml/agg_utils/tsconfig.json +++ b/x-pack/packages/ml/agg_utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -12,5 +10,14 @@ }, "include": [ "**/*.ts", + ], + "kbn_references": [ + "@kbn/core-elasticsearch-server", + "@kbn/field-types", + "@kbn/ml-is-populated-object", + "@kbn/ml-string-hash" + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/packages/ml/aiops_components/BUILD.bazel b/x-pack/packages/ml/aiops_components/BUILD.bazel deleted file mode 100644 index b47a6a8b1acd..000000000000 --- a/x-pack/packages/ml/aiops_components/BUILD.bazel +++ /dev/null @@ -1,157 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "aiops_components" -PKG_REQUIRE_NAME = "@kbn/aiops-components" - -SOURCE_FILES = glob( - [ - "**/*.scss", - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//d3-brush", - "@npm//d3-scale", - "@npm//d3-selection", - "@npm//d3-transition", - "@npm//react", - "@npm//@elastic/charts", - "@npm//@elastic/eui", - "@npm//@emotion/react", - "@npm//@emotion/css", - "//packages/kbn-i18n-react", - "//x-pack/packages/ml/aiops_utils", -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/d3-brush", - "@npm//@types/d3-scale", - "@npm//@types/d3-selection", - "@npm//@types/d3-transition", - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "@npm//@elastic/charts", - "@npm//@elastic/eui", - "@npm//@emotion/react", - "@npm//@emotion/css", - "//packages/kbn-i18n-react:npm_module_types", - "//x-pack/packages/ml/aiops_utils:npm_module_types", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, - additional_args = [ - "--copy-files", - "--quiet" - ], -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/x-pack/packages/ml/aiops_components/kibana.jsonc b/x-pack/packages/ml/aiops_components/kibana.jsonc index 3fc4f228e2b0..6df0d201312a 100644 --- a/x-pack/packages/ml/aiops_components/kibana.jsonc +++ b/x-pack/packages/ml/aiops_components/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/aiops-components", - "owner": "@elastic/ml-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/ml-ui" } diff --git a/x-pack/packages/ml/aiops_components/package.json b/x-pack/packages/ml/aiops_components/package.json index e3fd69c7c8e1..8c9a4a0b76ea 100644 --- a/x-pack/packages/ml/aiops_components/package.json +++ b/x-pack/packages/ml/aiops_components/package.json @@ -5,8 +5,5 @@ "homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-components", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/ml/aiops_components/tsconfig.json b/x-pack/packages/ml/aiops_components/tsconfig.json index cdb1c5d8d000..2298884c973c 100644 --- a/x-pack/packages/ml/aiops_components/tsconfig.json +++ b/x-pack/packages/ml/aiops_components/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "@types/d3-brush", @@ -19,5 +17,13 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/i18n-react", + "@kbn/aiops-utils", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/packages/ml/aiops_utils/BUILD.bazel b/x-pack/packages/ml/aiops_utils/BUILD.bazel deleted file mode 100644 index b5a8daddebd9..000000000000 --- a/x-pack/packages/ml/aiops_utils/BUILD.bazel +++ /dev/null @@ -1,135 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "aiops_utils" -PKG_REQUIRE_NAME = "@kbn/aiops-utils" - -SOURCE_FILES = glob( - [ - "**/*.ts", - "**/*.tsx", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ - "@npm//react", - "//packages/kbn-logging" -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", - "@npm//@types/react", - "//packages/core/elasticsearch/core-elasticsearch-server:npm_module_types", - "//packages/kbn-logging:npm_module_types" -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -jsts_transpiler( - name = "target_web", - srcs = SRCS, - build_pkg_name = package_name(), - web = True, -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/x-pack/packages/ml/aiops_utils/kibana.jsonc b/x-pack/packages/ml/aiops_utils/kibana.jsonc index 46d16f2cdc33..09202d630140 100644 --- a/x-pack/packages/ml/aiops_utils/kibana.jsonc +++ b/x-pack/packages/ml/aiops_utils/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/aiops-utils", - "owner": "@elastic/ml-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/ml-ui" } diff --git a/x-pack/packages/ml/aiops_utils/package.json b/x-pack/packages/ml/aiops_utils/package.json index d1b7bba50061..dc2960e5f360 100644 --- a/x-pack/packages/ml/aiops_utils/package.json +++ b/x-pack/packages/ml/aiops_utils/package.json @@ -5,8 +5,5 @@ "homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-aiops-utils", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "browser": "./target_web/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/ml/aiops_utils/tsconfig.json b/x-pack/packages/ml/aiops_utils/tsconfig.json index 4eb9855fa759..727c59160121 100644 --- a/x-pack/packages/ml/aiops_utils/tsconfig.json +++ b/x-pack/packages/ml/aiops_utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -14,5 +12,12 @@ "include": [ "**/*.ts", "**/*.tsx", + ], + "kbn_references": [ + "@kbn/logging", + "@kbn/core-http-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/packages/ml/is_populated_object/BUILD.bazel b/x-pack/packages/ml/is_populated_object/BUILD.bazel deleted file mode 100644 index 00c2677acc69..000000000000 --- a/x-pack/packages/ml/is_populated_object/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "is_populated_object" -PKG_REQUIRE_NAME = "@kbn/ml-is-populated-object" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/x-pack/packages/ml/is_populated_object/kibana.jsonc b/x-pack/packages/ml/is_populated_object/kibana.jsonc index 44240b60c419..1ef21fe110b1 100644 --- a/x-pack/packages/ml/is_populated_object/kibana.jsonc +++ b/x-pack/packages/ml/is_populated_object/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ml-is-populated-object", - "owner": "@elastic/ml-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/ml-ui" } diff --git a/x-pack/packages/ml/is_populated_object/package.json b/x-pack/packages/ml/is_populated_object/package.json index f5bdff98a720..67178caec3de 100644 --- a/x-pack/packages/ml/is_populated_object/package.json +++ b/x-pack/packages/ml/is_populated_object/package.json @@ -5,7 +5,5 @@ "homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-ml-is-populated-object", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/ml/is_populated_object/tsconfig.json b/x-pack/packages/ml/is_populated_object/tsconfig.json index af8fdef592c4..0036df9dd1a2 100644 --- a/x-pack/packages/ml/is_populated_object/tsconfig.json +++ b/x-pack/packages/ml/is_populated_object/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/packages/ml/string_hash/BUILD.bazel b/x-pack/packages/ml/string_hash/BUILD.bazel deleted file mode 100644 index b3684de8b3d0..000000000000 --- a/x-pack/packages/ml/string_hash/BUILD.bazel +++ /dev/null @@ -1,122 +0,0 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library") -load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") - -PKG_DIRNAME = "string_hash" -PKG_REQUIRE_NAME = "@kbn/ml-string-hash" - -SOURCE_FILES = glob( - [ - "**/*.ts", - ], - exclude = [ - "**/*.config.js", - "**/*.mock.*", - "**/*.test.*", - "**/*.stories.*", - "**/__snapshots__/**", - "**/integration_tests/**", - "**/mocks/**", - "**/scripts/**", - "**/storybook/**", - "**/test_fixtures/**", - "**/test_helpers/**", - ], -) - -SRCS = SOURCE_FILES - -filegroup( - name = "srcs", - srcs = SRCS, -) - -NPM_MODULE_EXTRA_FILES = [ - "package.json", -] - -# In this array place runtime dependencies, including other packages and NPM packages -# which must be available for this code to run. -# -# To reference other packages use: -# "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" -# -# To reference a NPM package use: -# "@npm//name-of-package" -# eg. "@npm//lodash" -RUNTIME_DEPS = [ -] - -# In this array place dependencies necessary to build the types, which will include the -# :npm_module_types target of other packages and packages from NPM, including @types/* -# packages. -# -# To reference the types for another package use: -# "//repo/relative/path/to/package:npm_module_types" -# eg. "//packages/kbn-utils:npm_module_types" -# -# References to NPM packages work the same as RUNTIME_DEPS -TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", -] - -jsts_transpiler( - name = "target_node", - srcs = SRCS, - build_pkg_name = package_name(), -) - -ts_config( - name = "tsconfig", - src = "tsconfig.json", - deps = [ - "//:tsconfig.base.json", - "//:tsconfig.bazel.json", - ], -) - -ts_project( - name = "tsc_types", - args = ['--pretty'], - srcs = SRCS, - deps = TYPES_DEPS, - declaration = True, - emit_declaration_only = True, - out_dir = "target_types", - tsconfig = ":tsconfig", -) - -js_library( - name = PKG_DIRNAME, - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -js_library( - name = "npm_module_types", - srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":tsc_types"], - package_name = PKG_REQUIRE_NAME, - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "npm_module", - deps = [":" + PKG_DIRNAME], -) - -filegroup( - name = "build", - srcs = [":npm_module"], - visibility = ["//visibility:public"], -) - -pkg_npm( - name = "build_types", - deps = [":npm_module_types"], - visibility = ["//visibility:public"], -) diff --git a/x-pack/packages/ml/string_hash/kibana.jsonc b/x-pack/packages/ml/string_hash/kibana.jsonc index 0986bb25375c..1573e9a97048 100644 --- a/x-pack/packages/ml/string_hash/kibana.jsonc +++ b/x-pack/packages/ml/string_hash/kibana.jsonc @@ -1,7 +1,5 @@ { "type": "shared-common", "id": "@kbn/ml-string-hash", - "owner": "@elastic/ml-ui", - "runtimeDeps": [], - "typeDeps": [] + "owner": "@elastic/ml-ui" } diff --git a/x-pack/packages/ml/string_hash/package.json b/x-pack/packages/ml/string_hash/package.json index 29bb62020574..272cb258ed1c 100644 --- a/x-pack/packages/ml/string_hash/package.json +++ b/x-pack/packages/ml/string_hash/package.json @@ -5,7 +5,5 @@ "homepage": "https://docs.elastic.dev/kibana-dev-docs/api/kbn-ml-string-hash", "private": true, "version": "1.0.0", - "main": "./target_node/index.js", - "license": "SSPL-1.0 OR Elastic License 2.0", - "types": "./target_types/index.d.ts" -} + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/x-pack/packages/ml/string_hash/tsconfig.json b/x-pack/packages/ml/string_hash/tsconfig.json index af8fdef592c4..0036df9dd1a2 100644 --- a/x-pack/packages/ml/string_hash/tsconfig.json +++ b/x-pack/packages/ml/string_hash/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "declaration": true, - "emitDeclarationOnly": true, - "outDir": "target_types", + "outDir": "target/types", "stripInternal": false, "types": [ "jest", @@ -12,5 +10,8 @@ }, "include": [ "**/*.ts" + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/performance/tsconfig.json b/x-pack/performance/tsconfig.json index 923a42ffe52f..636c4e1f5ed1 100644 --- a/x-pack/performance/tsconfig.json +++ b/x-pack/performance/tsconfig.json @@ -1,11 +1,16 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true, + "outDir": "target/types", "types": ["node", "jest"] }, "include": ["**/*.ts"], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/journeys", + "@kbn/test-subj-selector", + "@kbn/tooling-log", + ] } diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index 3928d87b2a87..aa450d51fbb3 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "server/**/*", @@ -13,16 +11,29 @@ "common/**/*" ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../spaces/tsconfig.json" }, - { "path": "../security/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../task_manager/tsconfig.json" }, - { "path": "../event_log/tsconfig.json" }, - { "path": "../encrypted_saved_objects/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../monitoring_collection/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" } + "@kbn/core", + "@kbn/spaces-plugin", + "@kbn/security-plugin", + "@kbn/licensing-plugin", + "@kbn/task-manager-plugin", + "@kbn/event-log-plugin", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/features-plugin", + "@kbn/monitoring-collection-plugin", + "@kbn/usage-collection-plugin", + "@kbn/i18n", + "@kbn/utility-types", + "@kbn/config-schema", + "@kbn/config", + "@kbn/core-saved-objects-server", + "@kbn/es-query", + "@kbn/apm-utils", + "@kbn/std", + "@kbn/logging", + "@kbn/logging-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/plugins/aiops/tsconfig.json b/x-pack/plugins/aiops/tsconfig.json index 0f8ba148324b..30fc6a4d3b18 100644 --- a/x-pack/plugins/aiops/tsconfig.json +++ b/x-pack/plugins/aiops/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../../typings/**/*", @@ -14,17 +12,38 @@ "types/**/*" ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../../../src/plugins/custom_integrations/tsconfig.json" }, - { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../src/plugins/unified_search/tsconfig.json" }, - { "path": "../security/tsconfig.json" }, - { "path": "../../../src/plugins/charts/tsconfig.json" }, - { "path": "../../../src/plugins/discover/tsconfig.json" }, - { "path": "../lens/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-utils-plugin", + "@kbn/kibana-react-plugin", + "@kbn/data-plugin", + "@kbn/unified-search-plugin", + "@kbn/charts-plugin", + "@kbn/discover-plugin", + "@kbn/lens-plugin", + "@kbn/datemath", + "@kbn/field-formats-plugin", + "@kbn/ml-agg-utils", + "@kbn/config-schema", + "@kbn/ml-is-populated-object", + "@kbn/es-query", + "@kbn/share-plugin", + "@kbn/data-views-plugin", + "@kbn/saved-search-plugin", + "@kbn/i18n", + "@kbn/ml-string-hash", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/rison", + "@kbn/core-http-browser", + "@kbn/aiops-components", + "@kbn/aiops-utils", + "@kbn/licensing-plugin", + "@kbn/field-types", + "@kbn/logging", + "@kbn/core-elasticsearch-server", + "@kbn/es-types", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 105ed878b097..9ea5bf8dcb94 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "server/**/*", @@ -13,17 +11,33 @@ "common/*" ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../actions/tsconfig.json" }, - { "path": "../spaces/tsconfig.json" }, - { "path": "../security/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../task_manager/tsconfig.json" }, - { "path": "../event_log/tsconfig.json" }, - { "path": "../encrypted_saved_objects/tsconfig.json" }, - { "path": "../monitoring_collection/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" } + "@kbn/core", + "@kbn/actions-plugin", + "@kbn/spaces-plugin", + "@kbn/security-plugin", + "@kbn/licensing-plugin", + "@kbn/task-manager-plugin", + "@kbn/event-log-plugin", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/monitoring-collection-plugin", + "@kbn/features-plugin", + "@kbn/usage-collection-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/utility-types", + "@kbn/config-schema", + "@kbn/data-plugin", + "@kbn/i18n", + "@kbn/core-saved-objects-server", + "@kbn/es-query", + "@kbn/logging", + "@kbn/std", + "@kbn/rule-data-utils", + "@kbn/logging-mocks", + "@kbn/core-logging-server-mocks", + "@kbn/core-saved-objects-common", + "@kbn/securitysolution-rules", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/plugins/apm/ftr_e2e/cypress.config.ts b/x-pack/plugins/apm/ftr_e2e/cypress.config.ts index bcccae43adc7..81a2939b9c9a 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress.config.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress.config.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { defineConfig } from 'cypress'; +import { defineCypressConfig } from '@kbn/cypress-config'; import { setupNodeEvents } from './setup_cypress_node_events'; -module.exports = defineConfig({ +export default defineCypressConfig({ projectId: 'omwh6f', fileServerFolder: './cypress', fixturesFolder: './cypress/fixtures', diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 6a8ba7e1495a..e61ef90e5335 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -8,7 +8,6 @@ "target/**/*" ], "compilerOptions": { - "target": "es2015", "outDir": "target/types", "types": [ "cypress", @@ -19,6 +18,10 @@ "kbn_references": [ { "path": "../../../test/tsconfig.json" }, { "path": "../../../../test/tsconfig.json" }, - { "path": "../tsconfig.json" }, + "@kbn/test", + "@kbn/apm-synthtrace", + "@kbn/dev-utils", + "@kbn/axe-config", + "@kbn/cypress-config", ] } diff --git a/x-pack/plugins/apm/scripts/aggregate_latency_metrics.js b/x-pack/plugins/apm/scripts/aggregate_latency_metrics.js index c8f1eb764155..c6bf895a0120 100644 --- a/x-pack/plugins/apm/scripts/aggregate_latency_metrics.js +++ b/x-pack/plugins/apm/scripts/aggregate_latency_metrics.js @@ -5,8 +5,7 @@ * 2.0. */ -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); +require('@kbn/babel-register').install(); const { aggregateLatencyMetrics } = require('./aggregate_latency_metrics'); diff --git a/x-pack/plugins/apm/scripts/create_apm_users.js b/x-pack/plugins/apm/scripts/create_apm_users.js index 8cef6ebb6c7a..a13c986e9322 100644 --- a/x-pack/plugins/apm/scripts/create_apm_users.js +++ b/x-pack/plugins/apm/scripts/create_apm_users.js @@ -13,8 +13,5 @@ * Usage: node create-apm-users.js ******************************/ -// compile typescript on the fly -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); - +require('@kbn/babel-register').install(); require('./create_apm_users/create_apm_users_cli'); diff --git a/x-pack/plugins/apm/scripts/create_functional_tests_archive.js b/x-pack/plugins/apm/scripts/create_functional_tests_archive.js index b1b766990ad6..254a24cde649 100644 --- a/x-pack/plugins/apm/scripts/create_functional_tests_archive.js +++ b/x-pack/plugins/apm/scripts/create_functional_tests_archive.js @@ -6,7 +6,5 @@ */ // compile typescript on the fly -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); - +require('@kbn/babel-register').install(); require('./create_functional_tests_archive'); diff --git a/x-pack/plugins/apm/scripts/infer_route_return_types.js b/x-pack/plugins/apm/scripts/infer_route_return_types.js index 8bf3bdbcdf3d..d60df693fac5 100644 --- a/x-pack/plugins/apm/scripts/infer_route_return_types.js +++ b/x-pack/plugins/apm/scripts/infer_route_return_types.js @@ -6,7 +6,5 @@ */ // compile typescript on the fly -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); - +require('@kbn/babel-register').install(); require('./infer_route_return_types'); diff --git a/x-pack/plugins/apm/scripts/test/jest.js b/x-pack/plugins/apm/scripts/test/jest.js index c4c5d24d839b..30e983204252 100644 --- a/x-pack/plugins/apm/scripts/test/jest.js +++ b/x-pack/plugins/apm/scripts/test/jest.js @@ -5,10 +5,8 @@ * 2.0. */ -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); +require('@kbn/babel-register').install(); -// eslint-disable-next-line import/no-extraneous-dependencies const { run } = require('jest'); process.env.NODE_ENV = process.env.NODE_ENV || 'test'; diff --git a/x-pack/plugins/apm/scripts/upload_telemetry_data.js b/x-pack/plugins/apm/scripts/upload_telemetry_data.js index e82e197097dd..c3ba54e11295 100644 --- a/x-pack/plugins/apm/scripts/upload_telemetry_data.js +++ b/x-pack/plugins/apm/scripts/upload_telemetry_data.js @@ -6,7 +6,5 @@ */ // compile typescript on the fly -// eslint-disable-next-line import/no-extraneous-dependencies -require('@kbn/optimizer').registerNodeAutoTranspilation(); - +require('@kbn/babel-register').install(); require('./upload_telemetry_data'); diff --git a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts index 1843affb9bfc..8496672e40f0 100644 --- a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts +++ b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { kibanaPackageJson } from '@kbn/utils'; +import { kibanaPackageJson } from '@kbn/repo-info'; import { GetDeprecationsContext } from '@kbn/core/server'; import { CloudSetup } from '@kbn/cloud-plugin/server'; diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index 17ee8b7bcadd..4bfe869c8373 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": [ "../../../typings/**/*", @@ -18,28 +16,69 @@ "server/**/*.json", ], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../../../src/plugins/inspector/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../actions/tsconfig.json" }, - { "path": "../alerting/tsconfig.json" }, - { "path": "../cloud/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../infra/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../maps/tsconfig.json" }, - { "path": "../ml/tsconfig.json" }, - { "path": "../observability/tsconfig.json" }, - { "path": "../reporting/tsconfig.json" }, - { "path": "../rule_registry/tsconfig.json" }, - { "path": "../security/tsconfig.json" }, - { "path": "../task_manager/tsconfig.json" }, - { "path": "../triggers_actions_ui/tsconfig.json" }, - { "path": "../fleet/tsconfig.json" } + "@kbn/core", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/home-plugin", + "@kbn/inspector-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/usage-collection-plugin", + "@kbn/actions-plugin", + "@kbn/alerting-plugin", + "@kbn/cloud-plugin", + "@kbn/features-plugin", + "@kbn/infra-plugin", + "@kbn/licensing-plugin", + "@kbn/maps-plugin", + "@kbn/ml-plugin", + "@kbn/observability-plugin", + "@kbn/rule-registry-plugin", + "@kbn/security-plugin", + "@kbn/task-manager-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/fleet-plugin", + "@kbn/io-ts-utils", + "@kbn/i18n", + "@kbn/es-query", + "@kbn/ui-theme", + "@kbn/apm-synthtrace", + "@kbn/lens-plugin", + "@kbn/unified-search-plugin", + "@kbn/share-plugin", + "@kbn/spaces-plugin", + "@kbn/data-views-plugin", + "@kbn/charts-plugin", + "@kbn/field-formats-plugin", + "@kbn/typed-react-router-config", + "@kbn/advanced-settings-plugin", + "@kbn/core-http-browser", + "@kbn/server-route-repository", + "@kbn/datemath", + "@kbn/utility-types", + "@kbn/i18n-react", + "@kbn/rule-data-utils", + "@kbn/core-lifecycle-browser", + "@kbn/shared-ux-page-kibana-template", + "@kbn/es-ui-shared-plugin", + "@kbn/es-types", + "@kbn/unified-field-list-plugin", + "@kbn/analytics", + "@kbn/rison", + "@kbn/safer-lodash-set", + "@kbn/config-schema", + "@kbn/repo-info", + "@kbn/apm-utils", + "@kbn/logging", + "@kbn/std", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/field-types", + "@kbn/core-http-server-mocks", + "@kbn/babel-register", + "@kbn/core-saved-objects-migration-server-internal", + "@kbn/core-elasticsearch-server", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/plugins/banners/tsconfig.json b/x-pack/plugins/banners/tsconfig.json index 77b896508fac..e79f9107075f 100644 --- a/x-pack/plugins/banners/tsconfig.json +++ b/x-pack/plugins/banners/tsconfig.json @@ -1,15 +1,18 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, + "outDir": "target/types", }, "include": ["public/**/*", "server/**/*", "common/**/*", "../../../typings/**/*"], "kbn_references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" } + "@kbn/core", + "@kbn/kibana-react-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/licensing-plugin", + "@kbn/config-schema", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", ] } diff --git a/x-pack/plugins/canvas/scripts/shareable_runtime.js b/x-pack/plugins/canvas/scripts/shareable_runtime.js index c143637a95f0..a0b8421f8da0 100644 --- a/x-pack/plugins/canvas/scripts/shareable_runtime.js +++ b/x-pack/plugins/canvas/scripts/shareable_runtime.js @@ -5,6 +5,8 @@ * 2.0. */ +require('@kbn/babel-register').install(); + const fs = require('fs'); const path = require('path'); const { pipeline } = require('stream'); @@ -53,7 +55,6 @@ run( execa.sync( process.execPath, [ - '--preserve-symlinks', require.resolve('webpack-dev-server/bin/webpack-dev-server'), '--config', webpackConfig, @@ -87,7 +88,6 @@ run( execa.sync( process.execPath, [ - '--preserve-symlinks', require.resolve('webpack/bin/webpack'), '--config', webpackConfig, diff --git a/x-pack/plugins/canvas/server/templates/assets/048ed81e-84ae-4a48-9c30-641cf72b0376.jpg b/x-pack/plugins/canvas/server/templates/assets/048ed81e-84ae-4a48-9c30-641cf72b0376.jpg new file mode 100644 index 0000000000000000000000000000000000000000..38988f948e8eadb18302703c11a490db2c860882 GIT binary patch literal 267384 zcmc${2|QHo`#(NoPa+v2TZPPMwS>v8Y$MxPl2o=ZieieQtfiX9zQ%+w##+f*Qd&^5 zZ`q=FAjl=)pghwQJWfv9fH~z{V&n8EyfOe_MEfJ`3tT-m#_F=ZJ91o?3 zzfDs51%*)0cMJTT@7Ridv4Vb4foY+kr}PU-Cu}zvTYUfVt^?J z-OhZvMnD|>k=??nhLJ;1;=Rx(O4sIk_IDlg{*QY0qhmk&)dFFnhJwkXW`!s~zBYP` ztH2=9m-?o%vvsK)$i#SWaYb4h>yXohJ0aUTTutC{RJi#U?W?Dd@x*u>1is>hkesTm zQG{^D^O^1QN}~U^vP8w|2L2P`)0?~JS@3maOL8#^t%t9Tq-bK=#Q7on(khYikUWj+rOL5 zP(tmJUoX8AkRM&qh1t>1n;lAO=<1d3@#LO=RCHl7)HaT%MiDBV_;y%xezJ{EUY0y= zt?v2S!A4Fe=g$^4_+giVx)ze(ssW0Qo+QZbU*iG3NL$&vudTLBppO}(f|h016u!o`C|60QP~NU z^&4-ZvkTH1x$Wk>T&UNfY8awa;f1gm`r3s5Zn_xZDfZz~H_?X}E`M$h-MlqEb}K9> zlq_8#wu%(Q;j5u43j(@Jn}O!tIA3F%o}$kN))u_72&Qmj6PVDVBgeGV}EYjS+3k;(ZWG&w@O$gBlA~ z%3#8|_K4VyD^6vc_Q-eDG;=;EU%HZ+R!BVrmC1S8UqEof?Q8UWkF%k?f9-Xa&hgLp zOU)kTIW!+aTyl0UP7Ck#u^*n7YQY0j;hauYRT{I9Rkb9Si8OoY9q~5nVBmif9>^~> zRxrJ$*neq%QihozugF&d?}oRc_yVSpKSy8MJ>70*`T17NI}-qRP+;4T0AAD->+q>ZY6;<)wacb{b| z+K-RseTR4mlX683`FoISh$3eU~Q#b`Og#NBGKi&GDuBT4s%cj`AuU+TAL z?9X31zQ03)(2*;WT|PlE>%``+M~+~ZOWH~WW4EZS{4lWny4kgdt))Gh0q;#a6*3Mj znV5foSqS5<5IlN818J=N-SB#fYx3H|!PC=@H&4Vi$F``p9MAmLu68T0`-|jAYwXcS zGa?y>rSguOP0_b(n-Y%hy&zOs@wK&pSKME`Uy(g|DL^5;EUO4Rnm~=O1EUnmgP!vy zRDnvH{X;_+9x9Sz-I5?!`_l-_L05L!b&%YfM~%x--%hbWta=rWiEOer2Il?j$p;Ni zbn09Zp7!h~4Ridf(D^yI9+~71f$`=qZ*Kda}o@u5XxFsXN07F7FAQEuJDZEARn&R)8q9Xq#3$BH3@{ zCJRnNL$tQN4O|zGLqO2J0)guC4-)^zMy$Bzted?3)I-Mr6Z_R31%se#4{5&7IR3oF z<7!T{mYUL(JL!BTF|1Y7%N8osdfHhQ;)Xq>EuvlPtn5&_SDUFoGVIk5wlJCHrEP*9DEKj=Lb-h~UcC}}Ho z2iA>lE)u2|rixZ%(cq<~b=G}OL+z<{n_?{&4VR4DH}_+mdDZ&1i}R6krC=t|wA=Zn z>?0dOrv!A}!fl~kiLIjmvO_HX$*vO^T2yO-RauCVp*#pqdI?DAk_Rq6c0F$o-t1VRYCcEApParP@UPaN~o4#tbg> zeM(ag{|;qC;aB{!bb>NXg^xKY$tf`6=4Tj^p~Ey7G0WGWN=lNzIAy-tlvTn5888TB zxya_za=(wn@nOVAHT_vETlVQfW@d(@m7+{>rGGGkx^%S~C5R)hJ1s>!36piUON{3# zPB=m^SmQs@Uqk6rz{WAY$l|cjkk1a)Z|!DEeIGhO%@s%Yp9CGzm->H5YnsB06J4+ez-p->}BpUpwRSSedr!?zllx2t}Nrqqh)E%txlv8U=h{qjO{GB}OiY0b2 zQ9#l%MO^Wj-J*v)@}Yh0g^?4%+-Hm!nqL_|MQ%~*52-j5@3-RCVcOzFNY0*L;NIFp zoBYPel4Q1HIzkz_qgyuyhTd>|ZO==mBg}5JAo=nCbR^&n?~7LZW3pG%DX4f`Sz}Er z$2LKWvd6tC$*T%Xf`6&Rk{=`Wnl))<3_L6R>3)OYRt&|ThUtIy9Xh4tQVC+gmv}pB z6tsA9;Gh*i6bn<7Dt-^+sJws&ildqrTPSWZ!uh{ChQoz|*H|CeCY?Jfe^Z*BU0RgU zfX%1g#zzsL0ZMN!?y?Lrg`n=4F}w?+#J9wUk!_~0Wkj|Fy$(}(=B<5(-dyi@0XS>0L#)b#1ulxp^I*Dp4+Je6KoKbu zFRoZf3!aN(=$iwVu{`$MhV#FvYOC|;QZH>T;=^H@ZJT?|WpLyQG29;;N%@&fQ2*Sc z+2wN5L!QgN)ZM|zmA8kc>m5X9AKU-eK!D+#%T4hQGrDME87csW0x|g^+i?USIon3qeheD8C&KyG?Q8GG5|<3O zVbQ63FPEKJ81zs)97!(`y1I&@HFgASQmrhJs4Nz~Qe|pzcHuJhn&B(_uE8(-;y&k( zC-?mk>=GGK;nZG@!ApjJNG;=^WQl!;lgQH@)_aOS`HtkrF(gxzrZ>MBhHdNl5qHCQ z5T?v-6Tb(?=xVBe0w!pX905GFA|tacg|1$q+aRI?5@`a5Q2+D;O44yuVcL!KcbFYp zBDFEjQ`Izi8*Y*=95&P>1SUWX&Mt<5`tNnb47HxR@K}w(AY~#a^ABtkJ8*wTs=tBy zlXLf6alW3648ZVH*-sGXOu~`@`VT%M$`X@i_b{)M{CBs}_kaHT@zYb>usPsWVAlFh zZpi4MUd;+bp?~W}ZqHNU$D&$uf<~|ECvaJ1NBJ4ZfYufoQ6tW+x0nK8Hv~@^)^{79 zqYH}6;;;7R=eIH z_oIf)&~?qn;@QlX21HghNp2;5spX0ET>AbDNe021f;ikr`Fe9DSvY`{zgH3hEXCA7w2NYAc27NsrX3@+pKhhfRI79n~_!Ei(fZsBB{@21FatF{Q ze3h9Q(aHD`) zVObE86<1J)QgMdhSt_IFXpG(5>H;w(zkpII+|6BrM{M$5iWblb@N~J6lQB7FK!AQ9 zV$yuT!J$%a=#}!lniS}2gZArEtt3(w&5VA#lvY9goo*)aHombktjuGn2ljFBD)W9t zsyo=1oLs$ylE9NBJm3pmBK6Cl&7aPv7he|+*47gGBd}jC)H>Ita-~E*HTcs)03El) zAuPT}3`P1KKO>V>>bN>NND|%e=Q+kzmGLhP%Q9aI?AftB8WR6er~fn{Kfha3&=Sfs zH-QxUjMHkbcOb{nE(Ra}Kx@#nj-u$6I?$!>kCJRHq~#Ec!wy*9r1 z#AQd20e~ZyjQyHo0BRs0zwY(RlsIzgIw6N+DAADO0R4hSEi%r_O}k0fC42UVt=TS) zrWdNOb8bdnzrH!aCckvh(00kQ7TO!;{mHkAXKIlq{cDl?Il^-YoPEdo?1J3RZf<{L zW`#|-Rm{M@gfvS>8lDyv9(^e(TjSD6xvbZl%5Lm9u~vX74dUvJq`M>0E!Y))jq$9W z%CA29Kkd!D1zCzr{sYImQqU=%MKlsb_s~D|<=?MY8?2)rg=wbnz6cPc&I4TPWmXT= zX@HbDlb#~8*3ECPp|dYvt<3Lf=h2w#eG(qIi{DxPlo#HnHg0J{fpi1$g%B;nxBa0n zh)?R4Z?EV-aQwp5*?x0TOMsj$%>s|X81CZ1)ED<1-gOeN2Y=OrWeRsp(vx1UD&ybSQwmT( z%cz?98L9`e<;Qg9K-AQDuPmKT_PuR-&o>+Q9`@4Jgcs5HtG!oT=PfRgwkdEeABm{8 zY_xxN$R*?ShObwRKM749Kj~6?%v6oWxo>n@w4^{!bsvP*szysAtw~}4*!ImUvCwZn zBSyL7Q%;z1o^TQk(y}lP)>>Xw15%MoCRIcwV!iAU_b=2@{>!b*-%7z5F0>P!%tDm7 zOM8#D<6`!8g$Y@qtaFCDPQ6$NB0rxfrH)!=6DYp&hZw}&$`{^zHZcxgYd;Z3?UKV? zn4&RfOHJlcg(t@xvl8yfM#;IZ9@8wx6abLG0q{pL+x{M(t%&_dFQ&MitJ_$8YH$7- zHUcBB3qa0~)-M-kq%lJ?%3Fie;lpC-%-^(k@tUuMl7T^d3XM$*sPmE6dHf)9&<8~1HB?G=;hf0DCQ!Ij-)>ByCr*Ji4OjR^9wxX^LS($NO#p>!m)rx%X zFkZzU_8V-m+*i)2I3cy-R%(S;h!;U0V+;MAa2d)Rk)|Kq&yxvg=D8kI-@KJsc*D%h z=H5!vI1hJp;0Nr!aat&juPl3-7Xs?HlBu`KuuVKc2bakF@1FkOoY#6hcB#c=4o><+ zU4++`WhM(nzE|Yc5f(&+CAARxss{lL;x6gDvYr`jRZHwUURB#kVyfCfR& z1%nFW#YHR~sl8(8?DhpCt^9adn|AmxL*HL5gn+r!g`$-ZH{3T!wH3IZT^Eq#%I~_G zGXD_wV=v6G3*iREuNQlFc5@-kq^E7EL?|ivVhuoemz z2wsG=FkvUWvoKBFyh6nh0Ez~RAV2;K>;7BAwV?lO6vk-D!<~2}Pm(@8|Ee{1m*qR; znMA~EXNiw{J+cE0+C~(xGq>{ZnBZF2yBVZ+Mn*NhSAiJ`{L>Tu{`+qpxZjV$%2E0A z=dkM*8o$Yxp)=_@IXhts_70`QtMVJy6cxk}R`_Rl zQ#`V=yOgw-4)A$%I2TltR#Vj|a>jcK`X2IC>?=0r@!p3!DQdmrMXHGF}h}=OS|gh?!L^)9=oqgK*24vL&u&rMMwp5+g;tHKZZu zwngjU)Nm@n;=V>qEcso!RQv9W8qpf_tOrV3AF<(;>}MVEh+x$nL$1ND^=E%$?tkY7 zes_MCyzZst1`_cJi8BmR6w*GU1}j@ow-v5wP6hw^oKv89pbigqWt|H;X)UDGcAQkX zb;G^OnFl`}Nm(GR)0~~fOq-7#O%F;nNsVA?+L;en<_6SHpg5#MTyVN-a=x}iF8a;O zWo5Yo{9VsskaVJk5e@60#xK4T0Wz1bexp3AMe8fixeI(;Vo?69r@!huFoS`DlD0;erHW}lSoF1H5Szo^-$be7 z4MWFi&cXh<_RaRI&(!uQ4PX2lEh|<@Zv5%D*{Azkorm0v&cW(xi(nb}TX9}}pbl?I zfeM^vY|)}E&Sz7=k^=NOSTOGq=ivId=?OCJ}tFB6WRzM0lNv>8sOcqJ{i$4`bqR*EXbcX)}=2M+LG9 z#Kn1lsgb~#Eia5-kl5w0a1mzx|8V4eHBOo7U1GD2w~5UfJFyOo?%)OmlLatlW7geI?~%4;V_)= zhIb%4HBCSyx0^{(dO*DKR(3uph^2(ZzuE#cg%8~xr?GKp4k_U>he#jQ&W!RxM`bz$m_hE=*mbC67<39m)}rP5U;ctD4$&sjVcv z>?Zf}!;4CZs}+wgSGhSAq+nnWB0`E`^9&zMAMvW)lLHuKWF*0Aj5BE%*m`;iim?77 z8dSJ>p6^F&3ex=)-p>S1FR>7IuFN-~hqvr!ecJy^4uG@n|X6cxi?jieXJ2Pw(d6E!kMAmN3c)m7HIwGbbDoO||FQfNi7T_1Fy;f@#_| z%2lB#fh4LF%jPNGboP%G>C2+#gqY_N29I?ngVv+L&+YQf&9rI`u=y{k&^Kx#W#Jr>>*5Uy-_FlpXm^n#QO{KzY_AK z0u+l60Sm8?HG%KzQzn+i&vUiu+@KT+WIrf585{s63&{}5N6MNp7(hCT#mgT<0V8n` zz_!C6tWgvVSz`2mO4=fjhj0>Km8=nD_WlDm2`4=h*l_?~Ci)bN=RBV5ythZ2# zWqjc`VcOghp+9}qN@MnqpW%WC$l^kg2+uvVKgD&P4WWpF4r>U1q-dUWrP}A!mYpPJ zhjS+Gl(662qU_o9+|uW(tHBcQ`HwAF@YiY|6gK@A`))w6_Wi@lha5L^%(>2RZyU-yOkivDb6`KHkCM;RQwq)x6CvBL&AKF`O|B~h5>fXDzDR)15 z>gRcOBDrrBWd65+ZrOFDi;s^Tym@+LF69#UUVYw)LPufOa6^~3_hN<|-@wX(dV)Uq zZ*xM+4)OY4*vtEi%~)we=02m7Uqb_tqv&?!K+{(n4rYnuQYROg4=S$zNA>v+$B+_f zRw`11y1G?VXmOd+Pdf(Ziu)0l!nx4cmwj>z>>@FaX@R9f0pbP{4{RI?VY@{9!vPdW z%)wV(P@Sad(}zI}3Z#l{zh^X6w&v-i{}`lf*&zS>$)XYmwlxAI`d0Ja-jpvvt@NVz z_{k)%%$v;7T=Tg>+9jrP-onJP;vK#~WgUI|F`<99XDSHJCB0v5co)u*RQ;!NnTELo zYM1f`z{61c($^A(jy6|{X`la*8KL|rw#U6oE&B{M|6J0q_Wz$evSt&W`8PFOR6j;% zagvQ>!H2mO22Qw$<4O)2*1VTEG(&%H<{Uz`*fj5NkwfgZ7|<=2vK3^WJka= zzkT$ge%)@fp)s11MsJ$g-i#5C7?&QiWwzW{=FnEtE#+|X^w6tWmEFyCjb6y6=bxjW zz`lOqHr|&hcWwBHf{l)ep%?9;J&3mFpF3&;cFt^fd8LDr4NZvT8M3&*q82!w*HyBQ zNv~Uo=NZ{oIC$*B?jsfqr7FdIs7ZqEVh<=AIQ-mo>K@e91v9#)pizrOnI8rOV{S+QPr2F$KX91vqc-k4PIzQ}hd>iQAIrI{&_0b=_i&Sg3$vvlxOiKYYvX6uOJCH@^&1>DBa!%w zfSGFd><+}>k(c__)&X1O;62Qi+kp&JTgZLQI1WC4W~)s`;(h%hGPaeBh#uinb`Wk1 z%BZg9DN!wvqqA)_$#C$F?h+`lbH>L;^@S@9f1p3 zOb{$?fIumk52bQlH0`T88RN(IA7;kBe3Tp0Vn)r`gHM3C@~mf(fF1+Z1VSmXAaMvn zG>ZDfii5 zmJ5(h=|OG(SKr#?L)pr0fW16jXqOR$d^Ll3MzNt113+XuTwP1lj%`1D>QfW{oGrv@ z-SH~791o2yy0DpY7U-Q2Fv_3gT8T-JGEZ!RMES5Lo*!JUHvzr{o zcysH&&=*#hPqB{VlZfFPr3VkaxH+sAJzF)XCeybqsm$Uz6ALLvq&aSOcWruBZ{DCr zzCS^)vW)CBpvD`;^XcI&vdZ`j!bBO!`{-ztC)x6GWlZ*{kjS=MwBnV#B?_CUo5N)z zr+8|3FjefwE5Ac*#uF;dt1UdqCt}~CFJ7%l&C&^YKZEhxCgYyHPPw>2q>v-TeWb{; zHswM^o6RT6#g?DqE)t8d`{msX6_8hz0!pF_uWG}Y(IW#=9)yOSv-PLRaY)UA|U#+H6+G+55LveJl?b~5B_(u8K z+4@VjXGCH~&A$Q$&R=)ug(~$tW~`x$PhHf}_WB2kIlXdx*oLE}Pb3`3q%ztk$O3#V zm+^Q{>IgZ(kykn)bgj%x@)w5wVgs8}I~}Q+*v1I>M%m{b3IVXwa;dRVZeO&8C7ir$ zE{s-iS2=*?g-%{4J#x5bQZod2^vYNK)Hux=0^^^fjuZ(7(y!qAbBcR~h$x9N9jG^_Z zu6oM()|u3X%NhzdAAgW`E-^i=aNhrUdse?vvAnME1%7`FSEk-voUuz+2xB~+Na=%G zL5p8|y_1)4kvYlW;lau4tTpT5Pm>7l~A?{b9 z`5ZDzPVmT4Qh}D~JZXw0f*$g};J=+ja-|NMq_V#Z6FQ|>NYUwfUVDhW9QR#VC_TI+K<+yPg$dvVf87V948N?mW~1bfvkf<0 zVVB_eti@CtA8xE@157NwUZUmXnK>XFj#HcqDf-?f*uN~#X!60?uWr2-*)MIEpw_d& z;;}|ZU?}I&Zdhji6(m@W^bbgP#eI$JDl5ZM6Hg)Bg{?T_ zYR~)0hhA1HB9oH=!UxqNf5))QM@JI^t1YF1s+V4z{nPT3`MQ&T$pFl;1OTmq+z-iK z?kmxt@&Z_(e8~PKM~G?-0>c>QK8PQi?1}%(=efP+5Jwxn%SM2Gs|kl`Y_}pIc;3ts zd2hb;RIJL-AhTe<>h3ygHB7Ow_9|Aydxs=OGu;fn(2M#9K9LyROy; zR*AlSHRU?ldjQNqukPym>k+f zbWaFkJtBkE)cf{i2yNcUm2l4eFv>C$9uvEI=ZLYd7QHd6;K zAq*^Kt7)PskI_3dk!bEe2Hi@qzV)Of9zgCYSBRU2e@BKe#p@mf-|Z=esMoUAQob&- z7E-P0KNz=`oAO(*3C^0Mla4AXDiGs&S-GMuuJ!Xva8*heJ5pO*kqx-LaN(2+agQ7^ zPoelo64z~iTdEA8a2z{FdcD`&zEZa1_5Fh$8+xTv$Mm#vCm_OrPEo}UiEF6SOl5;4 zCWRaLbya6<`PHEU4uy8#R~N~p2Z0mOD!9HK=)StSX8tgv4)xp~C6uiJp+y63j0;)9 zRk%FFdCDqG_ML>x=hDH(9Ooc@_%mW^bhrOLDdg`)s7)y~bN^e*sTmN;zib_HD52AH zk7)5iCEZH?kCHXud3nIDH^GMg3dmSNUpha`g+8rh*{|;YNj@n!)DlBuMV6oEPnXJ` z$U8}6E7zZE`cYtMI~)YgMB~?IfpJ4$*p0rxqR8HtM$UE2jzb;Rf1p>PL7RGU>iMOP z2)=B#N_@4r=Dmpz*^Q-K-yw`)J6x-U(eToy+0gOprFKn6c32aS7*L#5jJewZvgk#h zCX1Nd%e{MZx>Rq`o4AZ%kWJbyVjMO8&H))3ywTX~ODA<-Cd929PpJ3~v0@?aw$*uD zhA?x(TX~@~f(c!nA5-$&^Z=+sV?z+iI*#!*R9>;Qx90A4GFJx8CEhwtET0TbIi9k6 zq)I7jPeNSr0jnxIpgCBUrUQhBEDsUs--h*0%Y91{-#ja_>(Kq{@}KuPst#m4Y4MwF z5OO+@^@xv9YiI)BWVBOX_Gt(1PAPASUAmq;&<@oQ-X|tr{_y?bH2%<6eAz-4$m>#5 z=+gou*o=`T<}NY3lI=7#Pohd5JKxPw!^qy8HE&Ik*ISgEs?34%Ht>PUdUKywns_{6I?!Ra`ywlL#dC(MNrtgcU#35~)WjM|FTFf5~q&T}q7 z%$KCc!kI0jP{8S5?ujyjY83Aj!ZCm&}}WsXCtl#Aica1s-OuI`DZ*iaB;NKQ3O30EV1 zYf!2PIQbyb8wV#2MPk8yb(-b9%E96K7W-N3!}so5X@tB}HAAtAJpywka=@X=RW1;_ z4h&C_uUqY@iB$0PP<^snO;&r>&$kf*eLTC+c5iawrU*@ax_En3sa$e5XNwcT z`if~SxMe7fKE4(pMVrE{cd%-3YMwe<(w<_TI7Y`PEE6D}6GEwgJ@*H`3h^D{(jifX z<*6y7n(4S$D_SAykFf2gz%9xj5k+`>kUt!18y^MSK|Nl)9V`xzu_@%1>(ADuIXhP% zGFJ#VX99mik(%;Yc|-dyVGu67w>92@!VA*r(>s#R3(wUhfm={y;bhmyhER<0=H=j^)sPk20Z+SjNB)3?tt16F3qV#kF9J{s>LO$p->N4T%+c`Yk3`B98Q z?{sNdxy&jicCnOjyXDh|w58XlHEeF1n6|W<9(~naDpVe0iaMixI6$e`vgT!mqLcVU9Zucoxj8W{ zsQG1c)$6YYnN8<_VU!rq5sjh4yykMam8LDj{N%m<&QxZ=B?=2w14?T;Vk`x4Rf##u z%~d*fXRg!RnF7*pUyDtSCRw~A_F4AR;$83deNq#ZEl=Db7B@L%5Y+5{K8@+?utrZ% zwFU82VexCRy*Wx9V<|>^jVeV1WTGrz*LBZeU~$bhuXRxR-DJ}S1sM>uMOu}fZuFWG zBY)iYN$ZP8^Nd{tK}XkP6W8?t+f5{xsTf}yTDGawj-;|379VsH7-32POdnTa7=MH5 zeyvU3;K4Zv=Nm}SGZWG$RF|@IP(o7OFwZc5gw&M5fu7(<;Ld?r=Yatx5HZTz@&j_wLPguYdd6`6_2;F z4kYN?Ce0@s=ILVLNP8H7OZF24; zvEl8@KA_)3fO*^ytmO}bYIK@MwNuGV$PcP%gzDG0VBAR-;Y|5P0cW>50~^`;R=K{< zRStGDmwj4Z1W)&;>LAgmQ8;8SbAL!1Iq)$$7q#5t`) zYzplzUHJ}qpmP*i^|9fSiEQr1yrAF&SWd=F)NH7S^}WGjexqwMkMNh~py^4QDd2@4 zveX9L(;K(Fniqsm;OYT4vG=fv`8tiz*LFT-Px(RNBfQ~t|MPv~8d>eRZ?r2f@bEZl z&fIF^b7L}`VhCt``K)<#Qm;E^+Ncxrb%dohVoGY}_E){3t$c4Ik5K&l(U|evhv!ed zzxn|&Xhv@|gK%TGnj5j7WscWR0{aq4XLJmWdeq(`vwXq1m++RPR*WIPLw5K-LJv*M zY>(UL4%o+7vw+9+jS0;~+E{D4Di1)97jD0Bc8sgd9nkyU@|`d@=`m(ZBsYsYyh%s< zq{omb8E~Of^xujVY^Vwo%h$z>otns~uYF}2OkWoj0@|1jZYGyF#WNA!9(qdd>z(Uo zU&tr)Yt97AK-@#!q}OSm>Xqc1*1H!&c%wEG7E6A@sBr&!ANDJne1>155=)u(!GzgY zRa3{WP;1b~_XOBLdTv&pqWF%pTEz8x%0%K&T3>5b_(8lq{Hmn^_RW1k!L^eGn+Y|*jIeL^5kt0<@-Gzzkjw@ z;klN*>|H(Fv1eP!=`ZIzV&fE4jt=8zp`%j4_e{v`0+;rKQi-=Q<7s5NQLpi&8JzZD zl-%Y0ty#Oxhbwkfxz?UkJ(h;k$>K-Jd9yf_1K)j$k`S>ZCraKy$nG;A4-oUOa+P#z z=(zvn(@tR^sR;vvxApFBxWVL-m{!u}?*oh3Uo-Ah_y}cSnB-Lqk`R|n_XEFuIFNwsi8hjSt22?Em=Te?j3Z}mi6^efdu*FR zM)PMMWk{a)(tKqqSO7kr!{C({Qo4YLr$jIM$q7N@%;uaQqDuFQfalxu+%8vBne&i+ zz}bWJ62`+bz^_B%&H&H;b9uum@1t5+6e?zh9KSh6e5;hQyf=|-yXf0fF5kZG z&tagOu5m`*l5lRkM8O2&i!*|VGCDzvz`8a-%}{C;IA4y#mT!QIP!x_6rWE)fSz~1k zqp5|drITuBB_O@ZxXYbAT%7ZJ`z=NQqzk)2jfTG9?g~xbG)bp@y4!{fh}3)I!)2m5 zi?w(odj;KLnED7AE=_JJ6yTMOQd^j(4N|B?Ix}?k_3gH`%1HF9iwc(!J~hgjVW?Y3 zOY1pc+rxINY^~)N8(tCP^m<7hcBeJL2*bD3w3~7e|&$upQ3$I+@zbyMPHwCmxiZypeQEK2z-m+JVZxL+o_g$b-k`cw74UsTi#G&%JwVDnn&?RzC6jc;bR>YJ zziqFl#NdS~Ybt~Uz}86oSIDwjmZEL|}pQleP^pVnHP&g6KGhVS~n) z&Ej!@RCyu7)(l+Tq5A zACF4~*QYs@H$WIU{zq;hO(V~(7?cuUk%)2lahEca1h zI%X%{uffi+&gxi-$qu3GlQkh(?GZMGr~D+fUqwY?#F*1?9!A&s4`0IX-jdQPH|Q~i zm^t(%W#hs9HC~g3ZVcyy-bD9dTRURHpC-` zC@!GisFJoXN2Enr;WB@6LNLLZ*_9+Z_bsw_>`u~lW981%DD2bkkb|C+ILuSp)N?j_ z!mkoMMC6OUL*CwrcqtGMpN6mZaKF`A!}e-ddau#bs*e_lvlY=_ubkFX6YKK{nh@=* zGtCukjCrUh=Nwy-b4CVVqqYZrB!%!0<=^>;_{Qt}Z(G&6N}FNsFa}HBjj+$+sB7Ae6+2z83aW>#_gJT3F~LPjMb5H)H30u3 z3UAn~gp^s=QB=2~E2DMQxoNw)1FsvSv)Ut_!pLsbGpSDl*MQ`dJ#L*JCD6$`ny5k~1l;ReB2&PkKy{|(QMB6HFY2U|HZ(IL?;a|~?a(ZG zn%LTBYG0oU^N$Y?KP)Bb>@^0$)Fj;j1hiu3eitg^YOKGAt*W>|p4S^(_?jRoETMj{ zV~Ws&xHw6tv~PyV?*^xGrqkd@pUH%bv7gv0-Ec_iRdIZ)I|2K+ccvkd;Zw_dNIzA+VbPu zPa0j(c*!}IxTzx3j5?_Dyu^dStqWZ_=q^hfP(R zY#$S>ACmK#6O~-A%4gskFUFk3DTm2F*?VsPMyZE;Qm%M6^=xX_O&pSSt=|d56(2sM z;&3pJRpSduFDS^M7Xv}!CFN+(swRZ@O7tb#TsYmYcR%C}F1PN1#U4625n*h}g$w}! zx^$(i_8?!Gy6Fy(ZEyg>@Yn*Ws#oe5b;!f~Yn_XmUO7*EP?VPE*$*Ih;UM=dAu{w1 zg0itH>Ms71=A0Rq@m zyd72@wWFNV+Q3);+`%{Lr5v*@$j)y)bmT1Zc1E=!4(D&yy=6+wl~Ok#XZIY$uRY8M z6z$dA5q=o|23sm)h`3JcxPp@A&GAi14`J()E&;$cCCV$Ep#p;DXt_T9{F&IBH_2wM zSgn(1T$vhupMi*jRIY=FC0h>{BX>R=6>epBy$O;(X5H|dd%SdZ;tpzhQPuHr2{Nxh zW;#4W2oMgD)N#d|&aHFhvZjZ{Xg21B&A#c^=pu3im^~`Ec}%nR!htbl#%Upt%@4sF zADs|mIzOrb=%`%U`%jc=gEH9a&h1hUs}c~lDHN?E?M){?$7A*6?nxI_@C5OTdKI)p zYlCveV~6WOy(U;X2KH+K%mdh#D;}o`HhHehu6YO!> zWj(*Q&^*1n7^SX$)Wos`i3XHw?18pj6$pxgSfojwSp%^O+^35>?0r{|pdTNu-l(D` zB6u{zzZ03<2dyM>rdbN)Vznqhf)~09oLIy;b4Ma2T-O!XHg0~XOO3EoT03d*8Y6HP zl+2`{=Y54ZE9NOW9WK~g?Q*YB097iiu zt%NfmM=+?dr0ko+lMVL69Z^zKy2lYx1Qu-!@bzgRX!P68Hj;2o2}R-}m5Hf25cFN9 z^x+Aiw1A`zrFiAMkg{7sO?R_>e0esl?Y^1o1xiZ2Z>sRbNk2Bgp9B5?1u_N(AOWZE z>{e4oT@T*PlUPO|1f8K!U(xr<5L0q}ti6Tkq^1YHdgxS3*}B}RIx?F1d>|moNT()J zY%?sCk1`PrSx-%n3|c7;(eQeeUERR_0sPGUEz}YPmj=$|VYQFAu&1AK8W6sQ+ipJr zwD?eCO@M2}(6J7p-90U?N9aCKu0*=_sbeg|psph}oD^^{@Xmo#9*hlU@p)qBv)C;x zHM``_3TT8T%j~OvohWsRg?PLHGcNQ&kgO(_JA!#_djxss9!77X^CKxKlJH4OKPhix zcFNA6*OzXz+@j>vGc*|*?r$I+S&N;PCXF1>Fm%fbqC}JR*GV!w4AGzOJW{?fjjT#e z6x}kcVGwXY;l!@=?l-8=?+{w;hX-zzC@}WrLhEn>SCCx+w@Jf*+r5+iboLdQ-%o=t zbR+V_-usqSt{ASwK}o)+E@E}seuwD!ub^^`Iu(SDX-~6`!&;6ts<^?!mN%M zkFlkaqeM0-&K}twj39{9rLhAERjq3>AHsC+9+<&6a|{+kwt7BzmGXfVZ)U^J*Wnto z#(abM>-BDo;T6I8!>_(WWS{Ia{KBFh`hhfcG^SQ1*KxqE_)gwQ`kkZ%e(ck9eyIcY zoW+G!C)#el={Zr1-qQNm(ZuDU&s)^z3)}fdnoTRbp~z(XDaHe(Bj|!mfyXgOy45C^Tu3qg;42+Rmr`Qaad@>S{A#N@QomMe% z*^;)-rN3wz0a8(|PO4cRmVP_#tph$S1$a&wM z5=SioSSZt*ygHX>R$t5}Pp3-hT@bVXCZB4@r>3g+wI9yWbhZL@_{r35ro7C*ywLEB$ z-P<+gKcD-V6bS;aNu*L}iXLKynUsgzfdcq*kv>v-v~B`BASi z*du3T64;o)oo(vsr{q58{$f#(9vmw{Ce?-7$W~KFeh3GU6htSGfeT!uEiL))X4a`E z$PHY$(Y+Zs!jd8JLmV`{6JGLHGc8j)JH50JjU040|^V!Ss|a-UcOB66rFOMZ5|Bj(tgZNEe3qQ3&;k4*NKagYiQ{mc5>?Y!mMkXMyprNZhw0MU$Y4;E}*G+*XWI}GR~NDE?+JEmc)aw*b; z=Iu3j+6~*%3?1IsWAKflQFL}ntV39nKoix%3&q--_v@Dn%W$o67>cW}X?`L*83B5V|&avx4fHs zHm-a3X}!8ARRVJ=eQk0G4lupD)WaWrc9pbK03|~8+=VG1_rq9sTOMTV1J0>|%m_$U zOcf@t^Q~-f5cTB(E1;m;^Kw*6L0JnGkbMN_2au;e4rh*!ER~qV7-LK+`3)I;2@V|M z2}p#1{5EGNScwXfw9h5j%6G!v#*7VMOhNi*KL0e1iZ%zyBKIm+_YT(_)q@qUc9zW1 za2mNW0&)*BEU$zJw8XEQ15rLaUzs}Gh@3w0;OFyy0 zLR`=Fi)L1PPVm#_%q;d35)ZhXIC3WA2dqD7MY``tXB0&BCDfki?M~CfFf~`UdyZ$g z-_=RsYuB-IO0(-NMCGPqqXrXdSr6~``dU9oEZVmVlU#RX&6JVTcFUNC9j+%iih4iZ zDKb%nK{@$RH+Lqev?Nf)W(OSDg}PO#bT&ojqhbEo1;|s*>Fr6z-eUkh5Qpun?^-;} zA{-T*Fq026!{`k|@Qv+Nt_-T91 znVkdWu=>M?kCn+WQZ=(G4x$-Er;ig&g6M|4kz+~UuFt&xYCv(RyDo2M+vTM8{-E)f zX~j!+7(P+1Qg(hqX!HZc%ua?gT>}WNRxdwlE=5%QPC`HmRz>vu5%+ zN8^JcL(u!}dVwgan&oj;RRZpKn5AF8)KZ|ARf?~{X`P5O-hxBnim-G>b394-zPL+F z8=6hv9M>HjKhtpymgw&Fj}r}2-ruNwAd)t|H#UzrT|9G)WEo}Lt?+`rF_!ExiTQR& zN%Gpq-itw>`VCHav1b;zbQ+`<5A7!jJ%}bdzRmioM?SMpQh_o5Iq!fZl2rL{eShAA z<1fEMPLF{Un3i5mx#pF*WP*#Ep_`JEe|#Vh*o31e-|2?RW=>+9m6*d zc`&*w4mhH9LD~?I{rhkbTeVq%F;LMlz6F^mNGli<3YkMvEbfSA>Xc&C4enj43Tzq$ zP`WBtdy{5<3!VD<*G%?=I~eT7GQB1@EGYkY(j}ZSy$+Qt$~X9}-p#PyF4~RDO|JjW zEo4TBrETWug)p_+v^Ev%ROPpHlQ_9lM9oR(6B2Wc1%$X7s7W#qh4jLr*=p}b`lC}z z@n0r&GdqD?Y`?rgvL(PHhv%8yQ$UqGm+LQcj6xx=b7i$(9Y!O7?T~T`e!vcPg#gJ3 z;I?q67jBefvHqSaR||r5UJ>3aD~8;DLX>|MMwgDdca$W_yVcLDsqwZ)I={P zAOHmk%7A!Y#0z0jRz@d0q_+tu!-QHQEHA0 zAEJH_8F^JghXMPHA=sR;wQ*Si8Qholl4>08)&#D#Q8}^G+r=hmur@1o|MqXnI|363 zHYs=1v+rWnoc4iIZ1aCw%<}))_v}00g!Se%PjKe9=40z(-$+2gt{m2c6v7upCSnSW zT4sfM_{jew?5v}r{M&Uuh=3x3lrl5|Qi2jAEuqxVDFQ0eGlam<2oi!ibc#bt4MRyc zf=D+*NUC&$lt}*0cYOD|&pvzYbIu>nTCj}8JUnsV*ZsM!yO-pGQyUVfx}OuBCMJa= zE2SR0uiUSoS>v+4?J&b{RqbIeU?@1`@`LUlNR0mq*&3htbKeK|1bC(rS&%Kpi>T=P zl~$cM^1zw@E9l^tXkKKrRw_9x@8cfY(NVbNnP_;NA@7J!9pur6jWWT58x3rMs-3hs zj3yGe@sc1Nh5bd4^Lq&rbzoe>#5TqfyvZwxnejRor@pNAaaL>b^S}81yG^Y4Vm;wv z)RhAdF(6<6CeSTLF%ycV3{R85dmCRuGfe29bBPZL$ioLEV)*>Ozgpx%0MaIJ1;;QK zq`KNG{5_Om8~mOzkHB>eis=KO0TEET&f}}~VM>Itj0bpdSaUpahbqCtzF~ZFeMbvr z(psh7T?4Zm@Y*X7piS8UJuz&EnJ#BA>IF?klNK^T#czK;)915z zj}k}7O6C}Mt+zP{zH_2dVs0;!WHlQk1pv zMPGANCtAK4M7J|>qqHx*JA5k#|Abgz?P{FpZ_DaLy>2rNR%U(H7r4JvHQ(G%iC7OF zvH3XWkT)2me^Zc=X8a3uA2+N~ZT3r!airzWuVomM-tR)E*EbXkJ>-QhP_-Jqu8wko zwDa4Y5E{BX$Hs15bqiSK1JLWa1l)OWY=CaHz6TcTj28F>JzH5mpD^hwfd^l1vqc*u-mJmXmc zEO(d9#B-wi;Q2s~!T0lu0~*$F?Xh&;xKc0Eb_SZGGka~#yGlIU)LK$5kEuB`XUEwz z45t+9)ozpe*+UBom=uRRm4A*nR$nL$g0z#sVL#CqCfliS^igz)c~iO0t?nI2>zTgK z|3Idr-me?G3XHET$3D`SifeuJ#UtY(*`Sddrf8}hkS%xZ@2Pnf--|iO-xP>E$VRAq zOv&%s>Un=duP1gh)_0UAPGZ@ebNXf}1KGN+x}aLT_HD@;K+f8}OW#?_Eayv8YY`p?@GoL74>`;8m+{Hxdsq z&Os>8XGa*8l##J!I3sHVBBRnj;xL4fxQB?-JiW{GIo;2U1IU>jCtd08cqf~_c2Z0Q zsBY5yjQ|OL^LHQ)0kU%W80hHP{rXXu zWZlv}#fKs9IAO^ilzM*WBeN1)C_|5vz=J%lBbOgywP>-6d4|&FOO`gH)s&RG2B675kKf7#+{`I7&6$Iv$FK?gI zF@?W^p7O`rH=?2?24G~IAKQfVjv}B!X2r6|Tk)(7hDs{XBOny|fDStIGT+pIKT>R4 zD}xM76U&z?IV7@m(|-CP#Lce~(#NyyQjYyevkW+rZU{!1m^G^dUU3N2npx2GKWKO6 zW+6g4EU>l)3F|%MT|;_iXE-+>gI4-}^lLfK9o)@o5upcp$0-IHcUygQM1Xd7pka&A zX}Sv~=3yS~tXSo0=YDNvn}~B1Y>)GWZck=SY(IKY^fFX;S@~$-fgy_&N>e)6h!cpa z91*76D)X9_=DDZ}J>I#gmauXh{3-OdnfD@NN5Qzj6~1@A5@1^9KO9FI&1 zw#0?c4`Ybqi%J_B|D5uRceWdxGmkFD3!xt7P~JNiBjZa|GI^EEOcbS{wn#KM7qG|= z^eTGz^380wsYujAzZFW|Bv94Wlldck?n;Lb>i(5UaL+20%D)FdRaioSM7tVKSjBaz zO$savCgS^P@c~ZBOEhveUkzggl-m5AyB<5qQ=kZ>FFTSZgVk_e6NW9pp_*u zF0EbHo8j;O2LdE80^5CXGyITv9TbLudcU~)Ch`2oyWHXG6a73!BX&SUxA>s+fOEs5 zD}3j8@Gj8Tv?8RyacCQEk*l9FQf?e{K%7PrkJe$kvB~j%?ji-%V&KVq-*w(}?T&|b)8KFl^$E*v9R-7TG4n5lW zuL)~`^AB^TAq;l8>1ySdfU^Hn>Tf=M#{XVqLhgnfxS2^&&P=3<<)k<7R%KtH9$|#A zJZ6arq`+QeZBN#+x!snO$h8nRf+57u{QqbMc>d#{ye^&#{}0z1-%i$jmq=0{z{CBw zK?G`Jpi_-?{=e<}*#u5C6W4ZAtORa8@CXbc3cyI_(R}6l?g-8yWl%je{2-wE!SG~` zsTxxbBBzdIphyVxH2S^j041p zhM*|+#b3Ezy}6k(w9NXIUX90mf}d$!6Cu(%Uvy#diMpVGxJg91Y#F)^FRbx1ON$;I^}fF}Cf4h;Ljg`B^5ZH+G+_23>N$Kpr@lt(%XF2NYn zVjzw}QW01jGXUbjlLS6JNiUuLJb{=m)>(pTyIHln5a5$Fpj|Xs-(*sE75uAPKlI*K zU!)yestCC(Zl#_VLpk8%{`guYylTrnlR-_k%RLhf#%W;WfZ)!3B#mr&d@xsqeO+D~ zzN2djRi|YgSp?_j*r?aU_j)t5&n!wKE`{5zQ0DrwOzEAE17}H*!So`4By_XSncx0- zY*E;T#U|Z1`3!d%*DCz+APLi`tq1!T zsw%HKYbT9wJ^hL9$D9*EsUIrHzVU%OZmHZfC7FI^`vz&fKqiCIX>tAWdGi!T`&81x zWB&dDL(D`NZP&VLQ0vgP!y9sG2oe@7c{Z=->XR~@74bvHl8lZnp<_wHa`xTv2=zPL z=s+ggaf_lhh*2-v%!hoe^f}%0pj*So29o11a~K?)s8OYnehBcuh<1Pe$1p6c<}gK- zZ0rNeS%Y5Iw$0=##(|`YV%SYq3mn&$#B!x+U1_DE$d$xn#t?T?i6sx?cURZfjq5_@ zx;S>jLN?d$lIZB*O&nOpGVlN(Xij zLxyceU*twvmDh(`Cc+FOeW?#}VLWt)l(vH(w2*c-5yI~|SyR^v?Z0Ille@*#S^C7p z#H7t7J*=`C_%w(3#WK~?nNN>OgegQK_+YLPM6Q&ss9-e7w{B7u)}Xw$!_qYu6TJ!J zTPedVs*U~fyREitsp@K1Z~f*J7Y^Y{OJMAe=v*Bir9r7_$46T1!O64`nJ>2e>2-vs zuecKR%i5*A5)KR{x^^XqNGAO$GB~N6tGP9!e7}J5WJ_yHyKS@tv%}NNhk5Qa z)0LX#T%Eq4B$2B*9zCpzkfN+)YQ7h3fa77uylh$YgQqtFoV4Jnnk*%PE2_tksXQhv zDJ$t^j$_*XuCM|__W4aF(azh=!nFygW)(3vYcDswFCpo`XXOobNX|ufG9{3) zV$o{jpLI8NhW<9G!)%rJ%@?`;)#(>hq?yE3RO1UYeMN<+FCFwTf9ZbO4W!Hp@10F9 z>W+*y+rr3+Bemll?TGBFaqWEK&Wm>n!AN&FJ}!m#l)u4=6xDXYtHVexN-Q|Oq=U67 zFnf=7EMsqeqxB34w*sgh`Kv$btAus+N;-Tjb%;OgO(uhq zXxMlz2_Ld9PqXzq_h?{U_h{!(BDZlwJt|oYUqj=U11jC71cTVcLrci~SXSCH$`ac4 zkozlf30sk#5s`ItitS(IOF11yTSD=hh4(M^Y$fip)6|#ZR-ntgl+V|XY>uVkBuVbw zj0|3v=XP~BZ*=*C_5fu?t`*NGu_nN^B7@ZHtB=Ed7zu+79p;e+Pl*ic5*Iin@=^-W zhB?K4Kay)v84DV&6{KevaOYfCSF5Mc5rvnA_9JK;WldS$%<9cF$8s^1dABhTOE7fx zaWWgYMbMNAK3pHh=t2F;)#O_+BY=k%>GYw{A!a#tQN@Zi*?4Rz%krLx+}Uv&XoL{8 z2wep_qgn}N3Xsw4F5HsD87A36*>u&LCesI8&=6&4-i#DV@BE^lk|sE$t%M()^ek3yLL}~&hQuuoSTioyX5{Xaa-r8$$8b#P1JIAS6BF zBxbaOHsNaE@hse@yjjg`6Toq{$=0~fv%+r`CwU|%tgXEM?H7!>*^v9qFSd3teK7l= zU`8owuy8WIpRYBKY&AW@?T-qc-2B0eTL5s)227o+Z5lwt?S%}@gNdHz z>;0uvE&cGJUPJWXn1p26HPAFZMd~`R1YC&AOPuXKhF1KRDCoXl_8e|^7 z;d=YB;{bPk9{NM$1H9@|o?4$UhI*POQUBm03$(PZ{7ahz5SojpwC^Bf4q;F2t(F~{ zJjXsh2pK4n`-|XbTmmy<%Re?rK)CjRZfj&{prcdth7@>&mFON(530Rje|N}$*AlL5 zS0e0QIO62ZSLc`(4RMG$*#EC9oBziOkKiF8{%>Fka9I%iLjUF1H?W(2|CPeg%x}#a zgqLYW*=&5?Y~0cOFY__p|N3Cumv>hR}7(QcCKK3*)1th6#^*Ad01E>nILi?{_QQ2=V|IC6;$ zL!+1tUlIK0nVvG{BV>Fpyf*v5*a@JVx#h$obC^dL3yt@h8vNtKk2Vcg!AJ>amcdz>Rl#zAIYejVI;fs9bDW=S}r~KWkZFS@; zA%)KaS@NF=%GFVg;j{!S9L4MJX5u3^SVcFD=7x1FBNK2+e1_4!u#qB`ctpx4lT>!4 zCs`S*AU!;HYidd|4;2S9n0s?G#EeKQ?=O88@dHa&`=+ywrhL9qaZlP8fHb;Ajp^*M0|Go=5RrZG1ZGlM)is@^_LpFTT>HY#3O`qm^AR9goz44)@80=_-Tk9cCDx z*OT3xW*%U{sqo8OhZoMfB8r8r6scL2u*`a4X@(!<&Zs`8LOms@*Mv??-+?t+fANrCWE$Sq3JVMK7*hNqI?VR?Y0OOI4 zTPs?8Y%<`nc6o~NIy)scGNCFuvank`r9#OpW^gX8xnn5meuC`xbWdby#jgtFG6WMw zT+=5}$?c}`k+)tr)?o&eCJPv753l~98!nMcaxTSOGuvmFJ(rT-Ye~3j(Qp8tkj0Y= z1fLCAAf?D(a^jNJLdq^Ti5tto+45 z;T!c4LtO3Z9}lkYd6r(q%_C)PBo)N_pID&h3Y zm@iUCUUYp&Ua%?om6Bg#y52nQ4<;drl%07lXimheN3@gvkxM_FIeA1VztLmrx128y za<3qkW?fr7#I6>^#Gy5Ry3gf4xwmkjVeorWEP@r9pt^QN&rz_gvm5!Pj|7NOdmAE_yRBI$W|?@@4Mg0FVy+?d9cnV5zF&f0<5Kui0*W*>XyVPc5sxJm!B zTgFjIQh}2N>i0HYzV@>(#P2f*-95aq^O1+E^runc$5}_3v8moDef4*0%@K4_y_k-5 zeyT*%aJn-!B+Ul@;@-Jnyeg+?jH&iHS5| zZKf1>^w>=q`QFnqt|Ag3ldKUR}YK*!R{s>BU$(HzMW_yw`EP+8z%mW!^Gy z^ivre5s}m4yH&$fLMd#R6~j_mLsg{nZhR?j;rvcZG=*N>{!##gB}+~2Upx8y4))UC z_W;_3XN?0nOn_yP3z2DkQ+Z!pzD9Sr2x4S~Iu&bwo7P}hf>IqJq9IHO^`DZwTsZiR zLjVTmTG(?YQX|R3yj1B#hqzdj{`N5yF7I*R8t~=s4o{zH@`c|4#@JDtVWawrkgRIn zz$i)i3AP9xUptsnj?uLO>RA7Z#aP&?uKLmdr}RA6av)my4Kl7Fy-1h_Huht-V^Cjn z`b~cDKE3vxvu%7T)METQsh^z)^Pvdkhf{t&?hkvz8O-E~fb9?9P!&Qi+3u@FK{d+g!A`i@( z_3hd7RV{v)6iBRg$(ei;UJfvnU*U^Ie0E*#ol5tSd_CIhFU>p>gMErz8CEs#3n0sZ z3%0m9eI8X@gokRo>#P5rufrk4xIFV9<@ks zpv>?Wqlym_uxn^Gi zLnisT4}hi(-MFcoo%2_Nv{H-+QaEM|U@{WKK zD;>Lpw_6g9HSCeKnMF_7Dm1K|Gt#>6@==pXE@dU<78-f|h~!I_U4QV4Eg&yv+-3K? z0(GgdgRb4e$3@!`4eYxmRKQ*g3_&X(Hi6|R@At{be!dGPapNL9`+%W_YXob*K1nJkx=mN&`el&y$EPb%DS z^Ze_tyhZ-;?%;zAHM88WvTL^_3N-3py@BT4Qgn$#O1`nE0w{}z!U{^a!jmbm1Mbs2 z2e2pRuPiHIY<}s-8@;SS9O zswEh@!$7_Pby>&?zsN@)^0bs8j!k(wFt7oFVL5;igijHS%&%^&%G2B77D9e6<1;eI z1W5WdjnzIHetAl!k3mPp{RxzVCvJ#sXkjI@LARsv4qc_dxvJMX??DAEoZ_|QkDAT- zaXzphprWCE*}84CBRZ+y<9boziz{ERv}=^Z<)Zut<%o>Cs|6}QH1O^T>~SXQr=0!x zL;rBIzKZ|gr~+{*ATN9$x@y41;Sy40DP)b}Q%M-Nr(^T|mFvG03ry6bG!n1b+=BPB z39%#o%~CFEB~Wdklj$kl=t-UN%OA~GW{CZ8iZJ`ESMfk{!Joc%wr$vd=pP6zeeJct zSPRJVULI#8S^o`e=&CFM*iq? zA%)v6aviW%W>oELc731N7lVa6QnORFeiP))ciJrXu7=q&XO~KL&=WtXRh@Xk{M+0b z@~jw{Ws&>Y;ShXee9^pOR{ryJxCZTEP#W^!S9|Z4%dLO1&$Dr%3c zBbHpJ=p~5BC2*WoGRv6DOHbfTeru|;uC+y%W`SPssXuB!;5ZfT4`Nx$_xiMdTeBch z>`xmEo}y0tFJP14n&^_uW033xabw8ytS%D$+koU~LK~ zERsO;RxkOzl)6xzW0%(zy{2?+;}C0@&Yf>neS7?79Y?T7y{J2$@9o}?{g0MBIS4_V zWS?oUmLS`OYGZ?Hk>l}+R&3>uTw+=e@p0PzB0lWo;167nnP-@30 zqxANvpktWbP~e3e-rzsTIP`c(|Do`(ria7Jrc|>qEuEU_8|&YTw^?elZFsPBN9hW? z#o2t8jFy}^8YS(G*FO+qrbfm6lrv-Gx=!UH05GA5h31G*52GL4F4PdkKwrbvV8+w% zSLo!?`xV7@#wP}TW&S}JA#Ll9c|#n4V*~FW&Ahvn;F&(3cY`Mb%NxDSLr26jM>RO4 zIj*g!J@z38MDbljUs%2cUg(Juw**pC5$lw%BFOLo99U&42`KLE!xOCJM}qAen?%+j zy4Nm8VGwZLLY=Lpphw*3S$86-cbx#(IFUWmt<|;?bH&p61r}M#+C1@e2AQoX18+4y zQ@Y3Zd6$ms?w2;TOb@ZPnYt38#f}Vm=DI>MR>KTMN>sfI%rHoX|AHg?0<*qlt3W`; z@)$Orsh0a}1J(TYEhqcJPb1X%vApt6;Q&ozyB;?z!@ThkyX9D(QX`|_1@4$isMCkN z5aWO^a{9V!MY)wdML{*er5-*0Fx~gE?{@*ZVzzeOv$neO(7@sG@TN^&nzX%LSm$O1 z(FkV$4%Ml^P9oM^D6{M)jdS=w#OSh#(3!iUg&9M9#qI)-Hhx?ePC7d}T-MBV`;|&Yh%7H zq_>1KU5Kom`?X_Mf_t5l$77NVy%BZ7D#bjzWSFD_;8p$atjNI{CV!tpS_%#>!zH?Dm-Wl!t7iWXlf zC?;C(Ehal4jnkS@K)JdYt2i!WxRTa(gObSU2)9|`+i}#_5KJtCRxXb)4oZ;O*#fto z6T1HwOE2e?A!a{6XURd`VX03M%0nJD`?coV+%9#S!K>A%38o~F z1;pEaV>&zP!S^y5!aEfqW}OtRaIF8af>Uz&R}qK5sVH<(Ta%(Ku*VjkZJc6@9zKyf zjKX72m=#H+KTJtXMaH9wv-2G{Y$EBX;IVi0IYOy&o~T=hs1Vm;8!opoxA7Wh_C9`h ztFl5`T}?dsB)9tABli4-(*69M7Vj^8CaU+%s(nI}jWqClN;A<~o!rl_s8vfYVG6aJ zU5pw)RAw4GC+>`o`#IJkvlvyQKM%%zEc||H`=JIbE6Dj;u?r7&MVWo~9z9Hc&Iv7S zlA(M<=iTZqQ8>w%8YYw~ncpj{>O_73qlGWNYe#KjvWtbDgTSbd2ys4!Go+mGx6k&9 zY6vu_Fe3O__Xi~J#SMUzEY8@ZFF?thukDjRj5-_W&+Bt{o;Z4xj)XKE5=ljkee~^X z+?LoN9su73IrkQ(QYMqOYny_H3C??D&glh*4`4BmFGj5Zt zZh0raT#M9z;$$gr0Ch7Za{qEY<2s+i61GCPi&r_p@?v{T3s8}3HPFHjFQP3Stw~)@4R+Fi0W_b#lXV;VHKOYl8xQ!CV||KWG0G4iE6>EV_&+~w zr**aHtlw_%*J`{~FFEH=BkkE|i_qk%vVl>zehK(uF-m&iAF#8o_p~iy1+DedKS9|y zsJEH%!{AODKbSbpq&Mr_D^_59-*4u!uHSOgXhzt93Ye*9%&3h=Ec;0@s<8uYw~YE)maJi{QydtXd4`whGw%ci|yeklii@oGBUgZ89C z+!@N|uQG?Ijo!EXV^9IgXL%99ld|TW;hWfi@|Q`1`?!dZ!wmpRWJyR|dk2 z< ztV+8Yi=0$@j+g$Q581q0zRW=;s_U@{A`@i`B0rBGJumiprZ+VE_)bv^>1rq$dMTI5 zN?`Rn+C5A6DW{tx3x>l~!xn9?Os_`wNwiq9?-53^FV2+aHk#VibU!aV>HM01#S50& z+(BYRFd3WISY9GtS7W?3A!C7!Y9xlwviX3yydvK6j{+DXEM-1`w*n;H1lSN^{2yQ1 zhL40tW)&cuHq*wj+@+G8eYfz_W}iN$6A;pa49CtDVNLtTDoA?Oj72_xtmT%?*Pin4 z$G-)=-i%lFh0~c(ghCr&{Gt8w zawd$o&jv|Jz33kSue!|g0j`AB;V|!s-zr7+KJr~Lvms>d#mr%!EWy2=hLy|+l9ON! zI2S7r_)AvCtE7P@5*CSwnk=M7hYVxIhHEbUE89c#Fc{Y+(S73+z5KmQ9(qB=QNeK% z5!$g2f2dk@RXgZ-oS6x6P#`)2FWkll0Yl~=n{ciUq|28zQN0UXNdpqudQ6gZBBASw zfJ-4weLb!Ebd02!lEzO6IkFl3FMoV5ZlzyL{+t5WT%eI$2nF zLlOq7NH$LKue=rG=^@lo29>1GLQoXNT1s+C(kE39Z2T}8!XI=AGSEjb+_5oPjAto! zS9WO(3xd8OTa<0%yv(VmZcsF*eNS_DvZKb0-6FrISY?U%E3_~+dBt&)W7;ZbqO2$C zE8Pzf(NW`bdWyPFsnO$lK17CkYf275WFw=ys$C;!p5*5?m%wG6*Q@dr@lCwAmnt!M zg`c!maP)emT2b$GW(Qyp^Lo9vwSAlJEW8trtj)Hc>o#af*B#4y6y-`9Ai{fN{!3D|ng4~q z`vg+|C6YsK5pqX{aVN5CwHi~k*8%YWgmoz~nR!f;RVzq*r;fwF?*?%&hRPam^myOc zHu84>dprnOzv3n(h^>5xcC?~lqfr)Y-NFQhJV`QVzJ^_-2=ud#gTB(pBEIr zeSiJX#=*yXnMr%z$f7J##)>!!UWSFv#pddpXC%(QjDI@OCzZ5IqNk~h4;;p%S-cAz zFb8qT=whrSHfwVLvOE?RpU?%2GFnKv#%T&4j4S)H%uw%rUAt@x6$Ol&9UJ?bPAG)3 zlAH9W6y$y`rh^Vg~k}Dtb zAPyzBvx<4m#Xk=kIIY;LPAWH2Eg-C@GZ*G}#A+iXHTquvYDkC2aQGwDge;U>*m*|C zqxxfxbX?XDSl7!&KVIzc4m83uXZ&p?+w_%Esx%zN50;8dR`K1^S76In!3rW6%TLE#IouhTB79&~T9KFh;xXb-C&UyrTu0R5-m56^c_ z`PNx`Prs%=1yFO2rI0iqo8;5@?TxuJvz--zhkfLHwjGPfpzL8eZDtqjqAHYiy6WfIpwf;(|fsQHz_DYBjO z`2A`!Nq4c&8n#))`&mh!^{)QhADH9k2J=3keu|nnwl7=$8Sy1O7pdI`*1Uwbhh0C= z%D@S)jnB0r&wfw5t}Ci66@Es-5x*ePlVJRNzL8()W{HJ5y(DxMQ?@;f4qS4r0Sb|E zb^enXB&zV6CSw`9l7UV>og0L_FYO0%xmRBWqpgc!g<3ty>gB2A1;m0z@yrB~!KBuC z8pw;=24u3(uyhvZ{mQIdyI%rF@0C6%u<^U3w|`3I_E5~7DowuDZ?CRh7HMOXw#ZIi z%M_oIuEpOx%t@gI2bpjz`DaxhF8go!E|n!%+cW8B4v+L#4!0I|mvKmTkXGFMwK=ca znU@_Lfa+K_Jr;_(-CJPq(AzhR#H?BT+B|ElMU26CGG8#2?-#?9MsHa4*LmHy_GR_> z%#tFhoOV(6i08=gM3zr5o;1~yGTGi|_iNX5YyCY}7kqvn>N$P!4^B}}52tuP3;oET z-@3sg{b{}dMKm+D`s0jUHC2?SrStd-CzBsNN6-)Nz6{Vqh@H7?=^F&?vuyuH`Hq^tyc$;KDN<%iuP5%X6K>E$WVUbs0P@77xAT=zDHQsX z!12mQh&_djOS@=AiY=p+B>My*d^(Nbrpg3-ft~@Ob1^Ns27qa7JC!6ufpAO8=v#}c zDflJ+HeWA_GDmXLY4F?|yR~<%v-y)5dQC?5R+v3<&RJY|+pyBRB8!P(m+SXazTC7H zWCx3<(`>7A-33Z@Rx|6n4MTs9XrR8~M6EsAPBGM1BsZp4$#Swp2{C z{Sf1xQr+uNyXoU&BT^ho&Gb;+7GU)x8WlLJLf$<*l^)Z?%&gHSZERS5h|&y;dE$Wa zYlujGM=1>v@O=2qVc(9z$SA-5J;k)u;H_fshC1t+ih7|`^8}wPce;62xhT0v`>byi zKB-d!H^USAm2}iESvuq|1-d5bwW?cjm>uI)>;)^8lei@kgNg{58fJSoFkKOb=SKq)B^*H@0LO}KeR(5_Rp zIK8XuX_fMiB3R06=2OsUH^1>ouY)45&58H79zMer`1mCxD=*DXsOsqievd;4lq}Zv z+}1#SVK|@{x%1Q>J~w@D!{Cb3+=r{i#mc}<3x?wbJ5yK~@;iRm&NiU*Py*-lbHE}Z87eo4Pw>=-8`Gs$CJwvC7m-j z#8zfqLcO}~2Uj}IK8ELqu#PfiyL5E&um-)64x5OkR}Q^fN)Z^O2C~C`#d;z6uGlBW z^(S>wcU6;pFMYIZPK$Xc#3V$-8d{2@^qTxF#WxW1{hL_B1NR&la0S^sR&l)W3tecs z(^dFt#@jbga)W4HGbXG`k!U}EE!&;!S3Z`6VS-k2=6hR>MPPhlJl5rPzjls-JLAKA zBdh3`*c}6P;&OC{$edLZ@F^T{pS|?5q<0w+GPiY z4S??`q!qS!@`bDiG+$&mTZ4_oOQYUhp zd2xIs%qjR!@?PHVkMC!MU{aFnGTS`Zi~BIwDZP;x@Fp6H{v$x2{un&Dr^WZj!QeRC|7k zCB4;K$HpGy19$yD!*bW|=VszS0KixfQ;8?n8Pdy=q(mYYJgsnZanQM}B!t;ZqwRX= zI#^QUIhPX%(p-@verrtjmUc?A-RTx&+d@k4#OVBxDNI?1*b1ptVeJonL%KJ{h|+Sa zcB-+;O#Hl8`%PvagE7^&^#KcRMFqA@@-j9xYX-5l27GNvVVSmD832m+yOhA*ktX`& zW&@{O1KFx>AL>Foia)Bo#67!DHeSoI!h@+q%GdC5(F7+yoy#=(2j-YK;r5MbOjlF= zTiYeTyQ`waZEWW0OCww^FTQKD?PJqysVH{RUp}78(`0`+-{_$*J|Cm>?P^5xJieea zT?mCQ>>diYBwpbs^Q)PcESj?zMSq%1)&t(W{ImSmlA*rC9=^kN8J8L6K6-yEZ6n07 z(B6_BB*rYuwJB;q18n9c267DDR{L(YYB{SN50aMLn|+I@^U-^)(y0syOkq7p1n`TT z@IR0S6?|@+-OFPET;Hj*><9-iHR?7YA*HoY)pq2qx8hHc)Ca_Ch{x0aK>?+A&!y}*C}jtWUgVmRd^&`#rX0XOYZ4N_?L=`ZU^p&JR%1AG^Gw*YR{*c{q8+FD59FT9SO!7U zV_3=&xZ1z)-Qsw-fuK<2QzCW_^F?_GA)nx#iYq3!ry}^au*zp%dAQ4M5aaLC zJ36I(!qUSdghT*wUp@V|efI(+%UpnaH4(iCgP@c^G>(q2JjvgL90>9MND%$yWq{=X zY|{c8jsFj9=r2M9VuuOIr+Gy288*49X3OYQ$Guar;Zm74rSNL_OXnt-pZQeU1diU) zY?&<(=hS+lm^lSrFzR%?!X5ArXsUYMir4#dAM0aNJ37cwT1T(Ke&y#rl3k5FllUm` zhR?1ma+FqUDFZYl1@JH3T6=PA8v4lF!GlYQAJohUKpsdYbrAiY7*wl>b^_ljI}9>s zCCzh zAY`#BvC#{M|K{OU{MLNGHm;SsRNb~w*1~17!o2i(_^0m$gNVqfnl@y~j_HTGz72~G zqGe)w8IRUwPFUlMT%q%hRg=5M9pko+_DGlUK2+EEQbvit|ARl|wWLY&OYQb~=pkx@ zS(ULk2gFd_$cfV6w{g$AnZvYBE+BzN;*pF^ahI4&)lm51mpt1VG6wxWgG&>v-Rv~? zBZh~^;(*eSH4W-#+4GUsnJ@y)CMW!g_UtY)j8J9^fgz`SZJ6FPyMv{~0X?l2Jeuy) zSb=b#n*4ChWfl-&q93%SqtCM@tZmFZD8erXzyqwQjjZvVv9ywG$3$oU1|5>8uinAa zAAobG*T)X+kjOK62^`D#0Ktxn7wB$JSctgV>y4c#Rt;mWn2&%FZsFDCC!r&erO`LUWBGWv`F=@IO6bV)L_;Nsx z{5~{y^bo=J5$4Uk`;F4o4-}BSmF3{25v{CZO&9f?_H3g{)?Q=UyHJa4R{gg_`%}GZ zL}>^V(fi+*-dws6B@e<14R2fo24z+1w-E8M%$S}kO=e(=LF_0#RV61(URwbfuaXocQ|c*86oy&8vj7r!VPSDUmQfF z!z-DEKKx8MCTE>0PXT+Xb19{1fmOe0Bj%t;z)^N_k?!Z=&Fp0DXzPdGhd5W&Vk0Zu zOxh(Nbj_E@nS6HJa1lVQR4kPSxL-U&plCnoi}w?M%-&1-2ht4+?TL?S1rtyZt^OnUc;O?aw&knuc7K5Sd2&q9&TGN z4ES`^IEzX2#mT)MbguC-dEQRyTJ00HJfXrBHPXmJ>Ij!~-dbj%=O zDK+_!SX4M4_0g!q!uyneF2y$RkCEF}jN@)DqFTsw@dS&1yX5bkan%HPyZVj%CT8%3 zEuxsdf~(Su9yT282z1OUW_tLb$Jd(w_wNA)W+yY|GoNolT{m&uAiv;Emn2uo@-U{~ zz+f9?H|jjT{c08#w*ewqLu$@69*A5D#QhGF<9BlbX#cstcPci>av|8TH|X z&)56}l-Ck;TX)EWhG5SnIL|Cf%oYX-ng-;(H_Ih96PYg{F~RUr4Ty|A$OC(pMoLrT{lC!gUAmc@v?W>jaqa|JGQN#s{7 zT1ce~lA^&rA%BZ|pICDXvfCa({3}50!r1krCPql3n5!5`mt2T$giL$8sF9wxB*g@4 ze5`87SN_0tG^D`mUh#-oisibYV$6tPwFO?3M)Dw6=4(yIyzb3TzA1uisYP@1upcRp zdibW&Fm{~uO9yL$8$7+asYuwM%9+oM{F&{m7tMyrjuODD>Q#VX4DFXP%1y9;!4-Hb z#`4*dN}4$M%4Dk8%!d!8u|;e`?bu)?!CRE5aY})q2GPtvHp>f5qZk=xYkka{)?<$d zY`-P`6K4CYtftMm5Semxec7bNM5cps>;-*c;()ya$hKVks8M%z)wV0=*7Pn2a&dF2 zjj5H3kRME3s~m-X4yAdmO$TXD@MBd9-A5pgU(jqNGPP?9jL*)^qa&ki!s&NPQCPWO; zD`itt7svu{mG5)Cp+8m5#&u0r^O12tzp5NO&dTo(Rxvne?9l;>Np}|h-ah>u55=LP zh6gVFb0WxOfpS`O;|WG_=+lEIBxY9>VM8~7;5_!)mb-9=>xDlu8 zf@HSr-I;oem`s=TKa3E!K4`?t%J!iFSxxHdr_wf=yRRDm7zB!BFXyPV5Pv?b;(Kiq zEp&tF-7#Lb_aYdEA>EC?<>eL5t2jp8YL=dd-LynqD3+JF=z@ujE%om=zWHNWc_3!@ z=R9cv+;w997Yv&-W4AM*&N7zz`(1g+%Xzl>$NF{NA<^cvDLzKdagMnWRta$$`CnO9 z3!Ss)2tnaLxJ_}ZCRj_6yQ>w zL9Mk!^*ThZx9QDnYS0i3UO(2eLyS+V1Qb7*|CO`%=6QO1X`&)3lJ6X`-DmR?u}PWP z{aehebNbjYXJk{$MM#c(9`CUHC;ycMWyU#ua%S36ceyFkd#V0W4pYz7$JHj;n?rS@ z#P@*lAul|z&L|p7S7xJ)E zLgOPFMug5J@^EicYHzD8!)WKjQ}h+Lw!`&~o^ATaL-49ANS;l75n$};pd)$`iI|d` zmyHRWzp`XDRt`y&3Btz|Q*2TIt(~?{5@Lxq{_%;PavSMLWbqyRE$c_$ z*MCT66N*|pt`d-@(cy%oBGBLf>;Lzb8K7PR4e5djU%Za-E@8kC1m_Wt|tuIlEK}hK#=I_ZfNNqMv(u0whiQ_Y{FMj8J29fgcW+sBrt(lob z1+I=^+O!csZn<{PH>zI{eC<95q(cd8=gBvQHV}7D#OG=p*N*_tzwY-o-;eqrz)W%P zZ>sDiEAxD1zZJ$u0{Yb_27OQ?_TiiFprxG8eRmYhvQ@Te*EM)x1%j!#YC-1NsE_&D z-E<)v<+{J^1iGVgi*~Rn$<@Y7Z3SA?y^*$Le5OW97 z$3-gG*ji#3zGT(OX6MSs56pM^G!hAAcd6s^1Y&mEv7!!ZMq75&n!VB`P98mNOKR|s z3cpx9Q6BwySd?8IaRXwI*XW&Jx5BNZH}fH8HKSNtF2p3VTg;5UV2+2pm;UXBOPl=e z)$BB3ou%;^v1*3=8yQ%qT&Ue-)mckK{KWNZ>#yux3%j z^$~Gl3F1}5TXoYDhMen$c3BC6f!!K02@_$G3xoZ^wQ>r&Lk4Qri@}|`tY;m00)}}R zuFXDpcr)GdX6NZuP6}b>oi+aLw9p@2>UNw9G;2-5awbeA*V-=|>By6PVjhiSCJtp! zSD4J_yE5or;Pd3HEo5@Wq^uBksHQW1zhR_maxic5I5AC)v-+BtG+pXf*SY-4ucVy# z?2!ZMO}Ize?rcs>J*I$B>Yhh|mD}?eU51KEen;_)at&6JNwfQ^=3fJ3Ngmm>%#RgT zKu=oz>4ig}2Hx_U3=4)>OHmkIxjDI4g=@yb-im;t1lRJVj$Z}8yEyYM67AC+1;0;f zH&tw;T0(Y=pA~pawy_w0ChB*VY%`8*;g)=rjE}T9(oiaks7pL0F%9bHK8dkqaTQQa zij|8eiqblOFa6rO37bl5Fmm!_G~&4+W)2TNz-2Y4euK7ID>d#kBn)UUR$s{WlKAc$ zr=Dc}L!yg~J^XkS0T+7E*-SaHu6-xHVZp~D!<`JpiiE=#hBTS&1LRE9vJof{9PlXC zZr*`}Y+dt2`|uSbS+}u~LOSN%CBbNv&QwTp-qb!0^UXCn@<%EOg~v=Jq$5Y^Wa7TT z0_%a(DWt4&h1)^i3$f z^OY!!6%LZvFK}7A=aD3EscUPr>$b+GRb&rELPy@3p%dWmkY|MsvL?BTS98pRYC=yVA>IzHbWC6%@^Qrb~StynL5;2L*k zFEqCx*X!$1G<(Co{Bq4cmki(i1lqeSlKIN=KDyBV#n@ZMMfJULy8{Rq2vX7^%@ESk zp)^uMhf2c?A;Sm=2oi!i(j^QvbR!J|1|Z!G15zTA($Y%!dlvua%{k}QdBF?w^O@Ou zuf5iNfA8x8S}PUn??S9A`A{mujxs%;t!9`O!L;M*ai}Kp;Z$~tj_vi>LF8AClQJoe zR^hFeL>4o--BlokKS}YRNEVFu#?4?W8vzMA*RTOV_X3^;>G>FFy zxiJw3&)qrV%R5L+<8=_Y?D%;pIB5=}jJxqN-We|`>$g-++?ZTs$Fl`Dp_E5-aPBoZ zSrC9HWUlJhL)s<(gHVecNqz4;)KrPoKel{dBX=ZqPWlTQEI{1SxmLqr3=>d0sScJ9 z9R4m_!Zxs^R6=Yh=6B^n;93efl0(-a{1bCw%ry_lOKMfhE3pw$-LSxwkf|PM#ln%Wps)zy8o5@ne@ZqNk+vq^S}D{7A-8Ly%R#cP5es2r&yV zk+!OG@_I>?rZ-fSO0EcdEt9f-Xm=A9yz_OB4ot>L&KDHPgKYgBM|8~GUN(HZ;x&{^ zX@lL0~q&;^LSkWc~^7l$PcAn?!O#8 z9Q}Wq6%oRs7o|C3oC9_N^}`n`$ohFA)fFc?O>YI*C*4r_Y7XnTz~j}DsGUnHgfp0y zREkoV;P=t29`ROg03-PzVxkV

K;;MI9rL^yQAYOBGCgk4FVm$_ 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