Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(NA): splits types from code on @kbn/securitysolution-list-api #121680

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@
"@types/kbn__optimizer": "link:bazel-bin/packages/kbn-optimizer/npm_module_types",
"@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types",
"@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types",
"@types/kbn__securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ filegroup(
"//packages/kbn-optimizer:build_types",
"//packages/kbn-plugin-generator:build_types",
"//packages/kbn-plugin-helpers:build_types",
"//packages/kbn-securitysolution-list-api:build_types",
],
)

Expand Down
27 changes: 22 additions & 5 deletions packages/kbn-securitysolution-list-api/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_BASE_NAME = "kbn-securitysolution-list-api"

PKG_REQUIRE_NAME = "@kbn/securitysolution-list-api"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__securitysolution-list-api"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -85,7 +85,7 @@ ts_project(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"],
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand All @@ -104,3 +104,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)

pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)

filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion packages/kbn-securitysolution-list-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"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",
"private": true
}
8 changes: 8 additions & 0 deletions packages/kbn-securitysolution-list-api/src/list_api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ import {
ImportListParams,
} from './types';

export type {
ApiParams,
DeleteListParams,
ExportListParams,
FindListsParams,
ImportListParams,
} from './types';

const findLists = async ({
http,
cursor,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-securitysolution-list-hooks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-securitysolution-hook-utils",
"//packages/kbn-securitysolution-io-ts-list-types",
"//packages/kbn-securitysolution-list-api",
"//packages/kbn-securitysolution-list-api:npm_module_types",
"//packages/kbn-securitysolution-list-constants",
"//packages/kbn-securitysolution-list-utils",
"//packages/kbn-securitysolution-utils",
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5884,6 +5884,10 @@
version "0.0.0"
uid ""

"@types/kbn__securitysolution-list-api@link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types":
version "0.0.0"
uid ""

"@types/keyv@*":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
Expand Down Expand Up @@ -10461,7 +10465,7 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==

core-js@^3.19.3, core-js@^3.0.4, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3:
core-js@^3.0.4, core-js@^3.19.3, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3:
version "3.19.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.3.tgz#6df8142a996337503019ff3235a7022d7cdf4559"
integrity sha512-LeLBMgEGSsG7giquSzvgBrTS7V5UL6ks3eQlUSbN8dJStlLFiRzUm5iqsRyzUB8carhfKjkJ2vzKqE6z1Vga9g==
Expand Down