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

Commit

Permalink
build(consumption): Bazelify consumption component.
Browse files Browse the repository at this point in the history
  • Loading branch information
rebu-dt authored and lukasholzer committed Oct 8, 2020
1 parent d89e218 commit 66dccf9
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 38 deletions.
7 changes: 0 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -1364,13 +1364,6 @@
"!libs/barista-components/consumption/**/*"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/barista-components/consumption/jest.config.js",
"passWithNoTests": true
}
}
},
"schematics": {}
Expand Down
69 changes: 68 additions & 1 deletion libs/barista-components/consumption/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
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",
"src/consumption.html",
],
module_name = "@dynatrace/barista-components/consumption",
tsconfig = "tsconfig_lib",
deps = [
"//libs/barista-components/core:compile",
"//libs/barista-components/progress-bar:compile",
"//libs/barista-components/theming:compile",
"@npm//@angular/core",
"@npm//@angular/cdk",
],
)

filegroup(
name = "consumption",
srcs = glob(
Expand All @@ -16,7 +42,48 @@ filegroup(
]),
)

sass_binary(
name = "styles",
src = "src/consumption.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",
"@npm//@angular/platform-browser",
"//libs/barista-components/core:compile",
"//libs/barista-components/progress-bar:compile",
"//libs/barista-components/theming:compile",
"@npm//@angular/core",
"@npm//@angular/cdk",
],
)

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/consumption/jest.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions libs/barista-components/consumption/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "consumption",
"snapshotSerializers": [
"jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js",
"jest-preset-angular/build/AngularSnapshotSerializer.js",
"jest-preset-angular/build/HTMLCommentSerializer.js"
],
"passWithNoTests": "true"
}
2 changes: 1 addition & 1 deletion libs/barista-components/consumption/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/consumption/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 66dccf9

Please sign in to comment.