From 8a427ec1551e712ce1033793ccfd110f0bf50718 Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Sat, 18 Feb 2023 21:59:24 -0800 Subject: [PATCH] Moves TypeScript rules into `//tools/typescript/...`. Refs #67. This is just for better organization and to split the implementation into multiple files. --- BUILD.bazel | 2 +- common/BUILD.bazel | 2 +- common/models/BUILD.bazel | 2 +- common/testing/BUILD.bazel | 2 +- examples/components/BUILD.bazel | 2 +- examples/custom_bundling/BUILD.bazel | 2 +- .../custom_bundling/component/BUILD.bazel | 2 +- .../custom_bundling/transitive/BUILD.bazel | 2 +- examples/data/BUILD.bazel | 2 +- examples/declarative_shadow_dom/BUILD.bazel | 2 +- examples/javascript/BUILD.bazel | 2 +- examples/minimal/BUILD.bazel | 2 +- examples/multi_page/BUILD.bazel | 2 +- examples/prerender_resources/BUILD.bazel | 2 +- examples/resources/BUILD.bazel | 2 +- examples/scripts/BUILD.bazel | 2 +- examples/scripts/component/BUILD.bazel | 2 +- examples/scripts/transitive/BUILD.bazel | 2 +- examples/site/blog/BUILD.bazel | 2 +- examples/site/common/BUILD.bazel | 2 +- examples/site/components/base/BUILD.bazel | 2 +- examples/site/components/counter/BUILD.bazel | 2 +- examples/site/components/footer/BUILD.bazel | 2 +- examples/site/components/header/BUILD.bazel | 2 +- examples/site/home/BUILD.bazel | 2 +- examples/styles/BUILD.bazel | 2 +- examples/testonly/BUILD.bazel | 2 +- examples/testonly/component/BUILD.bazel | 2 +- examples/testonly/transitive/BUILD.bazel | 2 +- examples/tsjs/BUILD.bazel | 2 +- packages/annotation_extractor/BUILD.bazel | 2 +- packages/css_bundler/BUILD.bazel | 2 +- packages/declarative_shadow_dom/BUILD.bazel | 2 +- packages/renderer/BUILD.bazel | 2 +- packages/resource_injector/BUILD.bazel | 2 +- packages/resource_packager/BUILD.bazel | 2 +- packages/rules_prerender/BUILD.bazel | 2 +- .../link_prerender_component.bzl | 2 +- .../BUILD.bazel | 2 +- packages/script_entry_generator/BUILD.bazel | 2 +- tools/BUILD.bazel | 1 - tools/typescript/BUILD.bazel | 20 +++++++++++++++++++ tools/typescript/defs.bzl | 5 +++++ tools/typescript/ts_project.bzl | 10 ++++++++++ .../types_only.bzl} | 10 ---------- 45 files changed, 75 insertions(+), 51 deletions(-) delete mode 100644 tools/BUILD.bazel create mode 100644 tools/typescript/BUILD.bazel create mode 100644 tools/typescript/defs.bzl create mode 100644 tools/typescript/ts_project.bzl rename tools/{typescript.bzl => typescript/types_only.bzl} (76%) diff --git a/BUILD.bazel b/BUILD.bazel index 48e8f76c..75e27405 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -6,7 +6,7 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@rules_prerender_npm//:defs.bzl", "npm_link_all_packages") load("//tools/publish:npm_publish.bzl", "npm_publish") load("//tools/stamping:stamp_package.bzl", "stamp_package") -load("//tools:typescript.bzl", "types_only") +load("//tools/typescript:defs.bzl", "types_only") load("//:index.bzl", "link_prerender_component", "prerender_component") exports_files([".npmrc"], visibility = ["//visibility:public"]) diff --git a/common/BUILD.bazel b/common/BUILD.bazel index 77b8a5a9..ca09c6ea 100644 --- a/common/BUILD.bazel +++ b/common/BUILD.bazel @@ -1,6 +1,6 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load(":label_test.bzl", "label_test_suite") load(":paths_test.bzl", "paths_test_suite") diff --git a/common/models/BUILD.bazel b/common/models/BUILD.bazel index 25d43ef3..ddca76a4 100644 --- a/common/models/BUILD.bazel +++ b/common/models/BUILD.bazel @@ -1,5 +1,5 @@ load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") ts_project( name = "prerender_annotation", diff --git a/common/testing/BUILD.bazel b/common/testing/BUILD.bazel index 37f65bbc..0246a84f 100644 --- a/common/testing/BUILD.bazel +++ b/common/testing/BUILD.bazel @@ -1,6 +1,6 @@ load("//:index.bzl", "web_resources", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_node_test", "jasmine_web_test_suite") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") ts_project( name = "binary", diff --git a/examples/components/BUILD.bazel b/examples/components/BUILD.bazel index 7a8eb733..7be6b26b 100644 --- a/examples/components/BUILD.bazel +++ b/examples/components/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "prerender_component", diff --git a/examples/custom_bundling/BUILD.bazel b/examples/custom_bundling/BUILD.bazel index f3d15663..b017347a 100644 --- a/examples/custom_bundling/BUILD.bazel +++ b/examples/custom_bundling/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_rules_rollup//rollup:defs.bzl", "rollup_bundle") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "extract_single_resource", diff --git a/examples/custom_bundling/component/BUILD.bazel b/examples/custom_bundling/component/BUILD.bazel index 6c3e21dc..a4a61e16 100644 --- a/examples/custom_bundling/component/BUILD.bazel +++ b/examples/custom_bundling/component/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_component") prerender_component( diff --git a/examples/custom_bundling/transitive/BUILD.bazel b/examples/custom_bundling/transitive/BUILD.bazel index a502ce0d..3b46f783 100644 --- a/examples/custom_bundling/transitive/BUILD.bazel +++ b/examples/custom_bundling/transitive/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_component") prerender_component( diff --git a/examples/data/BUILD.bazel b/examples/data/BUILD.bazel index c8c47e4f..643eefbc 100644 --- a/examples/data/BUILD.bazel +++ b/examples/data/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/declarative_shadow_dom/BUILD.bazel b/examples/declarative_shadow_dom/BUILD.bazel index cc37006f..1d36c58c 100644 --- a/examples/declarative_shadow_dom/BUILD.bazel +++ b/examples/declarative_shadow_dom/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "css_library", diff --git a/examples/javascript/BUILD.bazel b/examples/javascript/BUILD.bazel index ec574e62..39dd371e 100644 --- a/examples/javascript/BUILD.bazel +++ b/examples/javascript/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/minimal/BUILD.bazel b/examples/minimal/BUILD.bazel index 0843a896..ba4a4c8a 100644 --- a/examples/minimal/BUILD.bazel +++ b/examples/minimal/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/multi_page/BUILD.bazel b/examples/multi_page/BUILD.bazel index 7c797560..79cde98f 100644 --- a/examples/multi_page/BUILD.bazel +++ b/examples/multi_page/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "css_library", diff --git a/examples/prerender_resources/BUILD.bazel b/examples/prerender_resources/BUILD.bazel index ffab0e4c..a36f3145 100644 --- a/examples/prerender_resources/BUILD.bazel +++ b/examples/prerender_resources/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_resources") load("//tools/jasmine:defs.bzl", "jasmine_node_test") diff --git a/examples/resources/BUILD.bazel b/examples/resources/BUILD.bazel index c6a6f991..83f7f030 100644 --- a/examples/resources/BUILD.bazel +++ b/examples/resources/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "prerender_pages", diff --git a/examples/scripts/BUILD.bazel b/examples/scripts/BUILD.bazel index 17e7af80..f5ea8bbb 100644 --- a/examples/scripts/BUILD.bazel +++ b/examples/scripts/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/scripts/component/BUILD.bazel b/examples/scripts/component/BUILD.bazel index fed594a0..bf1013fb 100644 --- a/examples/scripts/component/BUILD.bazel +++ b/examples/scripts/component/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_component") prerender_component( diff --git a/examples/scripts/transitive/BUILD.bazel b/examples/scripts/transitive/BUILD.bazel index 48060ca7..4782c7b7 100644 --- a/examples/scripts/transitive/BUILD.bazel +++ b/examples/scripts/transitive/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_component") prerender_component( diff --git a/examples/site/blog/BUILD.bazel b/examples/site/blog/BUILD.bazel index 04d4a1ef..08dc7179 100644 --- a/examples/site/blog/BUILD.bazel +++ b/examples/site/blog/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages") load("//tools/jasmine:defs.bzl", "jasmine_node_test") diff --git a/examples/site/common/BUILD.bazel b/examples/site/common/BUILD.bazel index aa2ea11c..194b05fb 100644 --- a/examples/site/common/BUILD.bazel +++ b/examples/site/common/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library") ts_project( diff --git a/examples/site/components/base/BUILD.bazel b/examples/site/components/base/BUILD.bazel index 84d19f3e..351f4aec 100644 --- a/examples/site/components/base/BUILD.bazel +++ b/examples/site/components/base/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_component") load("//tools/jasmine:defs.bzl", "jasmine_node_test") diff --git a/examples/site/components/counter/BUILD.bazel b/examples/site/components/counter/BUILD.bazel index 4c4a6586..3acdd011 100644 --- a/examples/site/components/counter/BUILD.bazel +++ b/examples/site/components/counter/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "prerender_component", diff --git a/examples/site/components/footer/BUILD.bazel b/examples/site/components/footer/BUILD.bazel index 91b44d02..553e7272 100644 --- a/examples/site/components/footer/BUILD.bazel +++ b/examples/site/components/footer/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_component") load("//tools/jasmine:defs.bzl", "jasmine_node_test") diff --git a/examples/site/components/header/BUILD.bazel b/examples/site/components/header/BUILD.bazel index 84704776..c95802bd 100644 --- a/examples/site/components/header/BUILD.bazel +++ b/examples/site/components/header/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_component") load("//tools/jasmine:defs.bzl", "jasmine_node_test") diff --git a/examples/site/home/BUILD.bazel b/examples/site/home/BUILD.bazel index 3a94cff5..6b315fde 100644 --- a/examples/site/home/BUILD.bazel +++ b/examples/site/home/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/styles/BUILD.bazel b/examples/styles/BUILD.bazel index 1a0baef3..a530c07e 100644 --- a/examples/styles/BUILD.bazel +++ b/examples/styles/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/examples/testonly/BUILD.bazel b/examples/testonly/BUILD.bazel index 0c6c5693..863cf867 100644 --- a/examples/testonly/BUILD.bazel +++ b/examples/testonly/BUILD.bazel @@ -1,5 +1,5 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load( "//:index.bzl", "css_library", diff --git a/examples/testonly/component/BUILD.bazel b/examples/testonly/component/BUILD.bazel index 6260b17c..0fc0d019 100644 --- a/examples/testonly/component/BUILD.bazel +++ b/examples/testonly/component/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_component", "web_resources") prerender_component( diff --git a/examples/testonly/transitive/BUILD.bazel b/examples/testonly/transitive/BUILD.bazel index 0b974744..06f4ffb2 100644 --- a/examples/testonly/transitive/BUILD.bazel +++ b/examples/testonly/transitive/BUILD.bazel @@ -1,4 +1,4 @@ -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "css_library", "prerender_component", "web_resources") prerender_component( diff --git a/examples/tsjs/BUILD.bazel b/examples/tsjs/BUILD.bazel index 0d43c99c..d6cb1d5b 100644 --- a/examples/tsjs/BUILD.bazel +++ b/examples/tsjs/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_rules_js//js:defs.bzl", "js_library") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//:index.bzl", "prerender_pages", "web_resources_devserver") load("//tools/jasmine:defs.bzl", "jasmine_web_test_suite") diff --git a/packages/annotation_extractor/BUILD.bazel b/packages/annotation_extractor/BUILD.bazel index 45bb12d8..78187d7b 100644 --- a/packages/annotation_extractor/BUILD.bazel +++ b/packages/annotation_extractor/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") js_binary( name = "annotation_extractor", diff --git a/packages/css_bundler/BUILD.bazel b/packages/css_bundler/BUILD.bazel index a9108a1d..74def92f 100644 --- a/packages/css_bundler/BUILD.bazel +++ b/packages/css_bundler/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//tools/jasmine:defs.bzl", "jasmine_node_test") bzl_library( diff --git a/packages/declarative_shadow_dom/BUILD.bazel b/packages/declarative_shadow_dom/BUILD.bazel index ab0fa19d..d887a994 100644 --- a/packages/declarative_shadow_dom/BUILD.bazel +++ b/packages/declarative_shadow_dom/BUILD.bazel @@ -8,7 +8,7 @@ load( "prerender_component_publish_files", ) load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//tools/publish:npm_publish.bzl", "npm_publish") load("//tools/stamping:stamp_package.bzl", "stamp_package") diff --git a/packages/renderer/BUILD.bazel b/packages/renderer/BUILD.bazel index 5b305cdb..9cead3a0 100644 --- a/packages/renderer/BUILD.bazel +++ b/packages/renderer/BUILD.bazel @@ -1,6 +1,6 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load(":build_vars.bzl", "RENDERER_RUNTIME_DEPS") ts_project( diff --git a/packages/resource_injector/BUILD.bazel b/packages/resource_injector/BUILD.bazel index 5210a0a2..34fed9ca 100644 --- a/packages/resource_injector/BUILD.bazel +++ b/packages/resource_injector/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") js_binary( name = "resource_injector", diff --git a/packages/resource_packager/BUILD.bazel b/packages/resource_packager/BUILD.bazel index c907962b..beb3de8b 100644 --- a/packages/resource_packager/BUILD.bazel +++ b/packages/resource_packager/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") js_binary( name = "resource_packager", diff --git a/packages/rules_prerender/BUILD.bazel b/packages/rules_prerender/BUILD.bazel index 9ce4b045..f9a45b8e 100644 --- a/packages/rules_prerender/BUILD.bazel +++ b/packages/rules_prerender/BUILD.bazel @@ -1,7 +1,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("//:index.bzl", "prerender_component") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") exports_files( ["rollup-default.config.js"], diff --git a/packages/rules_prerender/link_prerender_component.bzl b/packages/rules_prerender/link_prerender_component.bzl index d90392c4..367f4cc1 100644 --- a/packages/rules_prerender/link_prerender_component.bzl +++ b/packages/rules_prerender/link_prerender_component.bzl @@ -1,5 +1,5 @@ load("@aspect_rules_js//js:providers.bzl", "JsInfo") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") load("//packages/rules_prerender:web_resources.bzl", "WebResourceInfo") def link_prerender_component(name, package, visibility = None, testonly = None): diff --git a/packages/rules_prerender/prerender_component_publish_files_testdata/BUILD.bazel b/packages/rules_prerender/prerender_component_publish_files_testdata/BUILD.bazel index 11dcdd69..8e689df3 100644 --- a/packages/rules_prerender/prerender_component_publish_files_testdata/BUILD.bazel +++ b/packages/rules_prerender/prerender_component_publish_files_testdata/BUILD.bazel @@ -9,7 +9,7 @@ load( load("//packages/rules_prerender:web_resources.bzl", "web_resources") load("//packages/rules_prerender/css:css_library.bzl", "css_library") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") prerender_component( name = "component", diff --git a/packages/script_entry_generator/BUILD.bazel b/packages/script_entry_generator/BUILD.bazel index fae55aee..e056f6e8 100644 --- a/packages/script_entry_generator/BUILD.bazel +++ b/packages/script_entry_generator/BUILD.bazel @@ -1,6 +1,6 @@ load("@aspect_rules_js//js:defs.bzl", "js_binary") load("//tools/jasmine:defs.bzl", "jasmine_node_test") -load("//tools:typescript.bzl", "ts_project") +load("//tools/typescript:defs.bzl", "ts_project") js_binary( name = "script_entry_generator", diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel deleted file mode 100644 index 8b137891..00000000 --- a/tools/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tools/typescript/BUILD.bazel b/tools/typescript/BUILD.bazel new file mode 100644 index 00000000..58d298dd --- /dev/null +++ b/tools/typescript/BUILD.bazel @@ -0,0 +1,20 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "defs", + srcs = ["defs.bzl"], + deps = [ + ":ts_project", + ":types_only", + ], +) + +bzl_library( + name = "ts_project", + srcs = ["ts_project.bzl"], +) + +bzl_library( + name = "types_only", + srcs = ["types_only.bzl"], +) diff --git a/tools/typescript/defs.bzl b/tools/typescript/defs.bzl new file mode 100644 index 00000000..70bdb8d9 --- /dev/null +++ b/tools/typescript/defs.bzl @@ -0,0 +1,5 @@ +load(":ts_project.bzl", _ts_project = "ts_project") +load(":types_only.bzl", _types_only = "types_only") + +ts_project = _ts_project +types_only = _types_only diff --git a/tools/typescript/ts_project.bzl b/tools/typescript/ts_project.bzl new file mode 100644 index 00000000..0d0dea84 --- /dev/null +++ b/tools/typescript/ts_project.bzl @@ -0,0 +1,10 @@ +load("@aspect_rules_ts//ts:defs.bzl", _ts_project = "ts_project") + +def ts_project(name, tsconfig = None, **kwargs): + _ts_project( + name = name, + tsconfig = tsconfig or "//:tsconfig", + declaration = True, + source_map = True, + **kwargs + ) diff --git a/tools/typescript.bzl b/tools/typescript/types_only.bzl similarity index 76% rename from tools/typescript.bzl rename to tools/typescript/types_only.bzl index 079649e7..ea6de24c 100644 --- a/tools/typescript.bzl +++ b/tools/typescript/types_only.bzl @@ -1,14 +1,4 @@ load("@aspect_rules_js//js:providers.bzl", "JsInfo", "js_info") -load("@aspect_rules_ts//ts:defs.bzl", _ts_project = "ts_project") - -def ts_project(name, tsconfig = None, **kwargs): - _ts_project( - name = name, - tsconfig = tsconfig or "//:tsconfig", - declaration = True, - source_map = True, - **kwargs - ) def _types_only_impl(ctx): info = ctx.attr.dep[JsInfo]