forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(NA): moving @kbn/analytics into bazel (elastic#98917)
* chore(NA): moving @kbn/analytics into bazel * chore(NA): fix type check for package migration * chore(NA): fix type check for package migration * chore(NA): fix type check for package migration * chore(NA): separate type generating from server code Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
58b3c1b
commit 4af6e9c
Showing
12 changed files
with
152 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
exports_files( | ||
[ | ||
"tsconfig.base.json", | ||
"tsconfig.browser.json", | ||
"tsconfig.json", | ||
"package.json" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") | ||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") | ||
|
||
PKG_BASE_NAME = "kbn-analytics" | ||
PKG_REQUIRE_NAME = "@kbn/analytics" | ||
|
||
SOURCE_FILES = glob( | ||
[ | ||
"src/**/*.ts", | ||
], | ||
) | ||
|
||
SRCS = SOURCE_FILES | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = SRCS, | ||
) | ||
|
||
NPM_MODULE_EXTRA_FILES = [ | ||
"package.json" | ||
] | ||
|
||
SRC_DEPS = [ | ||
"@npm//moment-timezone", | ||
"@npm//tslib", | ||
] | ||
|
||
TYPES_DEPS = [ | ||
"@npm//@types/moment-timezone", | ||
"@npm//@types/node", | ||
] | ||
|
||
DEPS = SRC_DEPS + TYPES_DEPS | ||
|
||
ts_config( | ||
name = "tsconfig", | ||
src = "tsconfig.json", | ||
deps = [ | ||
"//:tsconfig.base.json", | ||
], | ||
) | ||
|
||
ts_config( | ||
name = "tsconfig_browser", | ||
src = "tsconfig.browser.json", | ||
deps = [ | ||
"//:tsconfig.base.json", | ||
"//:tsconfig.browser.json", | ||
], | ||
) | ||
|
||
ts_project( | ||
name = "tsc", | ||
args = ['--pretty'], | ||
srcs = SRCS, | ||
deps = DEPS, | ||
declaration = True, | ||
declaration_dir = "types", | ||
declaration_map = True, | ||
incremental = True, | ||
out_dir = "node", | ||
source_map = True, | ||
root_dir = "src", | ||
tsconfig = ":tsconfig", | ||
) | ||
|
||
ts_project( | ||
name = "tsc_browser", | ||
args = ['--pretty'], | ||
srcs = SRCS, | ||
deps = DEPS, | ||
declaration = False, | ||
incremental = True, | ||
out_dir = "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 = [":target"] + DEPS, | ||
package_name = PKG_REQUIRE_NAME, | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
pkg_npm( | ||
name = "npm_module", | ||
deps = [ | ||
":%s" % PKG_BASE_NAME, | ||
] | ||
) | ||
|
||
filegroup( | ||
name = "build", | ||
srcs = [ | ||
":npm_module", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,8 @@ | |
"version": "1.0.0", | ||
"description": "Kibana Analytics tool", | ||
"main": "target/node/index.js", | ||
"browser": "target/web/index.js", | ||
"types": "target/types/index.d.ts", | ||
"browser": "target/web/index.js", | ||
"author": "Ahmad Bamieh <[email protected]>", | ||
"license": "SSPL-1.0 OR Elastic License 2.0", | ||
"scripts": { | ||
"build": "node scripts/build", | ||
"kbn:bootstrap": "node scripts/build --source-maps", | ||
"kbn:watch": "node scripts/build --source-maps --watch" | ||
} | ||
"license": "SSPL-1.0 OR Elastic License 2.0" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "../../tsconfig.browser.json", | ||
"compilerOptions": { | ||
"incremental": true, | ||
"outDir": "./target/web", | ||
"stripInternal": true, | ||
"declaration": false, | ||
"isolatedModules": true, | ||
"sourceMap": true, | ||
"sourceRoot": "../../../../../packages/kbn-analytics/src", | ||
"types": [ | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters