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

Commit

Permalink
ci(bazel): Bazelify tile component.
Browse files Browse the repository at this point in the history
Build and test tile component with bazel.
  • Loading branch information
Lukas Holzer authored and lukasholzer committed Jul 21, 2020
1 parent bdb567f commit c6fe1fd
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 111 deletions.
9 changes: 0 additions & 9 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -2773,15 +2773,6 @@
"!libs/barista-components/tile/**/*"
]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/barista-components/tile/jest.config.js",
"tsConfig": "libs/barista-components/tile/tsconfig.spec.json",
"setupFile": "libs/barista-components/tile/src/test-setup.ts",
"passWithNoTests": true
}
}
},
"schematics": {}
Expand Down
72 changes: 71 additions & 1 deletion libs/barista-components/tile/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
load("//tools/bazel_rules:index.bzl", "stylelint")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
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"])

Expand All @@ -16,7 +18,75 @@ filegroup(
]),
)

ng_module_view_engine(
name = "compile",
srcs = glob(
include = ["**/*.ts"],
exclude = [
"**/*.spec.ts",
"src/test-setup.ts",
],
),
angular_assets = [
":styles",
":src/tile.html",
],
module_name = "@dynatrace/barista-components/tile",
tsconfig = "tsconfig_lib",
deps = [
"//libs/barista-components/core:compile",
"@npm//@angular/core",
"@npm//@angular/common",
"@npm//@angular/cdk",
],
)

sass_library(
name = "theme",
srcs = glob(
["src/_tile-theme.scss"],
),
)

sass_binary(
name = "styles",
src = "src/tile.scss",
deps = [":theme"],
)

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",
"@npm//@angular/core",
],
)

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

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",
],
)
10 changes: 0 additions & 10 deletions libs/barista-components/tile/jest.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions libs/barista-components/tile/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "tile",
"snapshotSerializers": [
"jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js",
"jest-preset-angular/build/AngularSnapshotSerializer.js",
"jest-preset-angular/build/HTMLCommentSerializer.js"
]
}
82 changes: 0 additions & 82 deletions libs/barista-components/tile/src/chart-colors.ts

This file was deleted.

2 changes: 1 addition & 1 deletion libs/barista-components/tile/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
Expand Down
8 changes: 0 additions & 8 deletions libs/barista-components/tile/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,5 @@
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"]
}

0 comments on commit c6fe1fd

Please sign in to comment.