Skip to content

Commit

Permalink
refactor: remove references to pnpm-lock specifiers field (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard authored Apr 19, 2024
1 parent a3c6582 commit 15aede8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions npm/private/test/parse_pnpm_lock_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ packages:
expected = (
{
".": {
"specifiers": {
"@aspect-test/a": "5.0.0",
},
"dependencies": {
"@aspect-test/a": "5.0.0",
},
Expand Down Expand Up @@ -169,7 +166,6 @@ packages:
expected = (
{
".": {
"specifiers": {},
"dependencies": {
"@aspect-test/a": "5.0.0",
},
Expand Down
16 changes: 6 additions & 10 deletions npm/private/utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,13 @@ def _convert_v6_importers(importers):
# Convert pnpm lockfile v6 importers to a rules_js compatible format.
result = {}
for import_path, importer in importers.items():
result[import_path] = {
"specifiers": {},
"dependencies": {},
"optionalDependencies": {},
"devDependencies": {},
}
result[import_path] = {}
for key in ["dependencies", "optionalDependencies", "devDependencies"]:
deps = importer.get(key, {})
for name, attributes in deps.items():
result[import_path][key][name] = _convert_pnpm_v6_package_name(attributes.get("version"))
deps = importer.get(key, None)
if deps != None:
result[import_path][key] = {}
for name, attributes in deps.items():
result[import_path][key][name] = _convert_pnpm_v6_package_name(attributes.get("version"))
return result

def _convert_v6_packages(packages):
Expand Down Expand Up @@ -192,7 +189,6 @@ def _parse_pnpm_lock_common(parsed, err):

importers = parsed.get("importers", {
".": {
"specifiers": parsed.get("specifiers", {}),
"dependencies": parsed.get("dependencies", {}),
"optionalDependencies": parsed.get("optionalDependencies", {}),
"devDependencies": parsed.get("devDependencies", {}),
Expand Down

0 comments on commit 15aede8

Please sign in to comment.