Skip to content

Commit

Permalink
refact(NA): remove extra pkg_npm target and add specific target folde…
Browse files Browse the repository at this point in the history
…rs for @kbn/analytics on Bazel (elastic#100569) (elastic#100620)

* refact(NA): remove extra pkg_npm target and add specific target folders on @kbn/analytics

* chore(NA): update import on target_types

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
  • Loading branch information
kibanamachine and mistic committed May 26, 2021
1 parent 621919b commit 88d2f64
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 33 deletions.
30 changes: 4 additions & 26 deletions packages/kbn-analytics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ ts_project(
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_dir = "types",
declaration_dir = "target_types",
declaration_map = True,
incremental = True,
out_dir = "node",
out_dir = "target_node",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
Expand All @@ -72,38 +72,16 @@ ts_project(
deps = DEPS,
declaration = False,
incremental = True,
out_dir = "web",
out_dir = "target_web",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig_browser",
)

filegroup(
name = "tsc_types",
srcs = [":tsc"],
output_group = "types",
)

filegroup(
name = "target_files",
srcs = [
":tsc",
":tsc_browser",
":tsc_types",
],
)

pkg_npm(
name = "target",
deps = [
":target_files",
],
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":target"],
deps = DEPS + [":tsc", ":tsc_browser"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"private": true,
"version": "1.0.0",
"description": "Kibana Analytics tool",
"main": "target/node/index.js",
"types": "target/types/index.d.ts",
"browser": "target/web/index.js",
"main": "target_node/index.js",
"types": "target_types/index.d.ts",
"browser": "target_web/index.js",
"author": "Ahmad Bamieh <ahmadbamieh@gmail.com>",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
2 changes: 1 addition & 1 deletion packages/kbn-analytics/tsconfig.browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.browser.json",
"compilerOptions": {
"incremental": true,
"outDir": "./target/web",
"outDir": "./target_web",
"stripInternal": true,
"declaration": false,
"isolatedModules": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-analytics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": true,
"declarationDir": "./target/types",
"outDir": "./target/node",
"declarationDir": "./target_types",
"outDir": "./target_node",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
Expand Down
2 changes: 1 addition & 1 deletion test/api_integration/apis/ui_metric/ui_metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import expect from '@kbn/expect';
import { ReportManager, METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics';
import { UserAgentMetric } from '@kbn/analytics/target/types/metrics/user_agent';
import { UserAgentMetric } from '@kbn/analytics/target_types/metrics/user_agent';
import { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService }: FtrProviderContext) {
Expand Down

0 comments on commit 88d2f64

Please sign in to comment.