diff --git a/.aspect/bazelrc/ci.bazelrc b/.aspect/bazelrc/ci.bazelrc index 4d91ee0..11aae33 100644 --- a/.aspect/bazelrc/ci.bazelrc +++ b/.aspect/bazelrc/ci.bazelrc @@ -1,10 +1,3 @@ -# We recommend enforcing a policy that keeps your CI from being slowed down -# by individual test targets that should be optimized -# or split up into multiple test targets with sharding or manually. -# Set this flag to exclude targets that have their timeout set to eternal (>15m) from running on CI. -# Docs: https://bazel.build/docs/user-manual#test-timeout-filters -test --test_timeout_filters=-eternal - # Set this flag to enable re-tries of failed tests on CI. # When any test target fails, try one or more times. This applies regardless of whether the "flaky" # tag appears on the target definition. diff --git a/.aspect/bazelrc/javascript.bazelrc b/.aspect/bazelrc/javascript.bazelrc index 474ec63..ace9d60 100644 --- a/.aspect/bazelrc/javascript.bazelrc +++ b/.aspect/bazelrc/javascript.bazelrc @@ -8,3 +8,4 @@ # details. # Docs: https://nodejs.org/en/docs/guides/debugging-getting-started/#command-line-options run:debug -- --node_options=--inspect-brk +test:debug --test_env=NODE_OPTIONS=--inspect-brk diff --git a/.bazelversion b/.bazelversion index 2b1ea10..21c8c7b 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1,7 +1 @@ 7.1.1 -# The first line of this file is used by Bazelisk and Bazel to be sure -# the right version of Bazel is used to build and test this repo. -# This also defines which version is used on CI. -# -# Note that you should also run integration_tests against other Bazel -# versions you support. diff --git a/.prettierignore b/.prettierignore index 2e117bf..54c5c51 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ docs/*.md +**/pnpm-lock.yaml diff --git a/MODULE.bazel b/MODULE.bazel index e7c6ac0..196da6e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,11 +7,11 @@ module( ) # Lower-bounds (minimum) versions for direct runtime dependencies -bazel_dep(name = "aspect_bazel_lib", version = "1.40.0") -bazel_dep(name = "aspect_rules_js", version = "1.35.0") +bazel_dep(name = "aspect_bazel_lib", version = "2.7.3") +bazel_dep(name = "aspect_rules_js", version = "2.0.0-alpha.4") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_nodejs", version = "5.8.3") +bazel_dep(name = "rules_nodejs", version = "6.1.0") esbuild = use_extension("@aspect_rules_esbuild//esbuild:extensions.bzl", "esbuild") esbuild.toolchain( diff --git a/WORKSPACE b/WORKSPACE index 1bcac9e..d1ee64f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -10,19 +10,9 @@ load("//esbuild:dependencies.bzl", "rules_esbuild_dependencies") # Fetch dependencies which users need as well rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() - -load("@aspect_bazel_lib//lib:repositories.bzl", "DEFAULT_YQ_VERSION", "aspect_bazel_lib_dependencies", "register_coreutils_toolchains", "register_yq_toolchains") - -aspect_bazel_lib_dependencies() - -register_coreutils_toolchains() - -register_yq_toolchains( - version = DEFAULT_YQ_VERSION, -) +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") @@ -44,7 +34,7 @@ esbuild_register_toolchains( ) # Install additional packages to test esbuild plugins -load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock") +load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") npm_translate_lock( name = "esbuild_plugins", diff --git a/docs/esbuild.md b/docs/esbuild.md index 50c5508..aed67bb 100644 --- a/docs/esbuild.md +++ b/docs/esbuild.md @@ -27,7 +27,7 @@ Note: to prevent esbuild from following symlinks and leaving the bazel sandbox, | name | A unique name for this target. | Name | required | | | deps | A list of direct dependencies that are required to build the bundle | List of labels | optional | `[]` | | srcs | Source files to be made available to esbuild | List of labels | optional | `[]` | -| data | Runtime dependencies to include in binaries/tests that depend on this target.

The transitive npm dependencies, transitive sources, default outputs and runfiles of targets in the `data` attribute are added to the runfiles of this target. They should appear in the '*.runfiles' area of any executable which has a runtime dependency on this target.

If this list contains linked npm packages, npm package store targets or other targets that provide `JsInfo`, `NpmPackageStoreInfo` providers are gathered from `JsInfo`. This is done directly from the `npm_package_store_deps` field of these. For linked npm package targets, the underlying `npm_package_store` target(s) that back the links is used. Gathered `NpmPackageStoreInfo` providers are propagated to the direct dependencies of downstream linked `npm_package` targets.

NB: Linked npm package targets that are "dev" dependencies do not forward their underlying `npm_package_store` target(s) through `npm_package_store_deps` and will therefore not be propagated to the direct dependencies of downstream linked `npm_package` targets. npm packages that come in from `npm_translate_lock` are considered "dev" dependencies if they are have `dev: true` set in the pnpm lock file. This should be all packages that are only listed as "devDependencies" in all `package.json` files within the pnpm workspace. This behavior is intentional to mimic how `devDependencies` work in published npm packages. | List of labels | optional | `[]` | +| data | Runtime dependencies to include in binaries/tests that depend on this target.

Follows the same semantics as `js_library` `data` attribute. See https://docs.aspect.build/rulesets/aspect_rules_js/docs/js_library#data for more info. | List of labels | optional | `[]` | | args_file | Internal use only | Label | optional | `None` | | bazel_sandbox_plugin | If true, a custom bazel-sandbox plugin will be enabled that prevents esbuild from leaving the Bazel sandbox. See https://github.com/aspect-build/rules_esbuild/pull/160 for more info. | Boolean | optional | `True` | | bundle | If true, esbuild will bundle the input files, inlining their dependencies recursively | Boolean | optional | `True` | diff --git a/e2e/bundle/.bazelversion b/e2e/bundle/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/bundle/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/bundle/MODULE.bazel b/e2e/bundle/MODULE.bazel index e989ada..3ae452f 100644 --- a/e2e/bundle/MODULE.bazel +++ b/e2e/bundle/MODULE.bazel @@ -4,4 +4,4 @@ local_path_override( path = "../..", ) -bazel_dep(name = "aspect_bazel_lib", version = "2.2.0", dev_dependency = True) +bazel_dep(name = "aspect_bazel_lib", version = "2.7.3", dev_dependency = True) diff --git a/e2e/bundle/WORKSPACE b/e2e/bundle/WORKSPACE index cb2984b..ee2a858 100644 --- a/e2e/bundle/WORKSPACE +++ b/e2e/bundle/WORKSPACE @@ -17,21 +17,9 @@ load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependenc rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -# If you didn't already register a toolchain providing nodejs, do that: -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "node", - node_version = DEFAULT_NODE_VERSION, -) +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) # Register a toolchain containing esbuild npm package and native bindings load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") diff --git a/e2e/npm-links/.bazelversion b/e2e/npm-links/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/npm-links/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/npm-links/MODULE.bazel b/e2e/npm-links/MODULE.bazel index c93ee12..7259c17 100644 --- a/e2e/npm-links/MODULE.bazel +++ b/e2e/npm-links/MODULE.bazel @@ -4,7 +4,7 @@ local_path_override( path = "../..", ) -bazel_dep(name = "aspect_rules_js", version = "1.34.1", dev_dependency = True) +bazel_dep(name = "aspect_rules_js", version = "2.0.0-alpha.4", dev_dependency = True) bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True) npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) diff --git a/e2e/npm-links/WORKSPACE b/e2e/npm-links/WORKSPACE index 1da8816..3c6b8b2 100644 --- a/e2e/npm-links/WORKSPACE +++ b/e2e/npm-links/WORKSPACE @@ -9,22 +9,11 @@ load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependenc rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "node", - node_version = DEFAULT_NODE_VERSION, -) - -load("@aspect_rules_js//npm:npm_import.bzl", "npm_translate_lock") +load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") npm_translate_lock( name = "npm", diff --git a/e2e/npm-links/pnpm-lock.yaml b/e2e/npm-links/pnpm-lock.yaml index 8beacf6..1b62d69 100644 --- a/e2e/npm-links/pnpm-lock.yaml +++ b/e2e/npm-links/pnpm-lock.yaml @@ -1,13 +1,16 @@ -lockfileVersion: 5.4 +lockfileVersion: '6.0' -specifiers: - numeral: ^2.0.6 +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: - numeral: 2.0.6 + numeral: + specifier: ^2.0.6 + version: 2.0.6 packages: - /numeral/2.0.6: + /numeral@2.0.6: resolution: {integrity: sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==} dev: false diff --git a/e2e/smoke/.bazelversion b/e2e/smoke/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/smoke/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/smoke/WORKSPACE.bazel b/e2e/smoke/WORKSPACE.bazel index 66d4967..91f71db 100644 --- a/e2e/smoke/WORKSPACE.bazel +++ b/e2e/smoke/WORKSPACE.bazel @@ -19,21 +19,9 @@ load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependenc rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -# If you didn't already register a toolchain providing nodejs, do that: -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "node", - node_version = DEFAULT_NODE_VERSION, -) +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) # Register a toolchain containing esbuild npm package and native bindings load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") diff --git a/e2e/sourcemaps/.bazelversion b/e2e/sourcemaps/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/sourcemaps/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/sourcemaps/WORKSPACE b/e2e/sourcemaps/WORKSPACE index c4074bf..91f71db 100644 --- a/e2e/sourcemaps/WORKSPACE +++ b/e2e/sourcemaps/WORKSPACE @@ -19,23 +19,9 @@ load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependenc rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() - -# For convenience, npm_translate_lock does this call automatically. -# You can omit this if you have any npm_translate_lock calls. -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -# If you didn't already register a toolchain providing nodejs, do that: -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "node", - node_version = DEFAULT_NODE_VERSION, -) +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) # Register a toolchain containing esbuild npm package and native bindings load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") diff --git a/e2e/tsconfig/.bazelversion b/e2e/tsconfig/.bazelversion new file mode 120000 index 0000000..96cf949 --- /dev/null +++ b/e2e/tsconfig/.bazelversion @@ -0,0 +1 @@ +../../.bazelversion \ No newline at end of file diff --git a/e2e/tsconfig/MODULE.bazel b/e2e/tsconfig/MODULE.bazel index e989ada..3ae452f 100644 --- a/e2e/tsconfig/MODULE.bazel +++ b/e2e/tsconfig/MODULE.bazel @@ -4,4 +4,4 @@ local_path_override( path = "../..", ) -bazel_dep(name = "aspect_bazel_lib", version = "2.2.0", dev_dependency = True) +bazel_dep(name = "aspect_bazel_lib", version = "2.7.3", dev_dependency = True) diff --git a/e2e/tsconfig/WORKSPACE b/e2e/tsconfig/WORKSPACE index f3f0d48..f1e2e90 100644 --- a/e2e/tsconfig/WORKSPACE +++ b/e2e/tsconfig/WORKSPACE @@ -7,20 +7,9 @@ load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependenc rules_esbuild_dependencies() -load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") +load("@aspect_rules_js//js:toolchains.bzl", "DEFAULT_NODE_VERSION", "rules_js_register_toolchains") -rules_js_dependencies() - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() - -load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains") - -nodejs_register_toolchains( - name = "node", - node_version = DEFAULT_NODE_VERSION, -) +rules_js_register_toolchains(node_version = DEFAULT_NODE_VERSION) load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains") diff --git a/esbuild/dependencies.bzl b/esbuild/dependencies.bzl index d7441f0..9f70f23 100644 --- a/esbuild/dependencies.bzl +++ b/esbuild/dependencies.bzl @@ -14,20 +14,21 @@ def rules_esbuild_dependencies(): http_archive( name = "aspect_bazel_lib", - sha256 = "f6ef68871d206cf8f5f4eea83d26a366563a631b020afe1da2f838a9bff035c0", - strip_prefix = "bazel-lib-1.40.0", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.40.0/bazel-lib-v1.40.0.tar.gz", + sha256 = "87ab4ec479ebeb00d286266aca2068caeef1bb0b1765e8f71c7b6cfee6af4226", + strip_prefix = "bazel-lib-2.7.3", + url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.7.3/bazel-lib-v2.7.3.tar.gz", ) http_archive( name = "aspect_rules_js", - sha256 = "76a04ef2120ee00231d85d1ff012ede23963733339ad8db81f590791a031f643", - strip_prefix = "rules_js-1.34.1", - url = "https://github.com/aspect-build/rules_js/releases/download/v1.34.1/rules_js-v1.34.1.tar.gz", + sha256 = "b2669ce908107570e5f552dbf9f133fd6c81e7a90c6083d8a1e03620657980d1", + strip_prefix = "rules_js-2.0.0-alpha.4", + url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0-alpha.4/rules_js-v2.0.0-alpha.4.tar.gz", ) http_archive( name = "rules_nodejs", - sha256 = "8fc8e300cb67b89ceebd5b8ba6896ff273c84f6099fc88d23f24e7102319d8fd", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.4/rules_nodejs-core-5.8.4.tar.gz"], + sha256 = "dddd60acc3f2f30359bef502c9d788f67e33814b0ddd99aa27c5a15eb7a41b8c", + strip_prefix = "rules_nodejs-6.1.0", + url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.1.0/rules_nodejs-v6.1.0.tar.gz", ) diff --git a/esbuild/private/esbuild.bzl b/esbuild/private/esbuild.bzl index 10d6616..88c2c70 100644 --- a/esbuild/private/esbuild.bzl +++ b/esbuild/private/esbuild.bzl @@ -33,7 +33,14 @@ See https://esbuild.github.io/api/#define for more details doc = "A list of direct dependencies that are required to build the bundle", providers = [JsInfo], ), - "data": js_lib_helpers.JS_LIBRARY_DATA_ATTR, + "data": attr.label_list( + doc = """Runtime dependencies to include in binaries/tests that depend on this target. + +Follows the same semantics as `js_library` `data` attribute. See +https://docs.aspect.build/rulesets/aspect_rules_js/docs/js_library#data for more info. +""", + allow_files = True, + ), "entry_point": attr.label( allow_single_file = True, doc = """The bundle's entry point (e.g. your main.js or app.js or index.js) @@ -365,11 +372,13 @@ def _esbuild_impl(ctx): for file in ctx.files.srcs if not (file.path.endswith(".d.ts") or file.path.endswith(".tsbuildinfo")) ]) + entry_points_bin_copy + [tsconfig_bin_copy] + other_inputs + node_toolinfo.tool_files + esbuild_toolinfo.tool_files, - transitive = [js_lib_helpers.gather_files_from_js_providers( + transitive = [js_lib_helpers.gather_files_from_js_infos( targets = ctx.attr.srcs + ctx.attr.deps, + include_sources = True, + include_types = False, include_transitive_sources = True, - include_declarations = False, - include_npm_linked_packages = True, + include_transitive_types = False, + include_npm_sources = True, )], ) @@ -388,31 +397,26 @@ def _esbuild_impl(ctx): output_sources_depset = depset(output_sources) if ctx.attr.bundle: - # If we're bundling we don't propogate any transitive sources or declarations since sources - # are typically bundled into the output. If a subset of linked npm dependencies are not - # bundled it is up the the user to re-specify these in `data` if they are runtime - # dependencies to progagate to binary rules or `srcs` if they are to be propagated to - # downstream build targets. + # When bundling don't propogate any transitive sources or declarations since sources + # are typically bundled into the output. transitive_sources = output_sources_depset - transitive_declarations = depset() - npm_linked_packages = js_lib_helpers.gather_npm_linked_packages( + transitive_types = depset() + + # If a subset of linked npm dependencies are not bundled, it is up to the user to re-specify + # these in `data` if they are runtime dependencies to progagate to binary rules or `srcs` if + # they are to be propagated to downstream build targets. + npm_sources = js_lib_helpers.gather_npm_sources( srcs = ctx.attr.srcs, deps = [], ) - npm_linked_packages = struct( - direct_files = npm_linked_packages.direct_files, - direct = npm_linked_packages.direct, - transitive_files = npm_linked_packages.direct_files, - transitive = npm_linked_packages.direct, - ) - npm_package_store_deps = js_lib_helpers.gather_npm_package_store_deps( + npm_package_store_infos = js_lib_helpers.gather_npm_package_store_infos( targets = ctx.attr.data, ) runfiles = js_lib_helpers.gather_runfiles( ctx = ctx, sources = output_sources_depset, data = ctx.attr.data, - deps = [], + deps = [], # when bundling, don't propogate any transitive runfiles from dependencies ) else: # If we're not bundling then include all transitive files @@ -420,16 +424,16 @@ def _esbuild_impl(ctx): sources = output_sources_depset, targets = ctx.attr.srcs + ctx.attr.deps, ) - transitive_declarations = js_lib_helpers.gather_transitive_declarations( - declarations = [], + transitive_types = js_lib_helpers.gather_transitive_types( + types = [], targets = ctx.attr.srcs + ctx.attr.deps, ) - npm_linked_packages = js_lib_helpers.gather_npm_linked_packages( + npm_sources = js_lib_helpers.gather_npm_sources( srcs = ctx.attr.srcs, deps = ctx.attr.deps, ) - npm_package_store_deps = js_lib_helpers.gather_npm_package_store_deps( - targets = ctx.attr.data + ctx.attr.deps, + npm_package_store_infos = js_lib_helpers.gather_npm_package_store_infos( + targets = ctx.attr.srcs + ctx.attr.data + ctx.attr.deps, ) runfiles = js_lib_helpers.gather_runfiles( ctx = ctx, @@ -444,14 +448,13 @@ def _esbuild_impl(ctx): runfiles = runfiles, ), js_info( - npm_linked_package_files = npm_linked_packages.direct_files, - npm_linked_packages = npm_linked_packages.direct, - npm_package_store_deps = npm_package_store_deps, + target = ctx.label, sources = output_sources_depset, - transitive_npm_linked_package_files = npm_linked_packages.transitive_files, - transitive_npm_linked_packages = npm_linked_packages.transitive, + types = depset(), # esbuild does not emit types directly transitive_sources = transitive_sources, - transitive_declarations = transitive_declarations, + transitive_types = transitive_types, + npm_sources = npm_sources, + npm_package_store_infos = npm_package_store_infos, ), ] diff --git a/esbuild/repositories.bzl b/esbuild/repositories.bzl index 2cf8b05..a032749 100644 --- a/esbuild/repositories.bzl +++ b/esbuild/repositories.bzl @@ -4,7 +4,7 @@ These are needed for local dev, and users must install them as well. See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies """ -load("@aspect_rules_js//npm:npm_import.bzl", "npm_import") +load("@aspect_rules_js//npm:repositories.bzl", "npm_import") load("@bazel_skylib//lib:versions.bzl", "versions") load("//esbuild/private:toolchains_repo.bzl", "get_platforms", "toolchains_repo") load("//esbuild/private:versions.bzl", "TOOL_VERSIONS") @@ -126,10 +126,8 @@ If you need custom versions, please file an issue.""".format(esbuild_version, TO npm_import( name = "npm__esbuild_" + esbuild_version, - run_lifecycle_hooks = False, + lifecycle_hooks = [], integrity = TOOL_VERSIONS[esbuild_version]["npm"], package = "esbuild", version = esbuild_version, - register_copy_directory_toolchains = register, - register_copy_to_directory_toolchains = register, ) diff --git a/examples/plugins/pnpm-lock.yaml b/examples/plugins/pnpm-lock.yaml index 1bd7f38..d70ea19 100644 --- a/examples/plugins/pnpm-lock.yaml +++ b/examples/plugins/pnpm-lock.yaml @@ -1,37 +1,32 @@ -lockfileVersion: 5.3 +lockfileVersion: '6.0' -specifiers: - esbuild-plugin-svg: ^0.1.0 +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: - esbuild-plugin-svg: 0.1.0 + esbuild-plugin-svg: + specifier: ^0.1.0 + version: 0.1.0 packages: - /@trysound/sax/0.2.0: - resolution: - { - integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==, - } - engines: { node: '>=10.13.0' } + + /@trysound/sax@0.2.0: + resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} + engines: {node: '>=10.13.0'} dev: false - /boolbase/1.0.0: - resolution: { integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24= } + /boolbase@1.0.0: + resolution: {integrity: sha1-aN/1++YMUes3cl6p4+0xDcwed24=} dev: false - /commander/7.2.0: - resolution: - { - integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==, - } - engines: { node: '>= 10' } + /commander@7.2.0: + resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} + engines: {node: '>= 10'} dev: false - /css-select/4.3.0: - resolution: - { - integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==, - } + /css-select@4.3.0: + resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} dependencies: boolbase: 1.0.0 css-what: 6.1.0 @@ -40,134 +35,89 @@ packages: nth-check: 2.0.1 dev: false - /css-tree/1.1.3: - resolution: - { - integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==, - } - engines: { node: '>=8.0.0' } + /css-tree@1.1.3: + resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} + engines: {node: '>=8.0.0'} dependencies: mdn-data: 2.0.14 source-map: 0.6.1 dev: false - /css-what/6.1.0: - resolution: - { - integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==, - } - engines: { node: '>= 6' } + /css-what@6.1.0: + resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} + engines: {node: '>= 6'} dev: false - /csso/4.2.0: - resolution: - { - integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==, - } - engines: { node: '>=8.0.0' } + /csso@4.2.0: + resolution: {integrity: sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==} + engines: {node: '>=8.0.0'} dependencies: css-tree: 1.1.3 dev: false - /dom-serializer/1.4.1: - resolution: - { - integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==, - } + /dom-serializer@1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} dependencies: domelementtype: 2.3.0 domhandler: 4.3.1 entities: 2.2.0 dev: false - /domelementtype/2.3.0: - resolution: - { - integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==, - } + /domelementtype@2.3.0: + resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} dev: false - /domhandler/4.3.1: - resolution: - { - integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==, - } - engines: { node: '>= 4' } + /domhandler@4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} dependencies: domelementtype: 2.3.0 dev: false - /domutils/2.8.0: - resolution: - { - integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==, - } + /domutils@2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} dependencies: dom-serializer: 1.4.1 domelementtype: 2.3.0 domhandler: 4.3.1 dev: false - /entities/2.2.0: - resolution: - { - integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==, - } + /entities@2.2.0: + resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} dev: false - /esbuild-plugin-svg/0.1.0: - resolution: - { - integrity: sha512-/9ZhvIpl+Ovl6glVK3BedvIwrOwSQnECw4Fy6ZwysWib3Ns7UkX6WNGjMOWtvQ1Cnm0uc7sptiKGm0BthKCAJA==, - } + /esbuild-plugin-svg@0.1.0: + resolution: {integrity: sha512-/9ZhvIpl+Ovl6glVK3BedvIwrOwSQnECw4Fy6ZwysWib3Ns7UkX6WNGjMOWtvQ1Cnm0uc7sptiKGm0BthKCAJA==} dependencies: svgo: 2.8.0 dev: false - /mdn-data/2.0.14: - resolution: - { - integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==, - } + /mdn-data@2.0.14: + resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} dev: false - /nth-check/2.0.1: - resolution: - { - integrity: sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==, - } + /nth-check@2.0.1: + resolution: {integrity: sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==} dependencies: boolbase: 1.0.0 dev: false - /picocolors/1.0.0: - resolution: - { - integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==, - } + /picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: false - /source-map/0.6.1: - resolution: - { - integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, - } - engines: { node: '>=0.10.0' } + /source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} dev: false - /stable/0.1.8: - resolution: - { - integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==, - } + /stable@0.1.8: + resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} dev: false - /svgo/2.8.0: - resolution: - { - integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==, - } - engines: { node: '>=10.13.0' } + /svgo@2.8.0: + resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} + engines: {node: '>=10.13.0'} hasBin: true dependencies: '@trysound/sax': 0.2.0 diff --git a/internal_deps.bzl b/internal_deps.bzl index 7052980..4e287b1 100644 --- a/internal_deps.bzl +++ b/internal_deps.bzl @@ -10,14 +10,6 @@ load("//esbuild/private:maybe.bzl", http_archive = "maybe_http_archive") def rules_esbuild_internal_deps(): "Fetch deps needed for local development" - # opt-in to 2.0 without forcing users to do so - http_archive( - name = "aspect_bazel_lib", - sha256 = "8d71a578e4e1b6a54aea7598ebfbd8fc9e3be5da881ff9d2b80249577b933a40", - strip_prefix = "bazel-lib-2.2.0", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.2.0/bazel-lib-v2.2.0.tar.gz", - ) - http_archive( name = "io_bazel_stardoc", sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",