From a6d8514c539174fdbe4636479bdd2667f3685b80 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Tue, 2 Apr 2024 18:51:26 -0400 Subject: [PATCH] refactor: remove unused warn_on_unqualified_tarball_url from npm_translate_lock (#1568) --- docs/npm_translate_lock.md | 3 +-- npm/private/npm_translate_lock.bzl | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/npm_translate_lock.md b/docs/npm_translate_lock.md index 7c0411360..bede3b382 100644 --- a/docs/npm_translate_lock.md +++ b/docs/npm_translate_lock.md @@ -68,7 +68,7 @@ npm_translate_lock(name, external_repository_action_cache, link_workspace, pnpm_version, use_pnpm, register_copy_directory_toolchains, register_copy_to_directory_toolchains, register_yq_toolchains, register_tar_toolchains, npm_package_target_name, - use_starlark_yaml_parser, package_json, warn_on_unqualified_tarball_url, kwargs) + use_starlark_yaml_parser, package_json, kwargs) Repository macro to generate starlark code from a lock file. @@ -139,7 +139,6 @@ For more about how to use npm_translate_lock, read [pnpm and rules_js](/docs/pnp | npm_package_target_name | The name of linked `npm_package` targets. When `npm_package` targets are linked as pnpm workspace packages, the name of the target must align with this value.

The `{dirname}` placeholder is replaced with the directory name of the target.

By default the directory name of the target is used.

Default: `{dirname}` | `"{dirname}"` | | use_starlark_yaml_parser | Opt-out of using `yq` to parse the pnpm-lock file which was added in https://github.com/aspect-build/rules_js/pull/1458 and use the legacy starlark yaml parser instead.

This opt-out is a return safety in cases where yq is not able to parse the pnpm generated yaml file. For example, this has been observed to happen due to a line such as the following in the pnpm generated lock file:

resolution: {tarball: https://gitpkg.vercel.app/blockprotocol/blockprotocol/packages/%40blockprotocol/type-system-web?6526c0e}


where the `?` character in the `tarball` value causes `yq` to fail with:

$ yq pnpm-lock.yaml -o=json
Error: bad file 'pnpm-lock.yaml': yaml: line 7129: did not find expected ',' or '}'


If the tarball value is quoted or escaped then yq would accept it but as of this writing, the latest version of pnpm (8.14.3) does not quote or escape such a value and the latest version of yq (4.40.5) does not handle it as is.

Possibly related to https://github.com/pnpm/pnpm/issues/5414. | `False` | | package_json | Deprecated.

Add all `package.json` files that are part of the workspace to `data` instead. | `None` | -| warn_on_unqualified_tarball_url | Deprecated. Will be removed in next major release. | `None` | | kwargs | Internal use only | none | diff --git a/npm/private/npm_translate_lock.bzl b/npm/private/npm_translate_lock.bzl index 97d3946f6..1f4e87d0a 100644 --- a/npm/private/npm_translate_lock.bzl +++ b/npm/private/npm_translate_lock.bzl @@ -194,9 +194,6 @@ def npm_translate_lock( use_starlark_yaml_parser = False, # TODO(2.0): remove package_json package_json = None, - # TODO(2.0): remove warn_on_unqualified_tarball_url - # buildifier: disable=unused-variable - warn_on_unqualified_tarball_url = None, **kwargs): """Repository macro to generate starlark code from a lock file. @@ -521,8 +518,6 @@ def npm_translate_lock( Add all `package.json` files that are part of the workspace to `data` instead. - warn_on_unqualified_tarball_url: Deprecated. Will be removed in next major release. - npm_package_target_name: The name of linked `npm_package` targets. When `npm_package` targets are linked as pnpm workspace packages, the name of the target must align with this value.