noredink-ui/BUCK
2023-05-09 13:15:30 -05:00

66 lines
1.5 KiB
Python

# A list of available rules and their signatures can be found here: https://buck2.build/docs/api/rules/
load("@prelude-nri//:elm.bzl", "elm_docs", "elm_format_diffs")
load("@prelude-nri//:node.bzl", "node_modules", "npm_bin", "npm_script_test")
elm_docs(
name = "docs.json",
elm_json = "elm.json",
src = "src",
)
filegroup(
name = "src",
srcs = glob(["src/**/*.elm"]),
visibility = ["//component-catalog:app"],
)
node_modules(
name = "node_modules",
package = "package.json",
package_lock = "package-lock.json",
extra_files = {
"lib": "//lib:src"
},
extra_args = ["--include=dev"],
)
npm_bin(
name = "browserify",
node_modules = ":node_modules",
visibility = ["//lib:bundle.js"],
)
npm_bin(
name = "prettier",
node_modules = ":node_modules",
visibility = ["//lib:prettier_diffs"]
)
export_file(
name = "elm.json",
visibility = ["//component-catalog:public"],
)
npm_script_test(
name = "puppeteer",
node_modules = ":node_modules",
args = ["default", "$(location //component-catalog:public)"],
extra_files = {
"script/puppeteer-tests.sh": "script/puppeteer-tests.sh",
"script/puppeteer-tests.js": "script/puppeteer-tests.js",
},
)
elm_format_diffs(
name = "elm_format_diffs",
srcs = glob(["src/**/*.elm"]),
)
genrule(
name = "elm_format",
out = "elm_format.py",
srcs = ["script/elm_format.py"],
cmd = "cp $SRCS $OUT",
executable = True,
)