diff --git a/WORKSPACE b/WORKSPACE index 244f696ee..b8f99b563 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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() diff --git a/e2e/bzlmod/BUILD.bazel b/e2e/bzlmod/BUILD.bazel index a7297e6ff..c51bd7820 100644 --- a/e2e/bzlmod/BUILD.bazel +++ b/e2e/bzlmod/BUILD.bazel @@ -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({ diff --git a/e2e/gyp_no_install_script/BUILD.bazel b/e2e/gyp_no_install_script/BUILD.bazel index 5c38d5787..50160f477 100644 --- a/e2e/gyp_no_install_script/BUILD.bazel +++ b/e2e/gyp_no_install_script/BUILD.bazel @@ -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") diff --git a/e2e/js_image_oci/repo/BUILD.bazel b/e2e/js_image_oci/repo/BUILD.bazel index 31fc8041f..1c2195378 100644 --- a/e2e/js_image_oci/repo/BUILD.bazel +++ b/e2e/js_image_oci/repo/BUILD.bazel @@ -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"]) diff --git a/e2e/js_run_devserver/BUILD.bazel b/e2e/js_run_devserver/BUILD.bazel index be3b3d4d5..656d0993a 100644 --- a/e2e/js_run_devserver/BUILD.bazel +++ b/e2e/js_run_devserver/BUILD.bazel @@ -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") diff --git a/e2e/npm_link_package-esm/BUILD.bazel b/e2e/npm_link_package-esm/BUILD.bazel index ce236f5d8..70716e867 100644 --- a/e2e/npm_link_package-esm/BUILD.bazel +++ b/e2e/npm_link_package-esm/BUILD.bazel @@ -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") diff --git a/e2e/npm_link_package-esm/wrapper-lib/BUILD.bazel b/e2e/npm_link_package-esm/wrapper-lib/BUILD.bazel index 7d3b240fd..e34390eb8 100644 --- a/e2e/npm_link_package-esm/wrapper-lib/BUILD.bazel +++ b/e2e/npm_link_package-esm/wrapper-lib/BUILD.bazel @@ -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() diff --git a/e2e/npm_link_package/BUILD.bazel b/e2e/npm_link_package/BUILD.bazel index cc17b9bb6..817a958d6 100644 --- a/e2e/npm_link_package/BUILD.bazel +++ b/e2e/npm_link_package/BUILD.bazel @@ -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") diff --git a/e2e/npm_link_package/wrapper-lib/BUILD.bazel b/e2e/npm_link_package/wrapper-lib/BUILD.bazel index 00a64758b..ba37749ad 100644 --- a/e2e/npm_link_package/wrapper-lib/BUILD.bazel +++ b/e2e/npm_link_package/wrapper-lib/BUILD.bazel @@ -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() diff --git a/e2e/npm_translate_lock_subdir_patch/subdir/BUILD.bazel b/e2e/npm_translate_lock_subdir_patch/subdir/BUILD.bazel index b4a9958e2..1f88a7369 100644 --- a/e2e/npm_translate_lock_subdir_patch/subdir/BUILD.bazel +++ b/e2e/npm_translate_lock_subdir_patch/subdir/BUILD.bazel @@ -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") diff --git a/e2e/pnpm_workspace_deps/lib-dupes/BUILD.bazel b/e2e/pnpm_workspace_deps/lib-dupes/BUILD.bazel index 882665afd..03b49bb86 100644 --- a/e2e/pnpm_workspace_deps/lib-dupes/BUILD.bazel +++ b/e2e/pnpm_workspace_deps/lib-dupes/BUILD.bazel @@ -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") diff --git a/e2e/pnpm_workspace_deps/lib/BUILD.bazel b/e2e/pnpm_workspace_deps/lib/BUILD.bazel index 65792a99a..0b7497fe8 100644 --- a/e2e/pnpm_workspace_deps/lib/BUILD.bazel +++ b/e2e/pnpm_workspace_deps/lib/BUILD.bazel @@ -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") diff --git a/e2e/stamped_package_json/BUILD.bazel b/e2e/stamped_package_json/BUILD.bazel index 5bc74c986..5c4b72d87 100644 --- a/e2e/stamped_package_json/BUILD.bazel +++ b/e2e/stamped_package_json/BUILD.bazel @@ -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", diff --git a/e2e/worker/BUILD.bazel b/e2e/worker/BUILD.bazel index 0d0f28c7c..53f737f1d 100644 --- a/e2e/worker/BUILD.bazel +++ b/e2e/worker/BUILD.bazel @@ -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( diff --git a/examples/js_binary/BUILD.bazel b/examples/js_binary/BUILD.bazel index 40384de19..9501f365b 100644 --- a/examples/js_binary/BUILD.bazel +++ b/examples/js_binary/BUILD.bazel @@ -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 diff --git a/examples/js_library/two/BUILD.bazel b/examples/js_library/two/BUILD.bazel index fc14d26d0..5a4c0791c 100644 --- a/examples/js_library/two/BUILD.bazel +++ b/examples/js_library/two/BUILD.bazel @@ -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", diff --git a/examples/linked_empty_node_modules/BUILD.bazel b/examples/linked_empty_node_modules/BUILD.bazel index e5a9b76a2..b2faacb86 100644 --- a/examples/linked_empty_node_modules/BUILD.bazel +++ b/examples/linked_empty_node_modules/BUILD.bazel @@ -1,7 +1,7 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@npm//:defs.bzl", "npm_link_all_packages") load("//js:defs.bzl", "js_library") load("//npm:defs.bzl", "npm_package") -load("@npm//:defs.bzl", "npm_link_all_packages") # Approx repro of https://github.com/aspect-build/rules_js/issues/918 diff --git a/examples/macro/BUILD.bazel b/examples/macro/BUILD.bazel index 8bae5c3a8..ff934f595 100644 --- a/examples/macro/BUILD.bazel +++ b/examples/macro/BUILD.bazel @@ -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 diff --git a/examples/npm_deps/BUILD.bazel b/examples/npm_deps/BUILD.bazel index 1a987fd35..296e222cf 100644 --- a/examples/npm_deps/BUILD.bazel +++ b/examples/npm_deps/BUILD.bazel @@ -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 diff --git a/examples/npm_package/libs/lib_a/BUILD.bazel b/examples/npm_package/libs/lib_a/BUILD.bazel index 766e4ead0..0a80da8e3 100644 --- a/examples/npm_package/libs/lib_a/BUILD.bazel +++ b/examples/npm_package/libs/lib_a/BUILD.bazel @@ -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") diff --git a/examples/npm_package/packages/pkg_a/BUILD.bazel b/examples/npm_package/packages/pkg_a/BUILD.bazel index 5ca830683..9067c84f3 100644 --- a/examples/npm_package/packages/pkg_a/BUILD.bazel +++ b/examples/npm_package/packages/pkg_a/BUILD.bazel @@ -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") diff --git a/js/defs.bzl b/js/defs.bzl index 60e2399de..e4ae0596a 100644 --- a/js/defs.bzl +++ b/js/defs.bzl @@ -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", @@ -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): diff --git a/js/libs.bzl b/js/libs.bzl index c14d1a15f..058fe5ad0 100644 --- a/js/libs.bzl +++ b/js/libs.bzl @@ -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", @@ -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 diff --git a/js/private/coverage/BUILD.bazel b/js/private/coverage/BUILD.bazel index 419a14b4e..8227af37d 100644 --- a/js/private/coverage/BUILD.bazel +++ b/js/private/coverage/BUILD.bazel @@ -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", diff --git a/js/private/js_binary.bzl b/js/private/js_binary.bzl index 0be44ed3a..3ab2ea4f8 100644 --- a/js/private/js_binary.bzl +++ b/js/private/js_binary.bzl @@ -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. diff --git a/js/private/js_library.bzl b/js/private/js_library.bzl index 3c6af88dc..b4d96ae0c 100644 --- a/js/private/js_library.bzl +++ b/js/private/js_library.bzl @@ -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. diff --git a/js/private/js_run_binary.bzl b/js/private/js_run_binary.bzl index 9f933e2be..44081bc3b 100644 --- a/js/private/js_run_binary.bzl +++ b/js/private/js_run_binary.bzl @@ -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") diff --git a/js/private/js_run_devserver.bzl b/js/private/js_run_devserver.bzl index cc4f3ae6a..181732977 100644 --- a/js/private/js_run_devserver.bzl +++ b/js/private/js_run_devserver.bzl @@ -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( diff --git a/js/private/test/BUILD.bazel b/js/private/test/BUILD.bazel index b425c212a..4892af7c2 100644 --- a/js/private/test/BUILD.bazel +++ b/js/private/test/BUILD.bazel @@ -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") diff --git a/js/private/test/coverage/BUILD.bazel b/js/private/test/coverage/BUILD.bazel index 8325e0bbf..038dfb7e1 100644 --- a/js/private/test/coverage/BUILD.bazel +++ b/js/private/test/coverage/BUILD.bazel @@ -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');" >> $@ diff --git a/js/private/test/fixed_args/BUILD.bazel b/js/private/test/fixed_args/BUILD.bazel index 1a009b320..dc7f318d2 100644 --- a/js/private/test/fixed_args/BUILD.bazel +++ b/js/private/test/fixed_args/BUILD.bazel @@ -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", diff --git a/js/private/test/js_binary_sh/BUILD.bazel b/js/private/test/js_binary_sh/BUILD.bazel index dd414fe01..7b8a77102 100644 --- a/js/private/test/js_binary_sh/BUILD.bazel +++ b/js/private/test/js_binary_sh/BUILD.bazel @@ -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") diff --git a/js/private/test/js_library_test.bzl b/js/private/test/js_library_test.bzl index c32087bb3..9356cab8e 100644 --- a/js/private/test/js_library_test.bzl +++ b/js/private/test/js_library_test.bzl @@ -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(): diff --git a/js/private/test/node-patches/BUILD.bazel b/js/private/test/node-patches/BUILD.bazel index 16c9b58cd..d50b4243b 100644 --- a/js/private/test/node-patches/BUILD.bazel +++ b/js/private/test/node-patches/BUILD.bazel @@ -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", diff --git a/npm/defs.bzl b/npm/defs.bzl index 96ac5b307..56a85ebbb 100644 --- a/npm/defs.bzl +++ b/npm/defs.bzl @@ -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 diff --git a/npm/private/npm_link_package.bzl b/npm/private/npm_link_package.bzl index 94edd4f72..743aeab97 100644 --- a/npm/private/npm_link_package.bzl +++ b/npm/private/npm_link_package.bzl @@ -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, diff --git a/npm/private/npm_link_package_store.bzl b/npm/private/npm_link_package_store.bzl index 7fdfc14fa..f523bca70 100644 --- a/npm/private/npm_link_package_store.bzl +++ b/npm/private/npm_link_package_store.bzl @@ -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. diff --git a/npm/private/npm_package_store.bzl b/npm/private/npm_package_store.bzl index c20731560..974965a21 100644 --- a/npm/private/npm_package_store.bzl +++ b/npm/private/npm_package_store.bzl @@ -2,12 +2,12 @@ load("@aspect_bazel_lib//lib:copy_directory.bzl", "copy_directory_bin_action") load("@bazel_skylib//lib:paths.bzl", "paths") -load(":utils.bzl", "utils") -load(":npm_package_info.bzl", "NpmPackageInfo") -load(":npm_package_store_info.bzl", "NpmPackageStoreInfo") # buildifier: disable=bzl-visibility load("//js/private:js_info.bzl", "JsInfo") +load(":npm_package_info.bzl", "NpmPackageInfo") +load(":npm_package_store_info.bzl", "NpmPackageStoreInfo") +load(":utils.bzl", "utils") _DOC = """Defines a npm package that is linked into a node_modules tree. diff --git a/npm/private/npm_translate_lock.bzl b/npm/private/npm_translate_lock.bzl index e59d05826..8046ace8b 100644 --- a/npm/private/npm_translate_lock.bzl +++ b/npm/private/npm_translate_lock.bzl @@ -25,16 +25,16 @@ Advanced users may want to directly fetch a package from npm rather than start f [`npm_import`](./npm_import) does this. """ -load("@bazel_skylib//lib:paths.bzl", "paths") load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") +load("@bazel_skylib//lib:paths.bzl", "paths") load(":list_sources.bzl", "list_sources") load(":npm_translate_lock_generate.bzl", "generate_repository_files") load(":npm_translate_lock_helpers.bzl", "helpers") load(":npm_translate_lock_macro_helpers.bzl", macro_helpers = "helpers") load(":npm_translate_lock_state.bzl", "DEFAULT_ROOT_PACKAGE", "npm_translate_lock_state") load(":pnpm_repository.bzl", "LATEST_PNPM_VERSION", _pnpm_repository = "pnpm_repository") -load(":utils.bzl", "utils") load(":transitive_closure.bzl", "translate_to_transitive_closure") +load(":utils.bzl", "utils") RULES_JS_FROZEN_PNPM_LOCK_ENV = "ASPECT_RULES_JS_FROZEN_PNPM_LOCK" diff --git a/npm/private/npm_translate_lock_generate.bzl b/npm/private/npm_translate_lock_generate.bzl index c84795c4f..95dc622cf 100644 --- a/npm/private/npm_translate_lock_generate.bzl +++ b/npm/private/npm_translate_lock_generate.bzl @@ -2,9 +2,9 @@ """ load("@bazel_skylib//lib:paths.bzl", "paths") -load(":utils.bzl", "utils") load(":npm_translate_lock_helpers.bzl", "helpers") load(":starlark_codegen_utils.bzl", "starlark_codegen_utils") +load(":utils.bzl", "utils") ################################################################################ _NPM_IMPORT_TMPL = \ diff --git a/npm/private/npm_translate_lock_state.bzl b/npm/private/npm_translate_lock_state.bzl index 62d540f8a..f10b7c9df 100644 --- a/npm/private/npm_translate_lock_state.bzl +++ b/npm/private/npm_translate_lock_state.bzl @@ -1,14 +1,14 @@ """npm_translate_lock state management abstraction so main impl is easier to read and maintain""" -load("@bazel_skylib//lib:paths.bzl", "paths") -load("@bazel_skylib//lib:dicts.bzl", "dicts") load("@aspect_bazel_lib//lib:base64.bzl", "base64") load("@aspect_bazel_lib//lib:repo_utils.bzl", "repo_utils") -load(":repository_label_store.bzl", "repository_label_store") +load("@bazel_skylib//lib:dicts.bzl", "dicts") +load("@bazel_skylib//lib:paths.bzl", "paths") load(":npm_translate_lock_helpers.bzl", "helpers") -load(":utils.bzl", "INTERNAL_ERROR_MSG", "utils") load(":npmrc.bzl", "parse_npmrc") +load(":repository_label_store.bzl", "repository_label_store") +load(":utils.bzl", "INTERNAL_ERROR_MSG", "utils") NPM_RC_FILENAME = ".npmrc" PACKAGE_JSON_FILENAME = "package.json" diff --git a/npm/private/test/BUILD.bazel b/npm/private/test/BUILD.bazel index 3323c189b..c5fb073c1 100644 --- a/npm/private/test/BUILD.bazel +++ b/npm/private/test/BUILD.bazel @@ -1,15 +1,15 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@npm//:defs.bzl", "npm_link_all_packages") +load(":generated_pkg_json_test.bzl", "generated_pkg_json_test") +load(":npm_auth_test.bzl", "npm_auth_test_suite") +load(":npmrc_test.bzl", "npmrc_tests") +load(":parse_pnpm_lock_tests.bzl", "parse_pnpm_lock_tests") +load(":pkg_glob_tests.bzl", "pkg_glob_tests") load(":transitive_closure_tests.bzl", "transitive_closure_tests") load(":translate_lock_helpers_tests.bzl", "translate_lock_helpers_tests") -load(":parse_pnpm_lock_tests.bzl", "parse_pnpm_lock_tests") -load(":yaml_tests.bzl", "yaml_tests") load(":utils_tests.bzl", "utils_tests") -load(":npmrc_test.bzl", "npmrc_tests") -load(":pkg_glob_tests.bzl", "pkg_glob_tests") -load(":generated_pkg_json_test.bzl", "generated_pkg_json_test") -load(":npm_auth_test.bzl", "npm_auth_test_suite") +load(":yaml_tests.bzl", "yaml_tests") # gazelle:exclude **/snapshots/**/* diff --git a/npm/private/test/generated_pkg_json_test.bzl b/npm/private/test/generated_pkg_json_test.bzl index 231c38fc1..cd795a752 100644 --- a/npm/private/test/generated_pkg_json_test.bzl +++ b/npm/private/test/generated_pkg_json_test.bzl @@ -2,9 +2,9 @@ See https://docs.bazel.build/versions/main/skylark/testing.html#for-testing-starlark-utilities """ -load(":snapshots/wksp/package_json.bzl", rollup_bin = "bin") -load("@bazel_skylib//lib:unittest.bzl", "loadingtest") load("@bazel_skylib//lib:new_sets.bzl", "sets") +load("@bazel_skylib//lib:unittest.bzl", "loadingtest") +load(":snapshots/wksp/package_json.bzl", rollup_bin = "bin") _TEST_TARGET_PREFIX = "__rollup" diff --git a/npm/private/test/npm_package/BUILD.bazel b/npm/private/test/npm_package/BUILD.bazel index 2be2b11f4..97a8305d6 100644 --- a/npm/private/test/npm_package/BUILD.bazel +++ b/npm/private/test/npm_package/BUILD.bazel @@ -1,8 +1,8 @@ -load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test") load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") +load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test") load("@npm//:defs.bzl", "npm_link_all_packages") -load("//npm:defs.bzl", "npm_package") load("//js:defs.bzl", "js_library") +load("//npm:defs.bzl", "npm_package") npm_link_all_packages(name = "node_modules") diff --git a/npm/private/utils.bzl b/npm/private/utils.bzl index 68a7a198c..913a8c69d 100644 --- a/npm/private/utils.bzl +++ b/npm/private/utils.bzl @@ -1,8 +1,8 @@ "Utility functions for npm rules" -load("@aspect_bazel_lib//lib:utils.bzl", bazel_lib_utils = "utils") load("@aspect_bazel_lib//lib:paths.bzl", "relative_file") load("@aspect_bazel_lib//lib:repo_utils.bzl", "repo_utils") +load("@aspect_bazel_lib//lib:utils.bzl", bazel_lib_utils = "utils") load("@bazel_skylib//lib:paths.bzl", "paths") load("@bazel_skylib//lib:types.bzl", "types") load(":yaml.bzl", _parse_yaml = "parse")