Skip to content

Commit

Permalink
fix(pnpm): pnpm9 npm: dependencies with peers
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Jun 4, 2024
1 parent 3e08f8e commit 677033d
Show file tree
Hide file tree
Showing 7 changed files with 4,983 additions and 8 deletions.
2 changes: 2 additions & 0 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
"docusaurus-direct-peer-v6.yaml",
"docusaurus-direct-peer-v9.yaml",
]

bazel_dep(name = "aspect_bazel_lib", version = "2.7.7")
Expand Down
1 change: 1 addition & 0 deletions e2e/pnpm_lockfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ cases run on each of those lockfiles.
- `isaacs-cliui-v*`: a transitive `npm:` dependency as an alias to use multiple versions of a single package, this is different then a direct `npm:` dependency
- `override-with-alias-url-v9` - a package overridden with a different package
- `tarball-no-url-v54` - a package with a tarball but not a full URL
- `docusaurus-direct-peer-v*` - a direct dependency with a (peer=123) in the `importers` including within `npm:` dependencies
8 changes: 8 additions & 0 deletions e2e/pnpm_lockfiles/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
"docusaurus-direct-peer-v6.yaml",
"docusaurus-direct-peer-v9.yaml",
]

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
Expand Down Expand Up @@ -63,6 +65,8 @@ npm_repositories_v90()
for lockfile in PNPM_LOCK_TEST_CASES
]

load("@docusaurus-direct-peer-v6//:repositories.bzl", npm_repositories_direct_with_peers_v6 = "npm_repositories")
load("@docusaurus-direct-peer-v9//:repositories.bzl", npm_repositories_direct_with_peers_v9 = "npm_repositories")
load("@isaacs-cliui-v90//:repositories.bzl", npm_repositories_isaacs_cliui_v90 = "npm_repositories")
load("@override-with-alias-url-v9//:repositories.bzl", npm_repositories_override_with_alias_v90 = "npm_repositories")
load("@tarball-no-url-v54//:repositories.bzl", npm_repositories_tarball_no_url_v54 = "npm_repositories")
Expand All @@ -72,3 +76,7 @@ npm_repositories_tarball_no_url_v54()
npm_repositories_override_with_alias_v90()

npm_repositories_isaacs_cliui_v90()

npm_repositories_direct_with_peers_v6()

npm_repositories_direct_with_peers_v9()
18 changes: 18 additions & 0 deletions e2e/pnpm_lockfiles/cases/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@docusaurus-direct-peer-v6//:defs.bzl", docusaurus_direct_with_peers_v6_link_all = "npm_link_all_packages")
load("@docusaurus-direct-peer-v9//:defs.bzl", docusaurus_direct_with_peers_v9_link_all = "npm_link_all_packages")
load("@isaacs-cliui-v90//:defs.bzl", isaacs_cliui_v90_link_all = "npm_link_all_packages")
load("@override-with-alias-url-v9//:defs.bzl", override_with_alias_link_all = "npm_link_all_packages")
load("@tarball-no-url-v54//:defs.bzl", tarball_no_url_link_all = "npm_link_all_packages")
Expand Down Expand Up @@ -34,3 +36,19 @@ build_test(
":isaacs_cliui_v90-modules/@isaacs/cliui",
],
)

docusaurus_direct_with_peers_v9_link_all(name = "docusaurus_direct_with_peers_v9-modules")

docusaurus_direct_with_peers_v6_link_all(name = "docusaurus_direct_with_peers_v6-modules")

build_test(
name = "docusaurus_direct_with_peers",
targets = [
":docusaurus_direct_with_peers_v9-modules",
":docusaurus_direct_with_peers_v9-modules/@docusaurus/module-type-aliases",

# TODO: causes 'conflicting actions' error
# ":docusaurus_direct_with_peers_v6-modules",
# ":docusaurus_direct_with_peers_v6-modules/@docusaurus/module-type-aliases",
],
)
Loading

0 comments on commit 677033d

Please sign in to comment.