Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
build(radial-chart): Bazelify radial-chart component
Browse files Browse the repository at this point in the history
  • Loading branch information
rebu-dt authored and lukasholzer committed Oct 9, 2020
1 parent ad1c901 commit 1b06a0c
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 37 deletions.
6 changes: 0 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2044,12 +2044,6 @@
"!libs/barista-components/radial-chart/**/*"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/barista-components/radial-chart/jest.config.js"
}
}
},
"schematics": {}
Expand Down
89 changes: 88 additions & 1 deletion libs/barista-components/radial-chart/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
load("//tools/bazel_rules:index.bzl", "stylelint")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("//tools/bazel_rules:index.bzl", "jest", "ng_module_view_engine", "stylelint")

package(default_visibility = ["//visibility:public"])

ng_module_view_engine(
name = "compile",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*.spec.ts",
"src/test-setup.ts",
],
),
angular_assets = [
":styles",
":styles_path",
"src/radial-chart.html",
"src/radial-chart-path.html",
],
module_name = "@dynatrace/barista-components/radial-chart",
tsconfig = "tsconfig_lib",
deps = [
"//libs/barista-components/core:compile",
"//libs/barista-components/formatters:compile",
"//libs/barista-components/legend:compile",
"//libs/barista-components/overlay:compile",
"//libs/barista-components/theming:compile",
"@npm//@angular/core",
"@npm//@angular/cdk",
"@npm//@angular/common",
"@npm//@angular/platform-browser",
"@npm//rxjs",
"@npm//@types/d3-shape",
"@npm//d3-shape",
],
)

filegroup(
name = "radial-chart",
srcs = glob(
Expand All @@ -16,7 +51,59 @@ filegroup(
]),
)

sass_binary(
name = "styles",
src = "src/radial-chart.scss",
)

sass_binary(
name = "styles_path",
src = "src/radial-chart-path.scss",
)

stylelint(
name = "stylelint",
srcs = glob(["**/*.scss"]),
)

jest(
name = "test",
srcs = glob(include = ["**/*.spec.ts"]),
jest_config = ":jest.config.json",
setup_file = ":src/test-setup.ts",
ts_config = ":tsconfig_test",
deps = [
":compile",
"//libs/testing/browser",
"//libs/barista-components/core:compile",
"//libs/barista-components/formatters:compile",
"//libs/barista-components/legend:compile",
"//libs/barista-components/overlay:compile",
"//libs/barista-components/theming:compile",
"@npm//@angular/core",
"@npm//@angular/cdk",
"@npm//@angular/common",
"@npm//@angular/platform-browser",
"@npm//rxjs",
"@npm//@types/d3-shape",
"@npm//d3-shape",
],
)

ts_config(
name = "tsconfig_lib",
src = "tsconfig.lib.json",
deps = [
"tsconfig.json",
"//libs/barista-components:tsconfig",
],
)

ts_config(
name = "tsconfig_test",
src = "tsconfig.spec.json",
deps = [
"tsconfig.json",
"//libs/barista-components:tsconfig",
],
)
21 changes: 0 additions & 21 deletions libs/barista-components/radial-chart/jest.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions libs/barista-components/radial-chart/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "radial-chart",
"snapshotSerializers": [
"jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js",
"jest-preset-angular/build/AngularSnapshotSerializer.js",
"jest-preset-angular/build/HTMLCommentSerializer.js"
]
}
2 changes: 1 addition & 1 deletion libs/barista-components/radial-chart/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
Expand Down
8 changes: 0 additions & 8 deletions libs/barista-components/radial-chart/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"],
"include": ["**/*.ts"]
}

0 comments on commit 1b06a0c

Please sign in to comment.