Skip to content

Commit

Permalink
build: migrate remaining @angular/ssr tests to rules_js
Browse files Browse the repository at this point in the history
Migrates the remaining `@angular/ssr` tests to `rules_js`.
  • Loading branch information
devversion authored and alan-agius4 committed Jan 29, 2025
1 parent 6a6ecee commit 539336e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package.json=-744581142
packages/angular/build/package.json=1783072863
packages/angular/cli/package.json=1301682969
packages/angular/pwa/package.json=1108903917
packages/angular/ssr/package.json=1104313629
packages/angular/ssr/package.json=362039201
packages/angular_devkit/architect/package.json=-1496633956
packages/angular_devkit/architect_cli/package.json=1551210941
packages/angular_devkit/build_angular/package.json=-1206066740
Expand All @@ -17,6 +17,6 @@ packages/angular_devkit/schematics/package.json=673943597
packages/angular_devkit/schematics_cli/package.json=-169616762
packages/ngtools/webpack/package.json=1463215526
packages/schematics/angular/package.json=251715148
pnpm-lock.yaml=1844603164
pnpm-lock.yaml=-1995042738
pnpm-workspace.yaml=-1056556036
yarn.lock=346921654
3 changes: 3 additions & 0 deletions packages/angular/ssr/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@npm//@angular/build-tooling/bazel/api-golden:index.bzl", "api_golden_test_npm_package")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//tools:defaults.bzl", "ng_package")
load("//tools:defaults2.bzl", "ts_project")

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

npm_link_all_packages()

ts_project(
name = "ssr",
srcs = glob(
Expand Down
7 changes: 3 additions & 4 deletions packages/angular/ssr/node/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl", "spec_bundle")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults2.bzl", "jasmine_test", "ts_project")

ts_project(
name = "unit_test_lib",
Expand All @@ -22,9 +21,9 @@ spec_bundle(
],
)

jasmine_node_test(
jasmine_test(
name = "test",
deps = [
data = [
":esm_tests_bundled",
],
)
4 changes: 3 additions & 1 deletion packages/angular/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
}
},
"devDependencies": {
"@angular-devkit/schematics": "workspace:*",
"@angular/common": "19.2.0-next.0",
"@angular/compiler": "19.2.0-next.0",
"@angular/core": "19.2.0-next.0",
"@angular/platform-browser": "19.2.0-next.0",
"@angular/platform-server": "19.2.0-next.0",
"@angular/router": "19.2.0-next.0",
"@bazel/runfiles": "^6.0.0"
"@bazel/runfiles": "^6.0.0",
"@schematics/angular": "workspace:*"
},
"sideEffects": false,
"schematics": "./schematics/collection.json",
Expand Down
18 changes: 7 additions & 11 deletions packages/angular/ssr/schematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.dev/license

load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:defaults.bzl", "pkg_npm")
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults2.bzl", "jasmine_test", "ts_project")
load("//tools:ts_json_schema.bzl", "ts_json_schema")

licenses(["notice"])
Expand Down Expand Up @@ -61,8 +60,8 @@ ts_project(
data = [":schematics_assets"],
module_name = "@angular/ssr/schematics",
deps = [
"//packages/angular_devkit/schematics:schematics_rjs",
"//packages/schematics/angular:angular_rjs",
"//packages/angular/ssr:node_modules/@angular-devkit/schematics",
"//packages/angular/ssr:node_modules/@schematics/angular",
],
)

Expand All @@ -80,17 +79,14 @@ ts_project(
),
deps = [
":schematics_rjs",
"//packages/angular_devkit/schematics/testing:testing_rjs",
"//packages/angular/ssr:node_modules/@angular-devkit/schematics",
],
)

jasmine_node_test(
jasmine_test(
name = "ssr_schematics_test",
srcs = [":ssr_schematics_test_lib"],
deps = [
"@npm//jasmine",
"@npm//source-map",
"@npm//typescript",
data = [
":ssr_schematics_test_lib_rjs",
],
)

Expand Down
7 changes: 3 additions & 4 deletions packages/angular/ssr/test/npm_package/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults2.bzl", "jasmine_test", "ts_project")

ts_project(
name = "unit_test_lib",
Expand All @@ -12,10 +11,10 @@ ts_project(
],
)

jasmine_node_test(
jasmine_test(
name = "test",
srcs = [":unit_test_lib"],
data = [
"unit_test_lib_rjs",
"//packages/angular/ssr:npm_package",
],
)
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 539336e

Please sign in to comment.