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

[packages] Move @kbn/interpreter to Bazel #101089

Merged
merged 26 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d7663f
[packages] Move @kbn/interpreter to Bazel
jbudz Jun 1, 2021
fd5b266
remove dep
jbudz Jun 1, 2021
50a94ba
rm jsnext:main
jbudz Jun 1, 2021
c84a520
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 4, 2021
559aee9
wip
jbudz Jun 4, 2021
6a09dd1
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 4, 2021
ead7202
wip
jbudz Jun 4, 2021
ba84fe6
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 8, 2021
2ff1c09
skip lint error
jbudz Jun 8, 2021
429984c
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 9, 2021
40d7093
chore(NA): fix peggy task
mistic Jun 8, 2021
6b922cf
chore(NA): move some files into typescript
mistic Jun 9, 2021
ff2423c
Merge branch 'master' into bazel/kbn-interpreter
kibanamachine Jun 9, 2021
25fb1da
chore(NA): remove peggy
mistic Jun 9, 2021
efdea8e
chore(NA): correct arguments for building kbn interpreter
mistic Jun 10, 2021
d8906bd
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 10, 2021
2eba61e
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 14, 2021
5f94c44
fix types
jbudz Jun 14, 2021
38e516e
fix import
jbudz Jun 14, 2021
d67f320
fix test
jbudz Jun 14, 2021
851098b
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 15, 2021
d57f376
Merge branch 'master' into bazel/kbn-interpreter
jbudz Jun 17, 2021
04b4927
chore(NA): fix last unit test
mistic Jun 17, 2021
d1209fe
chore(NA): fix types for kbn/interpreter migration
mistic Jun 17, 2021
f558973
Merge branch 'master' into bazel/kbn-interpreter
kibanamachine Jun 21, 2021
4a69ae1
Merge branch 'master' into bazel/kbn-interpreter
kibanamachine Jun 22, 2021
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 docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ yarn kbn watch-bazel
- @kbn/eslint-plugin-eslint
- @kbn/expect
- @kbn/i18n
- @kbn/interpreter
- @kbn/io-ts-utils
- @kbn/legacy-logging
- @kbn/logging
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"@kbn/crypto": "link:bazel-bin/packages/kbn-crypto/npm_module",
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module",
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n/npm_module",
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter/npm_module",
mistic marked this conversation as resolved.
Show resolved Hide resolved
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ filegroup(
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-i18n:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-legacy-logging:build",
"//packages/kbn-logging:build",
Expand Down
9 changes: 0 additions & 9 deletions packages/kbn-interpreter/.babelrc

This file was deleted.

2 changes: 0 additions & 2 deletions packages/kbn-interpreter/.npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
src
tasks
.babelrc
81 changes: 81 additions & 0 deletions packages/kbn-interpreter/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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-interpreter"
PKG_REQUIRE_NAME = "@kbn/interpreter"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"src/**/*.js",
]
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"common/package.json",
"package.json",
]

SRC_DEPS = [

]

TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
allow_js = True,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
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"],
)
9 changes: 4 additions & 5 deletions packages/kbn-interpreter/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{


{
"name": "@kbn/interpreter",
"private": "true",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"scripts": {
"interpreter:peg": "../../node_modules/.bin/pegjs src/common/lib/grammar.peg",
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --dev",
"kbn:watch": "node scripts/build --dev --watch"
"interpreter:peg": "../../node_modules/.bin/pegjs src/common/lib/grammar.peg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we run this as part of bootstrap ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbudz probably in order to accomplish this we need to do something like https://github.com/elastic/kibana/blob/master/packages/kbn-tinymath/BUILD.bazel#L33

Copy link
Member

@ppisljar ppisljar Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except that interpreter is not using peggy yet but still the old pegjs.
i am ok with moving to peggy in the same pr as long as it doesn't break

}
}
9 changes: 0 additions & 9 deletions packages/kbn-interpreter/scripts/build.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/kbn-interpreter/tasks/build/__fixtures__/sample.js

This file was deleted.

82 changes: 0 additions & 82 deletions packages/kbn-interpreter/tasks/build/cli.js

This file was deleted.

15 changes: 0 additions & 15 deletions packages/kbn-interpreter/tasks/build/paths.js

This file was deleted.

17 changes: 15 additions & 2 deletions packages/kbn-interpreter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-interpreter"
"allowJs": true,
"incremental": true,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-interpreter/src",
"types": [
"jest",
"node"
]
},
"include": ["index.d.ts", "src/**/*.d.ts"]
"include": [
"src/**/*",
]
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@
version "0.0.0"
uid ""

"@kbn/interpreter@link:packages/kbn-interpreter":
"@kbn/interpreter@link:bazel-bin/packages/kbn-interpreter/npm_module":
version "0.0.0"
uid ""

Expand Down