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",
|
2023-04-28 00:49:50 +03:00
|
|
|
src = "src",
|
2023-05-24 23:07:37 +03:00
|
|
|
tests = [
|
|
|
|
":elm_test",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
elm_test(
|
|
|
|
name = "elm_test",
|
|
|
|
test_srcs = glob(["test/**/*.elm"]),
|
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"]),
|
2023-05-02 16:48:58 +03:00
|
|
|
visibility = ["//component-catalog:app"],
|
2023-04-27 01:22:21 +03:00
|
|
|
)
|
2023-05-01 22:56:57 +03:00
|
|
|
|
|
|
|
node_modules(
|
|
|
|
name = "node_modules",
|
|
|
|
package = "package.json",
|
|
|
|
package_lock = "package-lock.json",
|
2023-05-03 23:51:17 +03:00
|
|
|
extra_files = {
|
|
|
|
"lib": "//lib:src"
|
|
|
|
},
|
2023-05-04 19:11:30 +03:00
|
|
|
extra_args = ["--include=dev"],
|
2023-05-01 22:56:57 +03:00
|
|
|
)
|
2023-05-02 13:57:56 +03:00
|
|
|
|
|
|
|
npm_bin(
|
|
|
|
name = "browserify",
|
|
|
|
node_modules = ":node_modules",
|
2023-05-02 14:12:19 +03:00
|
|
|
visibility = ["//lib:bundle.js"],
|
2023-05-02 13:57:56 +03:00
|
|
|
)
|
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
|
|
|
)
|
|
|
|
|
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", "$(location //component-catalog:public)"],
|
2023-05-05 01:10:21 +03:00
|
|
|
extra_files = {
|
|
|
|
"script/puppeteer-tests.sh": "script/puppeteer-tests.sh",
|
|
|
|
"script/puppeteer-tests.js": "script/puppeteer-tests.js",
|
|
|
|
},
|
2023-05-04 00:00:31 +03:00
|
|
|
)
|
2023-05-05 16:27:19 +03:00
|
|
|
|
|
|
|
elm_format_diffs(
|
|
|
|
name = "elm_format_diffs",
|
|
|
|
srcs = glob(["src/**/*.elm"]),
|
|
|
|
)
|
2023-05-05 22:51:10 +03:00
|
|
|
|
|
|
|
genrule(
|
2023-05-09 21:28:05 +03:00
|
|
|
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"]),
|
|
|
|
prettier = "//:prettier",
|
|
|
|
)
|