noredink-ui/BUCK

92 lines
2.0 KiB
Python
Raw Normal View History

2023-04-27 00:10:36 +03:00
# A list of available rules and their signatures can be found here: https://buck2.build/docs/api/rules/
2023-05-24 23:07:37 +03:00
load("@prelude-nri//:elm.bzl", "elm_docs", "elm_format_diffs", "elm_test")
2023-05-10 16:36:51 +03:00
load("@prelude-nri//:node.bzl", "node_modules", "npm_bin", "npm_script_test", "prettier_diffs")
2023-04-27 00:10:36 +03:00
2023-04-27 01:15:52 +03:00
elm_docs(
name = "docs.json",
elm_json = "elm.json",
src = "src",
2023-05-24 23:07:37 +03:00
tests = [
":elm_test",
],
)
elm_test(
name = "elm_test",
test_srcs = glob(["tests/**/*.elm"]),
elm_test = ":elm_test_binary",
2023-04-27 00:10:36 +03:00
)
2023-04-27 01:15:52 +03:00
2023-04-27 01:22:21 +03:00
filegroup(
name = "src",
srcs = glob(["src/**/*.elm"]),
visibility = ["//component-catalog:app"],
2023-04-27 01:22:21 +03:00
)
node_modules(
name = "node_modules",
package = "package.json",
package_lock = "package-lock.json",
extra_files = {
"lib": "//lib:src"
},
2023-05-04 19:11:30 +03:00
extra_args = ["--include=dev"],
)
npm_bin(
name = "browserify",
node_modules = ":node_modules",
visibility = ["//lib:bundle.js"],
)
2023-05-02 23:59:09 +03:00
2023-05-09 21:15:30 +03:00
npm_bin(
name = "prettier",
node_modules = ":node_modules",
2023-05-10 16:44:46 +03:00
visibility = [
"//lib:prettier_diffs",
"//component-catalog:prettier_diffs",
],
2023-05-09 21:15:30 +03:00
)
npm_bin(
name = "elm_test_binary",
bin_name = "elm-test",
node_modules = ":node_modules",
visibility = ["//component-catalog:elm_test"],
)
2023-05-02 23:59:09 +03:00
export_file(
name = "elm.json",
visibility = ["//component-catalog:public"],
)
2023-05-04 00:00:31 +03:00
npm_script_test(
name = "puppeteer",
node_modules = ":node_modules",
args = ["default", "public"],
extra_files = {
"script/puppeteer-tests.sh": "script/puppeteer-tests.sh",
"script/puppeteer-tests.js": "script/puppeteer-tests.js",
"public": "//component-catalog:public",
},
2023-05-04 00:00:31 +03:00
)
elm_format_diffs(
name = "elm_format_diffs",
srcs = glob(["src/**/*.elm"]),
)
2023-05-05 22:51:10 +03:00
genrule(
name = "diff_to_comment",
out = "diff_to_comment.py",
srcs = ["script/diff_to_comment.py"],
2023-05-05 22:51:10 +03:00
cmd = "cp $SRCS $OUT",
executable = True,
)
2023-05-10 16:36:51 +03:00
prettier_diffs(
name = "prettier_diffs",
srcs = glob(["**/*.md", "script/**/*.js"]),
2023-05-10 16:36:51 +03:00
prettier = "//:prettier",
)