Cleanups of rules_typescript:

- fix lint/formatting of .bzl files as observed by CircleCI
- restore some files which were dropped in the move to e2e/npm_packages

PiperOrigin-RevId: 232350070
diff --git a/BUILD.bazel b/BUILD.bazel
index df7e9b7..7594bf8 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -80,11 +80,11 @@
         "//ts_auto_deps:npm_package_assets",
     ],
     replacements = {
+        "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "",
         # Do a simple replacement needed to make the local development differ
         # from how our release is used.
         "//devserver:devserver_bin": "//devserver",
         "0.0.0-COMPAT_VERSION": COMPAT_VERSION,
-        "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "",
     },
     deps = [
         "//devserver:devserver-darwin",
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index 99b043a..44483cb 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -18,7 +18,6 @@
 load(":common/json_marshal.bzl", "json_marshal")
 load(":common/module_mappings.bzl", "module_mappings_aspect")
 
-
 _DEBUG = False
 
 DEPS_ASPECTS = [
diff --git a/internal/common/module_mappings.bzl b/internal/common/module_mappings.bzl
index d085d72..a28b327 100644
--- a/internal/common/module_mappings.bzl
+++ b/internal/common/module_mappings.bzl
@@ -33,7 +33,6 @@
 # Traverse 'srcs' in addition so that we can go across a genrule
 _MODULE_MAPPINGS_DEPS_NAMES = ["deps", "srcs", "_helpers"]
 
-
 _DEBUG = False
 
 def debug(msg, values = ()):
diff --git a/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel
new file mode 100644
index 0000000..db3403d
--- /dev/null
+++ b/internal/e2e/npm_packages/typescript_2.7/BUILD.bazel
@@ -0,0 +1,41 @@
+# Copyright 2017 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
+load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
+
+ts_library(
+    name = "main",
+    srcs = ["main.ts"],
+)
+
+ts_library(
+    name = "test_lib",
+    testonly = True,
+    srcs = glob(["*.spec.ts"]),
+    deps = [
+        ":main",
+        "@npm//@bazel/typescript",
+        "@npm//@types/jasmine",
+        "@npm//@types/node",
+    ],
+)
+
+jasmine_node_test(
+    name = "test",
+    deps = [
+        ":test_lib",
+        "@npm//jasmine",
+    ],
+)
diff --git a/internal/e2e/npm_packages/typescript_2.7/WORKSPACE b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE
new file mode 100644
index 0000000..ec66313
--- /dev/null
+++ b/internal/e2e/npm_packages/typescript_2.7/WORKSPACE
@@ -0,0 +1,42 @@
+# Copyright 2017 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+workspace(name = "package_typescript_27_e2e")
+
+local_repository(
+    name = "build_bazel_rules_typescript",
+    path = "../../..",
+)
+
+load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
+
+rules_typescript_dependencies()
+
+load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
+
+rules_nodejs_dependencies()
+
+load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
+
+node_repositories(preserve_symlinks = True)
+
+yarn_install(
+    name = "npm",
+    package_json = "//:package.json",
+    yarn_lock = "//:yarn.lock",
+)
+
+load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
+
+ts_setup_workspace()
diff --git a/internal/e2e/npm_packages/typescript_2.7/tsconfig.json b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/internal/e2e/npm_packages/typescript_2.7/tsconfig.json
diff --git a/internal/karma/BUILD.bazel b/internal/karma/BUILD.bazel
index 815b6da..7fcc0b8 100644
--- a/internal/karma/BUILD.bazel
+++ b/internal/karma/BUILD.bazel
@@ -81,8 +81,8 @@
         "web_test.bzl",
     ],
     replacements = {
-        "0.0.0-COMPAT_VERSION": COMPAT_VERSION,
         "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "",
+        "0.0.0-COMPAT_VERSION": COMPAT_VERSION,
     },
     deps = [
         ":bazel_karma",