Skip to content

Commit

Permalink
chore(NA): moving @kbn/spec-to-console into bazel (#103470) (#103498)
Browse files Browse the repository at this point in the history
* chore(NA): moving @kbn/spec-to-console into bazel

* chore(NA): fix licenses

Co-authored-by: Tiago Costa <[email protected]>
  • Loading branch information
kibanamachine and mistic authored Jun 28, 2021
1 parent 7d88647 commit ebe1f7c
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 5 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 @@ -103,6 +103,7 @@ yarn kbn watch-bazel
- @kbn/securitysolution-utils
- @kbn/server-http-tools
- @kbn/server-route-repository
- @kbn/spec-to-console
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@
"@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
"@kbn/spec-to-console": "link:bazel-bin/packages/kbn-spec-to-console",
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ filegroup(
"//packages/kbn-securitysolution-hook-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-spec-to-console:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
Expand Down
55 changes: 55 additions & 0 deletions packages/kbn-spec-to-console/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-spec-to-console"
PKG_REQUIRE_NAME = "@kbn/spec-to-console"

SOURCE_FILES = glob(
[
"bin/**/*",
"lib/**/*",
"index.js"
],
exclude = [
"**/*.test.*",
"**/__fixtures__/**",
],
)

SRCS = SOURCE_FILES

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

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

DEPS = []

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES + [
":srcs",
],
deps = 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"],
)
4 changes: 2 additions & 2 deletions packages/kbn-spec-to-console/lib/convert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

const convert = require('./convert');

const clusterHealthSpec = require('../test/fixtures/cluster_health_spec');
const clusterHealthAutocomplete = require('../test/fixtures/cluster_health_autocomplete');
const clusterHealthSpec = require('./__fixtures__/cluster_health_spec');
const clusterHealthAutocomplete = require('./__fixtures__/cluster_health_autocomplete');

test('convert', () => {
expect(convert(clusterHealthSpec)).toEqual(clusterHealthAutocomplete);
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-spec-to-console/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "spec-to-console",
"version": "0.0.0",
"name": "@kbn/spec-to-console",
"version": "1.0.0",
"description": "ES REST spec -> Console autocomplete",
"main": "index.js",
"directories": {
"lib": "lib"
},
"private": true,
"scripts": {
"format": "../../node_modules/.bin/prettier **/*.js --write"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/spec_to_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Side Public License, v 1.
*/

require('../packages/kbn-spec-to-console/bin/spec_to_console');
require('@kbn/spec-to-console/bin/spec_to_console');
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2769,6 +2769,10 @@
version "0.0.0"
uid ""

"@kbn/spec-to-console@link:bazel-bin/packages/kbn-spec-to-console":
version "0.0.0"
uid ""

"@kbn/std@link:bazel-bin/packages/kbn-std":
version "0.0.0"
uid ""
Expand Down

0 comments on commit ebe1f7c

Please sign in to comment.