Skip to content

Commit

Permalink
chore: run buildiifer to fixup load ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed May 20, 2024
1 parent 9cb0241 commit af0d918
Show file tree
Hide file tree
Showing 45 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ host_repo(name = "aspect_bazel_lib_host")
############################################
# Gazelle, for generating bzl_library targets

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

Expand Down
2 changes: 1 addition & 1 deletion e2e/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains")
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:less/package_json.bzl", less_bin = "bin")
load("@npm//:jasmine/package_json.bzl", jasmine_bin = "bin")
load("@npm//:less/package_json.bzl", less_bin = "bin")
load("@npm_meaning-of-life__links//:defs.bzl", npm_link_meaning_of_life = "npm_link_imported_package")

not_windows = select({
Expand Down
2 changes: 1 addition & 1 deletion e2e/gyp_no_install_script/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion e2e/js_image_oci/repo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")

package(default_visibility = ["//visibility:public"])

Expand Down
2 changes: 1 addition & 1 deletion e2e/js_run_devserver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion e2e/npm_link_package-esm/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("@foo//:@aspect-test/a/package_json.bzl", aspect_test_a_bin = "bin")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion e2e/npm_link_package-esm/wrapper-lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")

# A named package depending on another named package and a js_library()

Expand Down
2 changes: 1 addition & 1 deletion e2e/npm_link_package/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("@foo//:@aspect-test/a/package_json.bzl", aspect_test_a_bin = "bin")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion e2e/npm_link_package/wrapper-lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")

# A named package depending on another named package and a js_library()

Expand Down
2 changes: 1 addition & 1 deletion e2e/npm_translate_lock_subdir_patch/subdir/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion e2e/pnpm_workspace_deps/lib-dupes/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")
Expand Down
2 changes: 1 addition & 1 deletion e2e/pnpm_workspace_deps/lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")
Expand Down
2 changes: 1 addition & 1 deletion e2e/stamped_package_json/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@aspect_rules_js//npm:defs.bzl", "stamped_package_json")
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
load("@aspect_bazel_lib//lib:testing.bzl", "assert_json_matches")
load("@aspect_rules_js//npm:defs.bzl", "stamped_package_json")

stamped_package_json(
name = "package",
Expand Down
4 changes: 2 additions & 2 deletions e2e/worker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains")
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load(":defs.bzl", "pi_rule")

copy_file(
Expand Down
4 changes: 2 additions & 2 deletions examples/js_binary/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Simple examples of running JS programs in node with js_binary, js_run_binary, an
"""

load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION")
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_run_binary", "js_test")
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@npm//examples/npm_deps:@aspect-test/a/package_json.bzl", aspect_test_a_bin = "bin")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//examples/npm_deps:@aspect-test/a/package_json.bzl", aspect_test_a_bin = "bin")
load(":custom_rule.bzl", "custom_rule")

# Link all direct dependencies in /examples/npm_deps/package.json to
Expand Down
2 changes: 1 addition & 1 deletion examples/js_library/two/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load(":tsc.bzl", "tsc")
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":tsc.bzl", "tsc")

tsc(
name = "two",
Expand Down
2 changes: 1 addition & 1 deletion examples/linked_empty_node_modules/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/macro/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("//examples/macro:mocha.bzl", "mocha_test")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//examples/macro:mocha.bzl", "mocha_test")

# Link all direct dependencies in /examples/macro/package.json to
# bazel-bin/examples/macro/node_modules
Expand Down
8 changes: 4 additions & 4 deletions examples/npm_deps/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_run_binary", "js_test")
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_run_binary", "js_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@npm//:defs.bzl", "npm_link_all_packages")

###########################

# Load from the "bin" property from the package.json of the uvu package
load("@npm//examples/npm_deps:uvu/package_json.bzl", uvu_bin = "bin")

# Directly load from rollup's bin entries, skipping the "bin" helper from package_json.bzl
# Just to show what the syntax de-sugaring looks like, and to test that
# bare `npm_import` produces working binaries.
load("@npm__rollup__2.70.2//examples/npm_deps:package_json.bzl", "rollup", "rollup_binary", "rollup_test")

# Load from the "bin" property from the package.json of the uvu package
load("@npm//examples/npm_deps:uvu/package_json.bzl", uvu_bin = "bin")

###########################

# Link all direct dependencies in /examples/npm_deps/package.json to
Expand Down
2 changes: 1 addition & 1 deletion examples/npm_package/libs/lib_a/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//js:defs.bzl", "js_library")

npm_link_all_packages(name = "node_modules")

Expand Down
2 changes: 1 addition & 1 deletion examples/npm_package/packages/pkg_a/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_package", "stamped_package_json")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package", "stamped_package_json")
load("@npm//:defs.bzl", "npm_link_all_packages")

npm_link_all_packages(name = "node_modules")
Expand Down
16 changes: 8 additions & 8 deletions js/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ load(
_js_binary = "js_binary",
_js_test = "js_test",
)
load(
"//js/private:js_image_layer.bzl",
_js_image_layer = "js_image_layer",
)
load(
"//js/private:js_info_files.bzl",
_js_info_files = "js_info_files",
)
load(
"//js/private:js_library.bzl",
_js_library = "js_library",
Expand All @@ -13,18 +21,10 @@ load(
"//js/private:js_run_binary.bzl",
_js_run_binary = "js_run_binary",
)
load(
"//js/private:js_info_files.bzl",
_js_info_files = "js_info_files",
)
load(
"//js/private:js_run_devserver.bzl",
_js_run_devserver = "js_run_devserver",
)
load(
"//js/private:js_image_layer.bzl",
_js_image_layer = "js_image_layer",
)

# buildifier: disable=function-docstring
def js_binary(**kwargs):
Expand Down
8 changes: 4 additions & 4 deletions js/libs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ load(
"//js/private:js_binary.bzl",
_js_binary_lib = "js_binary_lib",
)
load(
"//js/private:js_library.bzl",
_js_library_lib = "js_library_lib",
)
load(
"//js/private:js_helpers.bzl",
_LOG_LEVELS = "LOG_LEVELS",
Expand All @@ -19,6 +15,10 @@ load(
_gather_transitive_sources = "gather_transitive_sources",
_gather_transitive_types = "gather_transitive_types",
)
load(
"//js/private:js_library.bzl",
_js_library_lib = "js_library_lib",
)

js_binary_lib = _js_binary_lib
js_library_lib = _js_library_lib
Expand Down
2 changes: 1 addition & 1 deletion js/private/coverage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(":merger.bzl", "coverage_merger")
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load(":merger.bzl", "coverage_merger")

exports_files([
"coverage.sh.tpl",
Expand Down
8 changes: 4 additions & 4 deletions js/private/js_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ js_binary(
```
"""

load("@aspect_bazel_lib//lib:windows_utils.bzl", "create_windows_native_launcher_script")
load("@aspect_bazel_lib//lib:expand_make_vars.bzl", "expand_locations", "expand_variables")
load("@aspect_bazel_lib//lib:directory_path.bzl", "DirectoryPathInfo")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "COPY_FILE_TO_BIN_TOOLCHAINS")
load("@aspect_bazel_lib//lib:directory_path.bzl", "DirectoryPathInfo")
load("@aspect_bazel_lib//lib:expand_make_vars.bzl", "expand_locations", "expand_variables")
load("@aspect_bazel_lib//lib:windows_utils.bzl", "create_windows_native_launcher_script")
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load(":js_helpers.bzl", "LOG_LEVELS", "envs_for_log_level", "gather_runfiles")
load(":bash.bzl", "BASH_INITIALIZE_RUNFILES")
load(":js_helpers.bzl", "LOG_LEVELS", "envs_for_log_level", "gather_runfiles")

_DOC = """Execute a program in the Node.js runtime.
Expand Down
4 changes: 2 additions & 2 deletions js/private/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ js_library(
| Python sources and provides a `PyInfo`.
"""

load(":js_info.bzl", "JsInfo", "js_info")
load(":js_helpers.bzl", "copy_js_file_to_bin_action", "gather_npm_package_store_infos", "gather_npm_sources", "gather_runfiles", "gather_transitive_sources", "gather_transitive_types")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "COPY_FILE_TO_BIN_TOOLCHAINS")
load(":js_helpers.bzl", "copy_js_file_to_bin_action", "gather_npm_package_store_infos", "gather_npm_sources", "gather_runfiles", "gather_transitive_sources", "gather_transitive_types")
load(":js_info.bzl", "JsInfo", "js_info")

_DOC = """A library of JavaScript sources. Provides JsInfo, the primary provider used in rules_js
and derivative rule sets.
Expand Down
2 changes: 1 addition & 1 deletion js/private/js_run_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ load("@aspect_rules_js//js:defs.bzl", "js_run_binary")
```
"""

load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_bazel_lib//lib:run_binary.bzl", _run_binary = "run_binary")
load("@aspect_bazel_lib//lib:utils.bzl", bazel_lib_utils = "utils")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load(":js_helpers.bzl", _envs_for_log_level = "envs_for_log_level")
load(":js_info_files.bzl", _js_info_files = "js_info_files")
Expand Down
2 changes: 1 addition & 1 deletion js/private/js_run_devserver.bzl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"Implementation details for js_run_devserver rule"

load("@bazel_skylib//lib:dicts.bzl", "dicts")
load(":js_binary.bzl", "js_binary_lib")
load(":js_helpers.bzl", _gather_files_from_js_info = "gather_files_from_js_info")
load("@bazel_skylib//lib:dicts.bzl", "dicts")

_attrs = dicts.add(js_binary_lib.attrs, {
"tool_exec_cfg": attr.label(
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
load("@aspect_bazel_lib_host//:defs.bzl", "host")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("//js:defs.bzl", "js_binary", "js_library", "js_test")
load(":js_library_test.bzl", "js_library_test_suite")

Expand Down
2 changes: 1 addition & 1 deletion js/private/test/coverage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(":test.bzl", "coverage_fail_test", "coverage_pass_test")
load("//js/private/coverage:merger.bzl", "coverage_merger")
load(":test.bzl", "coverage_fail_test", "coverage_pass_test")

FAIL_CMD = """\
echo "require('fs').writeFileSync(process.env.COVERAGE_OUTPUT_FILE, '# no coverage');" >> $@
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/fixed_args/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//js:defs.bzl", "js_binary", "js_run_binary")
load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains")
load("//js:defs.bzl", "js_binary", "js_run_binary")

js_binary(
name = "fixed_args_bin",
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/js_binary_sh/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@aspect_bazel_lib//lib:testing.bzl", "assert_contains")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("//js:defs.bzl", "js_binary", "js_run_binary")

Expand Down
2 changes: 1 addition & 1 deletion js/private/test/js_library_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("//js/private:js_library.bzl", "js_library")
load("//js/private:js_info.bzl", "JsInfo")
load("//js/private:js_library.bzl", "js_library")

# Files + targets generated for use in tests
def _js_library_test_suite_data():
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/node-patches/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("//js:defs.bzl", "js_test")
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("//js:defs.bzl", "js_test")

TESTS = [
"escape.js",
Expand Down
8 changes: 4 additions & 4 deletions npm/defs.bzl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Rules for fetching and linking npm dependencies and packaging and linking first-party deps
"""

load(
"//npm/private:npm_link_package.bzl",
_npm_link_package = "npm_link_package",
)
load(
"//npm/private:npm_package.bzl",
_npm_package = "npm_package",
_stamped_package_json = "stamped_package_json",
)
load(
"//npm/private:npm_link_package.bzl",
_npm_link_package = "npm_link_package",
)

npm_package = _npm_package
npm_link_package = _npm_link_package
Expand Down
4 changes: 2 additions & 2 deletions npm/private/npm_link_package.bzl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"npm_link_package rule"

load(":utils.bzl", "utils")
load(":npm_package_store.bzl", "npm_package_store")
load(":npm_link_package_store.bzl", "npm_link_package_store")
load(":npm_package_store.bzl", "npm_package_store")
load(":utils.bzl", "utils")

def npm_link_package(
name,
Expand Down
4 changes: 2 additions & 2 deletions npm/private/npm_link_package_store.bzl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"npm_link_package_store rule"

load("@bazel_skylib//lib:paths.bzl", "paths")
load(":utils.bzl", "utils")
load(":npm_package_store_info.bzl", "NpmPackageStoreInfo")
load("//js:providers.bzl", "JsInfo", "js_info")
load(":npm_package_store_info.bzl", "NpmPackageStoreInfo")
load(":utils.bzl", "utils")

_DOC = """Links an npm package that is backed by an npm_package_store into a node_modules tree as a direct dependency.
Expand Down
Loading

0 comments on commit af0d918

Please sign in to comment.