Skip to content

Commit

Permalink
Tear out OSS-only parts of rules_typescript
Browse files Browse the repository at this point in the history
These already moved to rules_nodejs

Closes bazelbuild#429

PiperOrigin-RevId: 241422158
  • Loading branch information
alexeagle committed Apr 1, 2019
1 parent 9f812ea commit 2532bcb
Show file tree
Hide file tree
Showing 113 changed files with 56 additions and 7,965 deletions.
Expand Up @@ -17,9 +17,6 @@ platforms:
- "@nodejs//:yarn"
build_targets:
- "..."
# Run some targets again, but addressed as an external repo
# TODO(alexeagle): run all of them after fixing https://github.com/bazelbuild/rules_typescript/issues/243
- "@npm_bazel_typescript//examples/some_library:lib"
test_flags:
# TODO(gregmagolan): shared libs needed by chrome & firefox not available on ubuntu1604
- "--test_tag_filters=-browser:chromium-local,-browser:firefox-local"
Expand Down
33 changes: 2 additions & 31 deletions packages/concatjs/third_party/google3/rules_typescript/BUILD.bazel
Expand Up @@ -22,48 +22,19 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
load("@build_bazel_rules_nodejs//:defs.bzl", "npm_package")
load("@build_bazel_rules_nodejs//internal/js_library:js_library.bzl", "js_library")

# ts_library defaults to this label in the top-level package.
# Point to where the file actually lives.
alias(
name = "tsconfig.json",
actual = "//examples:tsconfig.json",
visibility = ["//visibility:public"],
)

exports_files(["LICENSE"])
exports_files(["LICENSE", "tsconfig.json"])

gazelle(
name = "gazelle",
prefix = "github.com/bazelbuild/rules_typescript",
)

# Runtime libraries needed by the protobufjs library.
# Any JS code produced by the ts_proto_library rule has a runtime dependency on these scripts.
js_library(
name = "protobufjs_bootstrap_scripts",
srcs = [
"@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/long:dist/long.js",
"@build_bazel_rules_typescript_protobufs_compiletime_deps//node_modules/protobufjs:dist/minimal/protobuf.min.js",
],
# Make devmode loading work when it does require("protobufjs/minimal")
# so this is shimmed to define it to equal global.protobuf
amd_names = {
"long": "Long",
"protobufjs/minimal": "protobuf",
},
visibility = ["//visibility:public"],
)


# This package is included in the npm_bazel_typescript package in rules_nodejs/packages/typescript
npm_package(
name = "npm_bazel_typescript_package",
srcs = [
"//third_party/github.com/bazelbuild/bazel/src/main/protobuf:npm_package_assets",
"//internal:common/compilation.bzl",
"//internal:common/json_marshal.bzl",
"//internal:common/module_mappings.bzl",
"//internal:common/tsconfig.bzl",
"//internal:npm_package_assets",
],
deps = [
"//internal:generated_BUILD",
Expand Down
@@ -1,8 +1,5 @@
# build_bazel_rules_typescript

> Looking for documentation for TypeScript bazel rules that used to be here?
> See https://npmjs.com/package/@bazel/typescript
This repo contains a mirror of some Google-internal bits that support TypeScript development under Bazel.

It contains these utilities:
Expand Down
36 changes: 5 additions & 31 deletions packages/concatjs/third_party/google3/rules_typescript/WORKSPACE
Expand Up @@ -12,26 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

workspace(name = "npm_bazel_typescript")

# Load nested npm_bazel_karma repository
local_repository(
name = "npm_bazel_karma",
path = "internal/karma",
)
workspace(name = "build_bazel_rules_typescript")

# Load our dependencies
load("//:package.bzl", "rules_typescript_dev_dependencies")

rules_typescript_dev_dependencies()

# Load rules_karma dependencies
load("@npm_bazel_karma//:package.bzl", "rules_karma_dependencies")

rules_karma_dependencies()

# Setup nodejs toolchain
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")

# Use a bazel-managed npm dependency, allowing us to test resolution to these paths
yarn_install(
Expand All @@ -40,16 +29,16 @@ yarn_install(
yarn_lock = "//examples/bazel_managed_deps:yarn.lock",
)

# Install a hermetic version of node.
node_repositories()

# Download npm dependencies
yarn_install(
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
)

load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")
install_bazel_dependencies()

# Setup rules_go toolchain
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")

Expand All @@ -67,21 +56,6 @@ load("//internal:ts_repositories.bzl", "ts_setup_dev_workspace")

ts_setup_dev_workspace()

# Dependencies for generating documentation
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")

sass_repositories()

# Setup rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")

web_test_repositories()

# Setup browser repositories
load("@npm_bazel_karma//:browser_repositories.bzl", "browser_repositories")

browser_repositories()

local_repository(
name = "devserver_test_workspace",
path = "devserver/devserver/test/test-workspace",
Expand Down
29 changes: 0 additions & 29 deletions packages/concatjs/third_party/google3/rules_typescript/defs.bzl

This file was deleted.

This file was deleted.

Expand Up @@ -47,9 +47,9 @@ func TestDevserverFileHandling(t *testing.T) {
handler := CreateFileHandler("/app.js", "manifest.MF", []string{
// This verifies that we can resolve relatively to the current package. Usually the
// devserver Bazel rule adds the current package here.
"npm_bazel_typescript/devserver/devserver",
"build_bazel_rules_typescript/devserver/devserver",
// Verifies that we can specify subfolders of workspaces
"npm_bazel_typescript/devserver/devserver/test",
"build_bazel_rules_typescript/devserver/devserver/test",
// Verifies that we can specify external workspaces as root dirs.
"devserver_test_workspace",
// Verifies that we can specify subfolders from external workspaces.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2532bcb

Please sign in to comment.