Skip to content

Commit

Permalink
fix(pnpm): npm: aliases to packages with peer deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Jun 27, 2024
1 parent b1dc67f commit 1d8259a
Show file tree
Hide file tree
Showing 21 changed files with 1,044 additions and 135 deletions.
21 changes: 16 additions & 5 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ npm = use_extension(
use_repo(
npm,
"lock-%s" % version,
"lock-%s__rollup__3.2.5" % version,
"lock-%s__rollup__3.2.5__links" % version,

# TODO: inconsistent across versions
# "lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2" % version,
# "lock-%s__at_aspect-test_d__2.0.0__at_aspect-test_c_2.0.2__links" % version,
# Dep with bin entries etc
"lock-%s__rollup__2.14.0" % version,
"lock-%s__rollup__2.14.0__links" % version,

# Dep with peers
"lock-%s__at_aspect-test_d__2.0.0_at_aspect-test_c_2.0.2" % version,
"lock-%s__at_aspect-test_d__2.0.0_at_aspect-test_c_2.0.2__links" % version,

# 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",
),

# Dep with patch
"lock-%s__meaning-of-life__1.0.0_o3deharooos255qt5xdujc3cuq" % version,
)
for version in PNPM_LOCK_VERSIONS
]
Expand Down
8 changes: 6 additions & 2 deletions e2e/pnpm_lockfiles/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"debug": "ngokevin/debug#9742c5f383a6f8046241920156236ade8ec30d53",
"hello": "https://gitpkg.vercel.app/EqualMa/gitpkg-hello/packages/hello",
"jsonify": "https://github.com/aspect-build/test-packages/releases/download/0.0.0/@foo-jsonify-0.0.0.tgz",
"rollup": "3.2.5",
"rollup": "2.14.0",
"rollup-plugin-with-peers": "npm:@rollup/plugin-typescript@8.2.1",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
"meaning-of-life": "1.0.0",
"is-odd": "3.0.1",
"is-odd-alt-version": "npm:is-odd@^2.0.0",
Expand Down Expand Up @@ -39,7 +42,8 @@
],
"overrides": {
"is-number": "file:../vendored/is-number",
"diff": "https://github.com/kpdecker/jsdiff/archive/refs/tags/v5.2.0.tar.gz"
"diff": "https://github.com/kpdecker/jsdiff/archive/refs/tags/v5.2.0.tar.gz",
"fsevents": "^2.3"
}
}
}
13 changes: 7 additions & 6 deletions e2e/pnpm_lockfiles/lockfile-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ BZL_FILES = {
"defs.bzl": "@REPO_NAME//:defs.bzl",

# hasBin, optional deps, deps
"rollup_links_defs.bzl": "@REPO_NAME__rollup__3.2.5__links//:defs.bzl",
"rollup_package_json.bzl": "@REPO_NAME__rollup__3.2.5//VERSION:package_json.bzl",

# TODO: inconsistent across versions
# peers
# "aspect_test_d_defs.bzl": "@REPO_NAME__@aspect-test+d__2.0.0_@aspect-test+c__2.0.2//:defs.bzl",
"rollup_links_defs.bzl": "@REPO_NAME__rollup__2.14.0__links//:defs.bzl",
"rollup_package_json.bzl": "@REPO_NAME__rollup__2.14.0//VERSION:package_json.bzl",
}

def lockfile_test(name = None):
Expand Down Expand Up @@ -88,6 +84,11 @@ def lockfile_test(name = None):
# rollup has a 'optionalDependency' (fsevents)
":node_modules/rollup",

# 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"),

# uuv 'hasBin'
":node_modules/uvu",

Expand Down
105 changes: 100 additions & 5 deletions e2e/pnpm_lockfiles/v54/pnpm-lock.yaml

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

Loading

0 comments on commit 1d8259a

Please sign in to comment.