diff --git a/MODULE.bazel b/MODULE.bazel index 0002e11..0845eaa 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,4 +8,4 @@ bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "aspect_rules_js", version = "1.34.1") quickjs_extension = use_extension("//quickjs:extensions.bzl", "quickjs_extension") -use_repo(quickjs_extension, "quickjs") +use_repo(quickjs_extension, "bzlparty_quickjs") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index de6f60a..9b43b6a 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 3, - "moduleFileHash": "667c635c25f309e9b94f9c9adcbcee7c8824c5edc0ae92c5a8138c1a7a08a08f", + "moduleFileHash": "164158aef42b91c8d875138b742919a6d608e1aa65b6f17c46a776bfe05a3fdc", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -34,7 +34,7 @@ "column": 34 }, "imports": { - "quickjs": "quickjs" + "bzlparty_quickjs": "bzlparty_quickjs" }, "devImports": [], "tags": [], @@ -1017,15 +1017,15 @@ "moduleExtensions": { "//quickjs:extensions.bzl%quickjs_extension": { "general": { - "bzlTransitiveDigest": "ZP/sdzMwXaMJ9QaULHHB3ZBO4WY6q8swIQPTA8PFyZo=", + "bzlTransitiveDigest": "UR60HYQutyD5qjaM5A+P8q3LgSJ6DANu5zTxgB1f0hk=", "accumulatedFileDigests": {}, "envVariables": {}, "generatedRepoSpecs": { - "quickjs": { + "bzlparty_quickjs": { "bzlFile": "@@//quickjs:extensions.bzl", "ruleClassName": "quickjs_repo", "attributes": { - "name": "_main~quickjs_extension~quickjs", + "name": "_main~quickjs_extension~bzlparty_quickjs", "version": "0.3.0" } } diff --git a/README.md b/README.md index e69de29..fd5bdbf 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,20 @@ +# Bazel Rules for QuickJS + +See install instructions on the [release page](https://github.com/bzlparty/rules_quickjs/releases). + +In a `BUILD.bazel` file: + +```starlark +load("@bzlparty_rules_quickjs//quickjs:qjs.bzl", "qjs_binary") + +qjs_binary( + name = "index", + entry_point = ":index.js", +) +``` + +Run `qjs` from Bazel: + +```bash +bazel run @bzlparty_quickjs//:qjs +``` diff --git a/e2e/MODULE.bazel.lock b/e2e/MODULE.bazel.lock index e519782..b5a84d2 100644 --- a/e2e/MODULE.bazel.lock +++ b/e2e/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 3, - "moduleFileHash": "faa5b9658f410943998e585ed6cecf3b48a610983a78c3122ba91dae40cfd38f", + "moduleFileHash": "ea85f8fff7c32cb6cdf8a1311fcc04d3bb87eb3f3e953eafa0fc6f3e76081135", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -14,7 +14,7 @@ }, "localOverrideHashes": { "bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787", - "bzlparty_rules_quickjs": "667c635c25f309e9b94f9c9adcbcee7c8824c5edc0ae92c5a8138c1a7a08a08f" + "bzlparty_rules_quickjs": "164158aef42b91c8d875138b742919a6d608e1aa65b6f17c46a776bfe05a3fdc" }, "moduleDepGraph": { "": { @@ -49,7 +49,7 @@ "column": 34 }, "imports": { - "quickjs": "quickjs" + "bzlparty_quickjs": "bzlparty_quickjs" }, "devImports": [], "tags": [], @@ -1032,15 +1032,15 @@ "moduleExtensions": { "@@bzlparty_rules_quickjs~override//quickjs:extensions.bzl%quickjs_extension": { "general": { - "bzlTransitiveDigest": "FvE1FXs1hNHJnuHnc/9WtXu/tTR9+NCR0nJuYmgk+Es=", + "bzlTransitiveDigest": "UR60HYQutyD5qjaM5A+P8q3LgSJ6DANu5zTxgB1f0hk=", "accumulatedFileDigests": {}, "envVariables": {}, "generatedRepoSpecs": { - "quickjs": { + "bzlparty_quickjs": { "bzlFile": "@@bzlparty_rules_quickjs~override//quickjs:extensions.bzl", "ruleClassName": "quickjs_repo", "attributes": { - "name": "bzlparty_rules_quickjs~override~quickjs_extension~quickjs", + "name": "bzlparty_rules_quickjs~override~quickjs_extension~bzlparty_quickjs", "version": "0.3.0" } } diff --git a/quickjs/extensions.bzl b/quickjs/extensions.bzl index e50d6b5..2f5797c 100644 --- a/quickjs/extensions.bzl +++ b/quickjs/extensions.bzl @@ -35,5 +35,5 @@ quickjs_repo = repository_rule( ) quickjs_extension = module_extension( - implementation = lambda _: quickjs_repo(name = "quickjs", version = "0.3.0"), + implementation = lambda _: quickjs_repo(name = "bzlparty_quickjs", version = "0.3.0"), ) diff --git a/quickjs/qjs.bzl b/quickjs/qjs.bzl index e351d89..0a7344b 100644 --- a/quickjs/qjs.bzl +++ b/quickjs/qjs.bzl @@ -34,7 +34,7 @@ qjs_binary = rule( allow_files = True, ), "_binary": attr.label( - default = "@quickjs//:qjs", + default = "@bzlparty_quickjs//:qjs", executable = True, cfg = "exec", allow_single_file = True,