Skip to content

Commit

Permalink
refactor: pre-1.0 release breaking changes
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
//:declaration_provider.bzl deleted; load from //:providers.bzl instead
//internal/common:npm_pacakge_info.bzl removed; load from //:providers.bzl instead
transitive_js_ecma_script_module_info macro removed; use js_ecma_script_module_info instead
@npm_bazel_karma//:browser_repositories.bzl removed; use @io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl instead
@npm_bazel_protractor//:browser_repositories.bzl removed; use @io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl instead
ts_web_test & ts_web_test_suite marcos removed; use karma_web_test & karma_web_test_suite instead
  • Loading branch information
gregmagolan authored and alexeagle committed Dec 17, 2019
1 parent 0ee5e7c commit cc64818
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 156 deletions.
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ exports_files([
bzl_library(
name = "bzl",
srcs = [
"declaration_provider.bzl",
"index.bzl",
"index.for_docs.bzl",
"providers.bzl",
Expand Down
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ install_bazel_dependencies()
git_repository(
name = "build_bazel_rules_typescript",
commit = "951ae46a9651e9f6814b303c5902d858cc509aa4",
patch_args = ["-p1"],
patches = ["//:rules_typescript.patch"],
remote = "http://github.com/bazelbuild/rules_typescript.git",
)

Expand Down
26 changes: 0 additions & 26 deletions declaration_provider.bzl

This file was deleted.

2 changes: 2 additions & 0 deletions examples/user_managed_deps/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ local_repository(
git_repository(
name = "build_bazel_rules_typescript",
commit = "951ae46a9651e9f6814b303c5902d858cc509aa4",
patch_args = ["-p1"],
patches = ["//:rules_typescript.patch"],
remote = "http://github.com/bazelbuild/rules_typescript.git",
)

Expand Down
13 changes: 13 additions & 0 deletions examples/user_managed_deps/rules_typescript.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index e815f37..a2b6468 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -17,7 +17,7 @@

load(":common/json_marshal.bzl", "json_marshal")
load(":common/module_mappings.bzl", "module_mappings_aspect")
-load("@build_bazel_rules_nodejs//:declaration_provider.bzl", "DeclarationInfo")
+load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo")

_DEBUG = False

5 changes: 2 additions & 3 deletions examples/web_testing/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"

web_test_repositories()

# Note: intentionally loads from the deprecated location to assert that it still works
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories()
browser_repositories(chromium = True)

load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

Expand Down
5 changes: 2 additions & 3 deletions examples/webapp/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"

web_test_repositories()

# Note: intentionally loads from the deprecated location to assert that it still works
load("@npm_bazel_protractor//:browser_repositories.bzl", "browser_repositories")
load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories()
browser_repositories(chromium = True)
26 changes: 0 additions & 26 deletions internal/common/npm_package_info.bzl

This file was deleted.

7 changes: 0 additions & 7 deletions internal/providers/js_providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,3 @@ Returns a single JSEcmaScriptModuleInfo.
direct_sources = sources,
sources = depset(transitive = transitive_depsets),
)

def transitive_js_ecma_script_module_info(**kwargs):
"""Alias of js_ecma_script_module_info.
TODO(gregmagolan): Remove this alias before 1.0 release.
"""
return js_ecma_script_module_info(**kwargs)
9 changes: 5 additions & 4 deletions packages/karma/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ Finally, configure the rules_webtesting:

```python
# Set up web testing, choose browsers we can test on
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")

web_test_repositories()
browser_repositories(
chromium = True,
)

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(chromium = True)
```

## Installing with self-managed dependencies
Expand Down
1 change: 0 additions & 1 deletion packages/karma/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ filegroup(
name = "package_contents",
srcs = [
"WORKSPACE",
"browser_repositories.bzl",
"index.bzl",
"karma.conf.js",
"karma_web_test.bzl",
Expand Down
28 changes: 0 additions & 28 deletions packages/karma/src/browser_repositories.bzl

This file was deleted.

25 changes: 0 additions & 25 deletions packages/karma/src/index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,3 @@ karma_web_test = _karma_web_test
karma_web_test_suite = _karma_web_test_suite
# DO NOT ADD MORE rules here unless they appear in the generated docsite.
# Run yarn skydoc to re-generate the docsite.

# TODO(gregmagolan): remove ts_web_test & ts_web_test_suite entirely for 1.0 release
def ts_web_test(**kwargs):
"""This rule has been removed. Replace with karma_web_test"""

fail("""***********
The ts_web_test rule has been removed.
The existing karma_web_test rule with an identical API should be used instead.
It can be loaded from `load("@npm_bazel_karma//:index.bzl", "karma_web_test")`.
************
""")

def ts_web_test_suite(**kwargs):
"""This rule has been removed. Replace with ts_web_test_suite"""

fail("""***********
The ts_web_test_suite rule has been removed.
The existing karma_web_test_suite rule with an identical API should be used instead.
It can be loaded from `load("@npm_bazel_karma//:index.bzl", "karma_web_test_suite")`.
************
""")
1 change: 0 additions & 1 deletion packages/protractor/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ stardoc(
filegroup(
name = "package_contents",
srcs = [
"browser_repositories.bzl",
"index.bzl",
"package.bzl",
"package.json",
Expand Down
28 changes: 0 additions & 28 deletions packages/protractor/src/browser_repositories.bzl

This file was deleted.

3 changes: 0 additions & 3 deletions providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ load(
_JSNamedModuleInfo = "JSNamedModuleInfo",
_js_ecma_script_module_info = "js_ecma_script_module_info",
_js_named_module_info = "js_named_module_info",
_transitive_js_ecma_script_module_info = "transitive_js_ecma_script_module_info",
)
load(
"//internal/providers:node_runtime_deps_info.bzl",
Expand All @@ -47,7 +46,6 @@ JSNamedModuleInfo = _JSNamedModuleInfo
js_named_module_info = _js_named_module_info
JSEcmaScriptModuleInfo = _JSEcmaScriptModuleInfo
js_ecma_script_module_info = _js_ecma_script_module_info
transitive_js_ecma_script_module_info = _transitive_js_ecma_script_module_info
NpmPackageInfo = _NpmPackageInfo
node_modules_aspect = _node_modules_aspect

Expand All @@ -57,6 +55,5 @@ NodeContextInfo = provider(
fields = ["stamp"],
)

# TODO: remove transitive_js_ecma_script_module_info alias before 1.0 release
NodeRuntimeDepsInfo = _NodeRuntimeDepsInfo
run_node = _run_node
13 changes: 13 additions & 0 deletions rules_typescript.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index e815f37..a2b6468 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -17,7 +17,7 @@

load(":common/json_marshal.bzl", "json_marshal")
load(":common/module_mappings.bzl", "module_mappings_aspect")
-load("@build_bazel_rules_nodejs//:declaration_provider.bzl", "DeclarationInfo")
+load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo")

_DEBUG = False

0 comments on commit cc64818

Please sign in to comment.