Skip to content

Commit

Permalink
refactor(pnpm): strip special characters from pkg labels (#1821)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard authored Jun 27, 2024
1 parent ae87a9b commit 34d1ca8
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 63 deletions.
2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ npm = use_extension(
# Deep with many peers
"lock-%s__at_rollup_plugin-typescript__8.2.1__%s" % (
version,
"ommloj5qql5ba6x5wuiluawhoi" if version == "v54" else "-1662662592" if version == "v90" else "-1662692290",
"ommloj5qql5ba6x5wuiluawhoi" if version == "v54" else "1662662592" if version == "v90" else "1662692290",
),

# Dep with patch
Expand Down
2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def lockfile_test(name = None):
# npm: alias to a package that has many peers
":node_modules/rollup-plugin-with-peers",
# underlying repo for the many-peers package
"@%s__at_rollup_plugin-typescript__8.2.1__%s//:pkg" % (lock_repo, "ommloj5qql5ba6x5wuiluawhoi" if lock_version == "v54" else "-1662662592" if lock_version == "v90" else "-1662692290"),
"@%s__at_rollup_plugin-typescript__8.2.1__%s//:pkg" % (lock_repo, "ommloj5qql5ba6x5wuiluawhoi" if lock_version == "v54" else "1662662592" if lock_version == "v90" else "1662692290"),

# uuv 'hasBin'
":node_modules/uvu",
Expand Down
2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/v60/snapshots/defs.bzl

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

2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/v61/snapshots/defs.bzl

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

2 changes: 1 addition & 1 deletion e2e/pnpm_lockfiles/v90/snapshots/defs.bzl

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

5 changes: 2 additions & 3 deletions npm/private/pnpm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ def _convert_pnpm_v6_v9_version_peer_dep(version):
# Prevent long paths. The pnpm lockfile v6 no longer hashes long sequences of
# peer deps so we must hash here to prevent extremely long file paths that lead to
# "File name too long) build failures.
peer_dep = "_" + utils.hash(peer_dep)
version = version[0:peer_dep_index] + utils.sanitize_string(peer_dep)
version = version.rstrip("_")
peer_dep = utils.hash(peer_dep)
version = version[0:peer_dep_index] + "_" + utils.sanitize_string(peer_dep)
return version

def _strip_v6_default_registry_to_version(name, version):
Expand Down
10 changes: 5 additions & 5 deletions npm/private/test/snapshots/bzlmod/npm_defs.bzl

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

10 changes: 5 additions & 5 deletions npm/private/test/snapshots/wksp/npm_defs.bzl

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

Loading

0 comments on commit 34d1ca8

Please sign in to comment.