Skip to content

Commit

Permalink
chore(NA): moving @kbn/babel-preset into bazel (#97271) (#97436)
Browse files Browse the repository at this point in the history
* chore(NA): moving @kbn/babel-preset into bazel

* chore(NA): remove unused deps from xpack package.json

Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
  • Loading branch information
kibanamachine and mistic authored Apr 19, 2021
1 parent cbd96ab commit a5f590d
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 22 deletions.
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 @@ -63,6 +63,7 @@ yarn kbn watch-bazel

- @elastic/datemath
- @kbn/apm-utils
- @kbn/babel-preset
- @kbn/config-schema
- @kbn/tinymath
- @kbn/utility-types
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"@istanbuljs/schema": "^0.1.2",
"@jest/reporters": "^26.5.2",
"@kbn/babel-code-parser": "link:packages/kbn-babel-code-parser",
"@kbn/babel-preset": "link:packages/kbn-babel-preset",
"@kbn/babel-preset": "link:bazel-bin/packages/kbn-babel-preset/npm_module",
"@kbn/cli-dev-mode": "link:packages/kbn-cli-dev-mode",
"@kbn/dev-utils": "link:packages/kbn-dev-utils",
"@kbn/docs-utils": "link:packages/kbn-docs-utils",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ filegroup(
srcs = [
"//packages/elastic-datemath:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-utility-types:build",
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-ace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"kbn:bootstrap": "yarn build --dev"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/babel-preset": "link:../kbn-babel-preset"
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
3 changes: 1 addition & 2 deletions packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"kbn:watch": "node scripts/build --source-maps --watch"
},
"devDependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/babel-preset": "link:../kbn-babel-preset"
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
3 changes: 0 additions & 3 deletions packages/kbn-babel-code-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@
"build": "../../node_modules/.bin/babel src --out-dir target",
"kbn:bootstrap": "yarn build --quiet",
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset"
}
}
63 changes: 63 additions & 0 deletions packages/kbn-babel-preset/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-babel-preset"
PKG_REQUIRE_NAME = "@kbn/babel-preset"

SOURCE_FILES = glob([
"common_babel_parser_options.js",
"common_preset.js",
"istanbul_preset.js",
"node_preset.js",
"webpack_preset.js",
])

SRCS = SOURCE_FILES

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

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]

DEPS = [
"@npm//@babel/plugin-proposal-class-properties",
"@npm//@babel/plugin-proposal-export-namespace-from",
"@npm//@babel/plugin-proposal-nullish-coalescing-operator",
"@npm//@babel/plugin-proposal-optional-chaining",
"@npm//@babel/plugin-proposal-private-methods",
"@npm//@babel/preset-env",
"@npm//@babel/preset-react",
"@npm//@babel/preset-typescript",
"@npm//babel-plugin-add-module-exports",
"@npm//babel-plugin-styled-components",
]

js_library(
name = PKG_BASE_NAME,
srcs = [
":srcs",
],
deps = DEPS,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
srcs = NPM_MODULE_EXTRA_FILES,
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@kbn/utils": "link:../kbn-utils"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/expect": "link:../kbn-expect"
}
}
3 changes: 0 additions & 3 deletions packages/kbn-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@
},
"dependencies": {
"@kbn/dev-utils": "link:../kbn-dev-utils"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset"
}
}
1 change: 0 additions & 1 deletion packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"kbn:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
1 change: 0 additions & 1 deletion packages/kbn-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@kbn/i18n": "link:../kbn-i18n"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
1 change: 0 additions & 1 deletion packages/kbn-monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"build:antlr4ts": "../../node_modules/antlr4ts-cli/antlr4ts ./src/painless/antlr/painless_lexer.g4 ./src/painless/antlr/painless_parser.g4 && node ./scripts/fix_generated_antlr.js"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/dev-utils": "link:../kbn-dev-utils"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/config": "link:../kbn-config",
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/std": "link:../kbn-std",
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@kbn/optimizer": "link:../kbn-optimizer"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/dev-utils": "link:../kbn-dev-utils",
"@kbn/expect": "link:../kbn-expect",
"@kbn/utils": "link:../kbn-utils"
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@kbn/monaco": "link:../kbn-monaco"
},
"devDependencies": {
"@kbn/babel-preset": "link:../kbn-babel-preset",
"@kbn/dev-utils": "link:../kbn-dev-utils"
}
}
4 changes: 1 addition & 3 deletions x-pack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
"yarn": "^1.21.1"
},
"devDependencies": {
"@kbn/babel-preset": "link:../packages/kbn-babel-preset",
"@kbn/dev-utils": "link:../packages/kbn-dev-utils",
"@kbn/es": "link:../packages/kbn-es",
"@kbn/expect": "link:../packages/kbn-expect",
"@kbn/plugin-helpers": "link:../packages/kbn-plugin-helpers",
"@kbn/storybook": "link:../packages/kbn-storybook",
"@kbn/test": "link:../packages/kbn-test",
"@kbn/utility-types": "link:../packages/kbn-utility-types"
"@kbn/test": "link:../packages/kbn-test"
},
"dependencies": {
"@elastic/safer-lodash-set": "link:../packages/elastic-safer-lodash-set",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,7 @@
version "0.0.0"
uid ""

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

Expand Down

0 comments on commit a5f590d

Please sign in to comment.