-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
load("//client/shared/dev:tools.bzl", "module_style_typings") | ||
load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
|
||
module_style_typings( | ||
name = "module_style_typings", | ||
deps = ["//client/wildcard"], | ||
) | ||
|
||
js_library( | ||
name = "graphql_operations_files", | ||
# Keep in sync with glob in client/shared/dev/generateGraphQlOperations.js | ||
srcs = glob( | ||
[ | ||
"src/**/*.ts", | ||
"src/**/*.tsx", | ||
], | ||
), | ||
visibility = ["//client/jetbrains:__pkg__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
load("//client/shared/dev:tools.bzl", "module_style_typings") | ||
|
||
module_style_typings( | ||
name = "module_style_typings", | ||
deps = ["//client/wildcard"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
"Bazel macros for building frontend packages" | ||
|
||
load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
load("@npm//:typed-scss-modules/package_json.bzl", types_scss_modules_bin = "bin") | ||
|
||
def module_style_typings(name, deps = []): | ||
"""Generate TypeScript types for module.scss files. | ||
Automatically globs all module.scss files in the Bazel package and | ||
outputs equivalent .d.ts files next to the styles in the output | ||
tree. | ||
Args: | ||
name: Name of the target | ||
deps: Additional dependencies imported by any of the source style files. | ||
These could be other .scss files or node_modules deps. | ||
""" | ||
|
||
srcs = native.glob([ | ||
"src/**/*.module.scss", | ||
"webview/**/*.module.scss", # JetBrains client folder structure slightly different | ||
]) | ||
|
||
outs = ["%s.d.ts" % src for src in srcs] | ||
|
||
js_library( | ||
name = "%s_sources" % name, | ||
srcs = srcs, | ||
) | ||
|
||
types_scss_modules_bin.tsm( | ||
name = name, | ||
srcs = [":%s_sources" % name] + deps, | ||
outs = outs, | ||
args = [ | ||
"--logLevel", | ||
"error", | ||
"%s/**/*.module.scss" % native.package_name(), | ||
"--includePaths", | ||
"client", | ||
"node_modules", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
load("//client/shared/dev:tools.bzl", "module_style_typings") | ||
|
||
module_style_typings( | ||
name = "module_style_typings", | ||
deps = [ | ||
":wildcard", | ||
"//:node_modules/@reach/dialog", | ||
"//:node_modules/@reach/tabs", | ||
], | ||
) | ||
|
||
js_library( | ||
name = "wildcard", | ||
srcs = glob(["src/**/*.scss"]), | ||
visibility = ["//client:__subpackages__"], | ||
) |